Skip to content

Commit

Permalink
Merge branch 'release/v1.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
joshhjacobson committed Apr 4, 2019
2 parents f7d49d4 + 35df32a commit fb6db28
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 93 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ This library is based on D3 V5 API and extends upon [parcoords-es](https://githu
alt="install size">
</a> -->

[![npm version](https://img.shields.io/npm/v/parasol-es.svg?style=flat-square)](https://www.npmjs.com/package/parasol-es)
[![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg?style=flat-square)](https://opensource.org/licenses/MIT)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

Expand All @@ -41,6 +42,9 @@ This library is based on D3 V5 API and extends upon [parcoords-es](https://githu
* [Issues](https://github.com/ParasolJS/parasol-es/issues)
* [Wiki](https://github.com/ParasolJS/parasol-es/wiki)

## References
Raseman, W.J., Jacobson, J., Kasprzyk, J.R., 2019. *Parasol: an open source, interactive parallel coordinates library for multi-objective decision making.* Environmental Modelling & Software 116, 153–163. https://doi.org/10.1016/j.envsoft.2019.03.005

## Usage
### Node/ES6
1. Install Parasol in your project:
Expand Down
13 changes: 4 additions & 9 deletions demo/paper-example-1.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,14 @@ <h1> Linked plots with buttons for filtering and exporting data</h1>
var ps = Parasol(data)('.parcoords');

// initially, all data is shown on both plots. determine which data to hide on each plot
var axes_to_hide = {
0: ['economy (mpg)', 'cylinders', 'displacement (cc)'], // hidden from first plot
1: ['name', 'power (hp)'] // hidden from second plot
var layout = {
0: ['power (hp)', 'weight (lb)', '0-60 mph (s)', 'year'],
1: ['economy (mpg)', 'cylinders', 'displacement (cc)']
}
// var layout = {
// 0: ['power (hp)', 'weight (lb)', '0-60 mph (s)'],
// 1: ['economy (mpg)', 'cylinders']
// }

// apply Parasol API
ps.linked()
.hideAxes(axes_to_hide)
// .setAxesLayout(layout) // TODO: replace hideAxes() with setAxesLayout()
.setAxesLayout(layout)
.alpha(0.5)
.reorderable()
.color(function(data) { return green_gradient(data['economy (mpg)']); }) // quantitative color scale
Expand Down
11 changes: 5 additions & 6 deletions demo/paper-example-2.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,17 @@ <h1> k-Means clustering and linked grid</h1>
});

// divide data into two plots
// TODO: change these partitions so there is no redundant data between plots
var partition = {
0: ['name', 'displacement (cc)'],
1: ['name', 'cylinders', 'power (hp)']
}
var layout = {
0: ['power (hp)', 'weight (lb)', '0-60 mph (s)', 'year'],
1: ['economy (mpg)', 'cylinders', 'displacement (cc)']
}

// create Parasol object, add grid, link, and perform clustering
var ps = Parasol(data)('.parcoords')
.attachGrid({container: '#grid'})
.linked()
.cluster({k: k, vars: cluster_vars, hidden: true})
.hideAxes(partition)
.setAxesLayout(layout)
.alpha(0.2) // change transparency
.reorderable() // make axes dynamically reorderable
.render()
Expand Down
12 changes: 2 additions & 10 deletions demo/paper-example-3.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<link rel="stylesheet" type="text/css" href="parasol.css">

<script src="./lib/d3.v5.min.js"></script>
<script src="./lib/slyvester.js"></script>
<script src="./parasol.standalone.js"></script>

<body>
Expand Down Expand Up @@ -70,14 +69,7 @@ <h1> Weighted sum method and bundling using clusters </h1>
.attachGrid({container: '#grid'})
.linked()
.cluster({k: 4, vars: cluster_vars, hidden: false})
.hideAxes(['name'])
// .hideAxes(['economy (mpg)'])
// .hideAxes(['cylinders'])
// .hideAxes(['displacement (cc)'])
// .hideAxes(['power (hp)'])
.hideAxes(['weight (lb)'])
.hideAxes(['0-60 mph (s)'])
// .hideAxes(['year'])
.hideAxes(['name', 'weight (lb)', '0-60 mph (s)'])
.alpha(0.05) // update transparency
.reorderable() // make axes dynamically reorderable
.render()
Expand All @@ -92,7 +84,7 @@ <h1> Weighted sum method and bundling using clusters </h1>
'power (hp)': d3.select("#power_weight_slider").property("value")
};

ps.weightedSums({ weights: weights })
ps.weightedSum({ weights: weights }).render();
});

// bundling strength slider
Expand Down
2 changes: 1 addition & 1 deletion dist/parasol.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/parasol.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit fb6db28

Please sign in to comment.