Skip to content

Commit 31fcdae

Browse files
Merge pull request #29 from ParasolJS/develop
version 1.0.2
2 parents f0b4e10 + 3360aa4 commit 31fcdae

6 files changed

Lines changed: 67 additions & 42 deletions

File tree

dist/parasol.esm.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/parasol.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/parasol.standalone.js

Lines changed: 58 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5090,7 +5090,7 @@
50905090
var array$3 = Array.prototype;
50915091

50925092
var map$2 = array$3.map;
5093-
var slice$5 = array$3.slice;
5093+
var slice$6 = array$3.slice;
50945094

50955095
var implicit = {name: "implicit"};
50965096

@@ -5099,7 +5099,7 @@
50995099
domain = [],
51005100
unknown = implicit;
51015101

5102-
range = range == null ? [] : slice$5.call(range);
5102+
range = range == null ? [] : slice$6.call(range);
51035103

51045104
function scale(d) {
51055105
var key = d + "", i = index.get(key);
@@ -5119,7 +5119,7 @@
51195119
};
51205120

51215121
scale.range = function(_) {
5122-
return arguments.length ? (range = slice$5.call(_), scale) : range.slice();
5122+
return arguments.length ? (range = slice$6.call(_), scale) : range.slice();
51235123
};
51245124

51255125
scale.unknown = function(_) {
@@ -5335,11 +5335,11 @@
53355335
};
53365336

53375337
scale.range = function(_) {
5338-
return arguments.length ? (range = slice$5.call(_), rescale()) : range.slice();
5338+
return arguments.length ? (range = slice$6.call(_), rescale()) : range.slice();
53395339
};
53405340

53415341
scale.rangeRound = function(_) {
5342-
return range = slice$5.call(_), interpolate$$1 = interpolateRound, rescale();
5342+
return range = slice$6.call(_), interpolate$$1 = interpolateRound, rescale();
53435343
};
53445344

