Skip to content
This repository was archived by the owner on May 2, 2022. It is now read-only.

Commit cb8726a

Browse files
committed
Merge branch 'release/v1.3.2'
2 parents b8b4cd1 + 9cdcf41 commit cb8726a

File tree

10 files changed

+22
-49
lines changed

10 files changed

+22
-49
lines changed

dist/muze.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/muze.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.

packages/muze-firebolt/src/side-effects/plot-highlighter/index.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import SurrogateSideEffect from '../surrogate';
22
import { strategies } from './strategy';
33
import { HIGHLIGHTER } from '../../enums/side-effects';
4-
import { getFormattedSet } from './helper';
54

65
export default class PlotHighlighter extends SurrogateSideEffect {
76
constructor (...params) {
@@ -34,21 +33,8 @@ export default class PlotHighlighter extends SurrogateSideEffect {
3433

3534
apply (selectionSet, payload, options = {}) {
3635
const currentStrategy = this._strategies[options.strategy || this._strategy];
37-
const excludeSetIds = this.getExcludeSetIds(options.excludeSet);
3836

39-
// Get all sets except the excludeSet points
40-
const formattedSet = {
41-
...selectionSet,
42-
completeSet: getFormattedSet(selectionSet.completeSet, excludeSetIds),
43-
entrySet: getFormattedSet(selectionSet.entrySet[1], excludeSetIds),
44-
exitSet: getFormattedSet(selectionSet.exitSet[1], excludeSetIds),
45-
mergedEnter: getFormattedSet(selectionSet.mergedEnter, excludeSetIds),
46-
mergedExit: getFormattedSet(selectionSet.mergedExit, excludeSetIds)
47-
};
48-
49-
const totalSet = { selectionSet, formattedSet };
50-
51-
currentStrategy(totalSet, this, payload, excludeSetIds);
37+
currentStrategy(selectionSet, this, payload);
5238

5339
return this;
5440
}

packages/muze-firebolt/src/side-effects/plot-highlighter/strategy.js

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import { intersect, difference } from 'muze-utils';
2-
import { getFormattedSet } from './helper';
32
import { BEHAVIOURS } from '../..';
43

54
const fadeFn = (set, context) => {
6-
const { formattedSet } = set;
75
const {
86
mergedEnter,
97
mergedExit,
10-
exitSet,
118
completeSet
12-
} = formattedSet;
9+
} = set;
1310

1411
if (!mergedEnter.length && !mergedExit.length) {
1512
context.applyInteractionStyle(completeSet, { interactionType: 'fade', apply: false });
@@ -22,23 +19,21 @@ const fadeFn = (set, context) => {
2219
// Apply style only on the hovered layer
2320
if (layerName === 'area') {
2421
context.applyInteractionStyle(mergedEnter, { interactionType: 'fade', apply: true }, [layer]);
25-
context.applyInteractionStyle(exitSet, { interactionType: 'fade', apply: false }, [layer]);
22+
context.applyInteractionStyle(mergedExit, { interactionType: 'fade', apply: false }, [layer]);
2623
} else {
27-
context.applyInteractionStyle(exitSet, { interactionType: 'fade', apply: true }, [layer]);
24+
context.applyInteractionStyle(mergedExit, { interactionType: 'fade', apply: true }, [layer]);
2825
context.applyInteractionStyle(mergedEnter, { interactionType: 'fade', apply: false }, [layer]);
2926
}
3027
});
3128
}
3229
};
3330

3431
const fadeOnBrushFn = (set, context, payload) => {
35-
const { formattedSet } = set;
3632
const {
37-
exitSet,
3833
mergedEnter,
3934
mergedExit,
4035
completeSet
41-
} = formattedSet;
36+
} = set;
4237

4338
const { dragEnd } = payload;
4439
let interactionType = 'brushStroke';
@@ -60,7 +55,7 @@ const fadeOnBrushFn = (set, context, payload) => {
6055
// Apply style only on the hovered layer
6156
if (layerName === 'area') {
6257
if (dragEnd) {
63-
context.applyInteractionStyle(exitSet, { interactionType: 'fade', apply: false }, [layer]);
58+
context.applyInteractionStyle(mergedExit, { interactionType: 'fade', apply: false }, [layer]);
6459
mergedEnter.length &&
6560
context.applyInteractionStyle(mergedEnter, { interactionType: 'focus', apply: true }, [layer]);
6661
}
@@ -85,13 +80,11 @@ export const strategies = {
8580
fade: fadeFn,
8681
fadeOnBrush: fadeOnBrushFn,
8782
focus: (set, context) => {
88-
const { formattedSet } = set;
8983
const {
90-
entrySet,
9184
mergedEnter,
9285
mergedExit,
9386
completeSet
94-
} = formattedSet;
87+
} = set;
9588
const { firebolt } = context;
9689

9790
if (!mergedEnter.length && !mergedExit.length) {
@@ -100,7 +93,7 @@ export const strategies = {
10093
context.applyInteractionStyle(completeSet, { interactionType: 'commonDoubleStroke', apply: false });
10194
} else {
10295
context.applyInteractionStyle(mergedExit, { interactionType: 'focusStroke', apply: false });
103-
context.applyInteractionStyle(entrySet, { interactionType: 'focusStroke', apply: true });
96+
context.applyInteractionStyle(mergedEnter, { interactionType: 'focusStroke', apply: true });
10497

10598
const payload = firebolt.getPayload(BEHAVIOURS.HIGHLIGHT) || {};
10699
const entryExitSet = firebolt.getEntryExitSet(BEHAVIOURS.HIGHLIGHT);
@@ -139,9 +132,7 @@ export const strategies = {
139132
});
140133
}
141134
},
142-
highlight: (set, context, payload, excludeSetIds) => {
143-
const { selectionSet } = set;
144-
135+
highlight: (selectionSet, context, payload) => {
145136
if (!selectionSet.mergedEnter.length && !selectionSet.mergedExit.length) {
146137
// Remove focusStroke on selected but currently non-highlighted set
147138
context.applyInteractionStyle(selectionSet.completeSet, { interactionType: 'highlight', apply: false });
@@ -154,9 +145,7 @@ export const strategies = {
154145
layers.forEach((layer) => {
155146
if (payload.target !== null) {
156147
// get uids of only the currently highlighted point
157-
const actualPoint = layer.getUidsFromPayload(selectionSet.mergedEnter, payload.target);
158-
// get uids of only the currently highlighted point excluding the excludeSet ids
159-
const currentHighlightedSet = getFormattedSet(actualPoint, excludeSetIds);
148+
const currentHighlightedSet = layer.getUidsFromPayload(selectionSet.mergedEnter, payload.target);
160149

161150
// Apply highlight on the currently hovered point
162151
context.applyInteractionStyle(currentHighlightedSet,
@@ -171,9 +160,9 @@ export const strategies = {
171160

172161
const selectEntrySet = context.firebolt.getEntryExitSet('select');
173162
if (selectEntrySet) {
174-
const commonSet = intersect(selectEntrySet.mergedEnter.uids, actualPoint.uids,
163+
const commonSet = intersect(selectEntrySet.mergedEnter.uids, currentHighlightedSet.uids,
175164
[v => v[0], v => v[0]]);
176-
const diffSet = difference(selectEntrySet.mergedEnter.uids, actualPoint.uids,
165+
const diffSet = difference(selectEntrySet.mergedEnter.uids, currentHighlightedSet.uids,
177166
[v => v[0], v => v[0]]);
178167

179168
if (commonSet.length) {
@@ -192,10 +181,9 @@ export const strategies = {
192181
}
193182
},
194183
pseudoFocus: (set, context) => {
195-
const { formattedSet } = set;
196184
const {
197185
mergedEnter
198-
} = formattedSet;
186+
} = set;
199187

200188
context.applyInteractionStyle(mergedEnter, { interactionType: 'focus', apply: false });
201189
}

packages/muze/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "muze",
33
"private": true,
4-
"version": "1.3.1",
4+
"version": "1.3.2",
55
"description": "Composable visualisation library for web with a data-first approach",
66
"homepage": "https://muzejs.org",
77
"author": "Muzejs.org (https://muzejs.org/)",

packages/visual-layer/src/layers/line/line-mixin.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,7 @@ export const LineLayerMixin = superclass => class extends superclass {
193193

194194
this._points = [];
195195
this._pointMap = {};
196-
containerSelection.classed(qualifiedClassName.join(' '), true);
197-
containerSelection.classed(className, true);
196+
containerSelection.attr('class', `${qualifiedClassName.join(' ')} ${className}`);
198197

199198
const colorValFn = encoding.color.value;
200199
const translatedPoints = this.getTranslatedData(normalizedData, colorValFn, colorFieldIndex, axes);

packages/visual-unit/src/firebolt/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import {
1010
const sideEffectPolicy = (propPayload, firebolt, propagationInf) => {
1111
const { sourceIdentifiers, propagationData } = propagationInf;
1212
const fields = sourceIdentifiers.fields;
13-
const sourceIdentifierFields = Object.keys(fields).filter(field =>
14-
field.type !== FieldType.MEASURE);
13+
const sourceIdentifierFields = fields.filter(field =>
14+
field.type !== FieldType.MEASURE).map(field => field.name);
1515
const propFields = Object.keys(propagationData.getFieldsConfig());
1616
const hasCommonCanvas = propPayload.sourceCanvas === firebolt.sourceCanvas();
1717
return intersect(sourceIdentifierFields, propFields).length || hasCommonCanvas;

release/dist/muze.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.

release/dist/muze.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.

release/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "muze",
3-
"version": "1.3.1",
3+
"version": "1.3.2",
44
"description": "Composable visualisation library for web with a data-first approach",
55
"homepage": "https://muzejs.org",
66
"license": "MIT",

0 commit comments

Comments
 (0)