@windborne/grapher 1.0.55 → 1.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.cjs +1 -1
- package/dist/bundle.cjs.map +1 -1
- package/dist/bundle.esm.js +1 -1
- package/dist/bundle.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/renderer/draw_bars.js +1 -1
- package/src/renderer/graph_body_renderer.js +7 -10
- package/src/state/calculate_tooltip_state.js +7 -11
package/package.json
CHANGED
|
@@ -33,7 +33,7 @@ export default function drawBars(individualPoints, {
|
|
|
33
33
|
context.fillStyle = color;
|
|
34
34
|
|
|
35
35
|
const {barWidth, totalBarWidth} = getBarWidths({ closestSpacing, bounds, sizing, axisSeriesCount });
|
|
36
|
-
const barBottom =
|
|
36
|
+
const barBottom = Math.min(zero, sizing.renderHeight);
|
|
37
37
|
|
|
38
38
|
if (renderCutoffGradient && cutoffIndex !== undefined && originalData) {
|
|
39
39
|
drawBarsWithCutoff(individualPoints, {
|
|
@@ -353,18 +353,15 @@ export default class GraphBodyRenderer extends Eventable {
|
|
|
353
353
|
|
|
354
354
|
if (singleSeries.rendering === 'bar') {
|
|
355
355
|
const barSeriesInAxis = singleSeries.axis.series.filter(s => s.rendering === 'bar');
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
barClosestSpacing = sp;
|
|
361
|
-
}
|
|
362
|
-
}
|
|
356
|
+
const visibleBarSeries = barSeriesInAxis.filter(s =>
|
|
357
|
+
s.inDataSpace && s.inDataSpace.length > 0 &&
|
|
358
|
+
s.dataBounds && s.dataBounds.maxX >= bounds.minX && s.dataBounds.minX <= bounds.maxX
|
|
359
|
+
);
|
|
363
360
|
let barParams = {
|
|
364
361
|
...commonCPUParams,
|
|
365
|
-
indexInAxis:
|
|
366
|
-
axisSeriesCount:
|
|
367
|
-
closestSpacing:
|
|
362
|
+
indexInAxis: visibleBarSeries.indexOf(singleSeries),
|
|
363
|
+
axisSeriesCount: visibleBarSeries.length || 1,
|
|
364
|
+
closestSpacing: singleSeries.dataBounds?.closestSpacing || globalBounds.closestSpacing,
|
|
368
365
|
bounds
|
|
369
366
|
};
|
|
370
367
|
|
|
@@ -110,19 +110,15 @@ export default function calculateTooltipState({mousePresent, mouseX, mouseY, siz
|
|
|
110
110
|
|
|
111
111
|
if (singleSeries.rendering === 'bar') {
|
|
112
112
|
const barSeriesInAxis = singleSeries.axis.series.filter(s => s.rendering === 'bar');
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (sp != null && sp > 0 && (barClosestSpacing === null || sp > barClosestSpacing)) {
|
|
120
|
-
barClosestSpacing = sp;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
113
|
+
const visibleBarSeries = barSeriesInAxis.filter(s =>
|
|
114
|
+
s.inDataSpace && s.inDataSpace.length > 0 &&
|
|
115
|
+
s.dataBounds && s.dataBounds.maxX >= bounds.minX && s.dataBounds.minX <= bounds.maxX
|
|
116
|
+
);
|
|
117
|
+
const indexInAxis = visibleBarSeries.indexOf(singleSeries);
|
|
118
|
+
const axisSeriesCount = visibleBarSeries.length || 1;
|
|
123
119
|
|
|
124
120
|
const { totalBarWidth, barWidth } = getBarWidths({
|
|
125
|
-
closestSpacing:
|
|
121
|
+
closestSpacing: singleSeries.dataBounds?.closestSpacing || closestSpacing,
|
|
126
122
|
bounds,
|
|
127
123
|
sizing,
|
|
128
124
|
axisSeriesCount
|