Skip to content

Commit b2e6153

Browse files
authored
Merge pull request #2590 from finetjul/support-negative-signs
docs(scalarbaractor): support negative numbers
2 parents 66f86c9 + 5d6b882 commit b2e6153

File tree

1 file changed

+3
-0
lines changed
  • Sources/Rendering/Core/ScalarBarActor/example

1 file changed

+3
-0
lines changed

Sources/Rendering/Core/ScalarBarActor/example/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'vtk.js/Sources/favicon';
22
import * as d3 from 'd3-scale';
3+
import { formatDefaultLocale } from 'd3-format';
34

45
// Load the rendering pieces we want to use (for both WebGL and WebGPU)
56
import 'vtk.js/Sources/Rendering/Profiles/Geometry';
@@ -51,6 +52,8 @@ function generateTicks(numberOfTicks) {
5152
.range([lastTickBounds[0], lastTickBounds[1]]);
5253
const samples = scale.ticks(numberOfTicks);
5354
const ticks = samples.map((tick) => scale(tick));
55+
// Replace minus "\u2212" with hyphen-minus "\u002D" so that parseFloat() works
56+
formatDefaultLocale({ minus: '\u002D' });
5457
const format = scale.tickFormat(
5558
ticks[0],
5659
ticks[ticks.length - 1],

0 commit comments

Comments
 (0)