Skip to content

Commit 70a046f

Browse files
Merge pull request #7 from mindthemath/hotfix/invert-cols
fix inverted-column state mgmt
2 parents e6c673e + 1d55112 commit 70a046f

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "hiplot-mm"
7-
version = "0.0.4rc11"
7+
version = "0.0.4rc12"
88
description = "High dimensional Interactive Plotting tool"
99
readme = "README.md"
1010
license = "MIT"

src/parallel/parallel.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,17 @@ export class ParallelPlot extends React.Component<ParallelPlotData, ParallelPlot
149149
const extent = currentExtent ? [this.h - currentExtent[1], this.h - currentExtent[0]] : null;
150150
const div = d3.select(this.root_ref.current);
151151

152-
if (this.state.invert.has(d)) {
152+
const willBeInverted = !this.state.invert.has(d);
153+
154+
if (!willBeInverted) {
153155
this.setState(function (prevState) {
154156
var newInvert = new Set(prevState.invert);
155157
newInvert.delete(d);
156158
return {
157159
invert: newInvert,
158160
};
159161
});
160-
this.setScaleRange(d);
162+
this.setScaleRange(d, willBeInverted);
161163
div
162164
.selectAll("." + style.label)
163165
.filter(function (p) {
@@ -172,7 +174,7 @@ export class ParallelPlot extends React.Component<ParallelPlotData, ParallelPlot
172174
invert: newInvert,
173175
};
174176
});
175-
this.setScaleRange(d);
177+
this.setScaleRange(d, willBeInverted);
176178
div
177179
.selectAll("." + style.label)
178180
.filter(function (p) {
@@ -885,9 +887,9 @@ export class ParallelPlot extends React.Component<ParallelPlotData, ParallelPlot
885887
};
886888
}
887889

888-
setScaleRange(k: string) {
890+
setScaleRange(k: string, inverted: boolean = this.state.invert.has(k)) {
889891
var range = [this.h, 0];
890-
if (this.state.invert.has(k)) {
892+
if (inverted) {
891893
range = [0, this.h];
892894
}
893895
this.yscale[k].range(range);

uv.lock

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

0 commit comments

Comments
 (0)