53455345
scale.clamp = function(_) {
@@ -7814,7 +7814,7 @@
78147814
for (var i = 0; i < axisBrushes.length; i++) {
78157815
var brush$$1 = document.getElementById('brush-' + pos + '-' + i);
78167816

7817-
if (brushSelection(brush$$1) !== null) {
7817+
if (brush$$1 && brushSelection(brush$$1) !== null) {
78187818
return true;
78197819
}
78207820
}
@@ -7826,7 +7826,9 @@
78267826
var extents = actives.map(function (p) {
78277827
var axisBrushes = brushes[p];
78287828

7829-
return axisBrushes.map(function (d, i) {
7829+
return axisBrushes.filter(function (d) {
7830+
return !pc.hideAxis().includes(d);
7831+
}).map(function (d, i) {
78307832
return brushSelection(document.getElementById('brush-' + Object.keys(config.dimensions).indexOf(p) + '-' + i));
78317833
}).map(function (d, i) {
78327834
if (d === null || d === undefined) {
@@ -8131,20 +8133,32 @@
81318133
return function (extents) {
81328134
var brushes = state.brushes;
81338135

8136+
var hiddenAxes = pc.hideAxis();
81348137

81358138
if (typeof extents === 'undefined') {
8136-
return Object.keys(config.dimensions).reduce(function (acc, cur, pos) {
8139+
return Object.keys(config.dimensions).filter(function (d) {
8140+
return !hiddenAxes.includes(d);
8141+
}).reduce(function (acc, cur, pos) {
81378142
var axisBrushes = brushes[cur];
81388143

81398144
if (axisBrushes === undefined || axisBrushes === null) {
81408145
acc[cur] = [];
81418146
} else {
81428147
acc[cur] = axisBrushes.reduce(function (d, p, i) {
8143-
var range = brushSelection(document.getElementById('brush-' + pos + '-' + i));
8144-
if (range !== null) {
8145-
d = d.push(range);
8146-
}
8148+
var raw = brushSelection(document.getElementById('brush-' + pos + '-' + i));
81478149

8150+
if (raw) {
8151+
var yScale = config.dimensions[cur].yscale;
8152+
var scaled = invertByScale(raw, yScale);
8153+
8154+
d.push({
8155+
extent: p.brush.extent(),
8156+
selection: {
8157+
raw: raw,
8158+
scaled: scaled
8159+
}
8160+
});
8161+
}
81488162
return d;
81498163
}, []);
81508164
}
@@ -8210,12 +8224,15 @@
82108224
Object.keys(config.dimensions).forEach(function (d, pos) {
82118225
var axisBrush = brushes[d];
82128226

8213-
axisBrush.forEach(function (e, i) {
8214-
var brush$$1 = document.getElementById('brush-' + pos + '-' + i);
8215-
if (brushSelection(brush$$1) !== null) {
8216-
pc.g().select('#brush-' + pos + '-' + i).call(e.brush.move, null);
8217-
}
8218-
});
8227+
// hidden axes will be undefined
8228+
if (axisBrush) {
8229+
axisBrush.forEach(function (e, i) {
8230+
var brush$$1 = document.getElementById('brush-' + pos + '-' + i);
8231+
if (brush$$1 && brushSelection(brush$$1) !== null) {
8232+
pc.g().select('#brush-' + pos + '-' + i).call(e.brush.move, null);
8233+
}
8234+
});
8235+
}
82198236
});
82208237

82218238
pc.renderBrushed();
@@ -8225,16 +8242,18 @@
82258242
var axisBrush = brushes[dimension];
82268243
var pos = Object.keys(config.dimensions).indexOf(dimension);
82278244

8228-
axisBrush.forEach(function (e, i) {
8229-
var brush$$1 = document.getElementById('brush-' + pos + '-' + i);
8230-
if (brushSelection(brush$$1) !== null) {
8231-
pc.g().select('#brush-' + pos + '-' + i).call(e.brush.move, null);
8245+
if (axisBrush) {
8246+
axisBrush.forEach(function (e, i) {
8247+
var brush$$1 = document.getElementById('brush-' + pos + '-' + i);
8248+
if (brushSelection(brush$$1) !== null) {
8249+
pc.g().select('#brush-' + pos + '-' + i).call(e.brush.move, null);
82328250

8233-
if (typeof e.event === 'function') {
8234-
e.event(select('#brush-' + pos + '-' + i));
8251+
if (typeof e.event === 'function') {
8252+
e.event(select('#brush-' + pos + '-' + i));
8253+
}
82358254
}
8236-
}
8237-
});
8255+
});
8256+
}
82388257

82398258
pc.renderBrushed();
82408259
}
@@ -8258,12 +8277,16 @@
82588277
pc.createAxes();
82598278
}
82608279

8280+
var hiddenAxes = pc.hideAxis();
8281+
82618282
pc.g().append('svg:g').attr('id', function (d, i) {
82628283
return 'brush-group-' + i;
82638284
}).attr('class', 'brush-group').attr('dimension', function (d) {
82648285
return d;
82658286
}).each(function (d) {
8266-
brushFor$1(state, config, pc, events, brushGroup)(d, select(this));
8287+
if (!hiddenAxes.includes(d)) {
8288+
brushFor$1(state, config, pc, events, brushGroup)(d, select(this));
8289+
}
82678290
});
82688291

82698292
pc.brushExtents = brushExtents$1(state, config, pc, events, brushGroup);
@@ -11198,7 +11221,7 @@
1119811221
};
1119911222
};
1120011223

11201-
var brushReset$4 = function brushReset(config) {
11224+
var brushReset$4 = function brushReset(config, pc) {
1120211225
return function (dimension) {
1120311226
var brushesToKeep = [];
1120411227
for (var j = 0; j < config.brushes.length; j++) {
@@ -11472,7 +11495,7 @@
1147211495
};
1147311496
};
1147411497

11475-
var version$1 = "2.2.8";
11498+
var version$1 = "2.2.10";
1147611499

1147711500
var DefaultConfig = {
1147811501
data: [],
@@ -11662,8 +11685,10 @@
1166211685
pc.render();
1166311686
}
1166411687
}).on('hideAxis', function (d) {
11688+
pc.brushReset();
1166511689
pc.dimensions(pc.applyDimensionDefaults());
1166611690
pc.dimensions(without(config.dimensions, d.value));
11691+
pc.render();
1166711692
}).on('flipAxes', function (d) {
1166811693
if (d.value && d.value.length) {
1166911694
d.value.forEach(function (dimension) {
@@ -11793,7 +11818,7 @@
1179311818
pc.updateAxes = updateAxes(config, pc, position, axis, flags);
1179411819
pc.applyAxisConfig = applyAxisConfig;
1179511820
pc.brushable = brushable(config, pc, flags);
11796-
pc.brushReset = brushReset$4(config);
11821+
pc.brushReset = brushReset$4(config, pc);
1179711822
pc.selected = selected$4(config, pc);
1179811823
pc.reorderable = reorderable(config, pc, xscale, position, dragging, flags);
1179911824

@@ -37777,7 +37802,7 @@
3777737802
* @param {number} [end=array.length] The end position.
3777837803
* @returns {Array} Returns the slice of `array`.
3777937804
*/
37780-
function slice$7(array, start, end) {
37805+
function slice$8(array, start, end) {
3778137806
var length = array == null ? 0 : array.length;
3778237807
if (!length) {
3778337808
return [];
@@ -40608,7 +40633,7 @@
4060840633
initial, intersection: intersection$1, intersectionBy, intersectionWith, join,
4060940634
last, lastIndexOf, nth, pull, pullAll,
4061040635
pullAllBy, pullAllWith, pullAt, remove: remove$1, reverse: reverse$1,
40611-
slice: slice$7, sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex,
40636+
slice: slice$8, sortedIndex, sortedIndexBy, sortedIndexOf, sortedLastIndex,
4061240637
sortedLastIndexBy, sortedLastIndexOf, sortedUniq, sortedUniqBy, tail,
4061340638
take, takeRight, takeRightWhile, takeWhile, union,
4061440639
unionBy, unionWith, uniq, uniqBy, uniqWith,
@@ -46819,7 +46844,7 @@
4681946844
};
4682046845
};
4682146846

46822-
var version$2 = "1.0.0";
46847+
var version$2 = "1.0.1";
4682346848

4682446849
//css
4682546850

dist/parasol.standalone.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parasol-es",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "ES6 module for interactive visualization of multi-objective optimization problems, based on d3-v5 and parcoords-es modules",
55
"main": "dist/parasol.js",
66
"module": "dist/parasol.esm.js",
@@ -92,7 +92,7 @@
9292
"ml-distance-euclidean": "^2.0.0",
9393
"ml-kmeans": "^4.2.1",
9494
"ml-xsadd": "^2.0.0",
95-
"parcoord-es": "^2.2.8",
95+
"parcoord-es": "^2.2.10",
9696
"random": "^2.0.12",
9797
"slickgrid-es6": "^3.0.1"
9898
}

0 commit comments

Comments
 (0)