Open nstuyvesant opened 1 year ago
@theiliad - noticed this when I was running locally. I was planning to submit a PR with fixes for lint errors in core but I didn't want to do that before you got a chance to see that these problems are not related to what I am working on.
The first problem (UTILITY/Highlights) is with src/components/axes/grid-brush.ts:
If the width constant <1, the error will occur...
const brush = brushX()
.extent([
[0, 0],
[width - 1, height]
])
.on('start brush end', brushEventHandler)
.on('end.brushed', brushed)
This solves that particular issue as long as brush is defined as a variable above instead of as a constant.
if (height != 0 && width != 0) {
// leave some space to display selection strokes beside axes
brush = brushX()
.extent([
[0, 0],
[ width - 1, height]
])
.on('start brush end', brushEventHandler)
.on('end.brushed', brushed)
brushArea.call(brush)
}
Adding this conditional to src/components/axes/chart-clip.ts fixes several of the other ones...
if (xScaleEnd - xScaleStart > 0) {
clipRect
.attr('x', xScaleStart)
.attr('y', yScaleStart)
.attr('width', xScaleEnd - xScaleStart)
.attr('height', yScaleEnd - yScaleStart)
}
Only one I need to research is the SIMPLE CHARTS/Radar/Radar - Missing data points having the NaN in the generated path.
I may just submit the fixes with my big PR
The radar chart is erroring on src/components/graphs/radar.ts on the transition() call here...
enter
.append('path')
.attr('opacity', 0)
.attr('transform', `translate(${c.x}, ${c.y})`)
.attr('fill', 'none')
.call((selection: any) =>
selection
.transition() // BUG: 19 console error for charts with missing datapoints (generated path has NaN in it)
.call((t: any) =>
this.services.transitions.setupTransition({
transition: t,
name: 'radar_y_axes_enter',
animate
})
)
.attr('opacity', 1)
.attr('d', (tick: any) => radialLineGenerator(shapeData(tick)))
)
In the demo, SIMPLE CHARTS / Meter (proportional) / Proportional Meter Chart - peak and statuses, error is logged "Error:
.attr('x',
this.model.getStatus() ? containerWidth - meter.total.paddingRight : containerWidth
)
In this case...
// this.model.getStatus() == 'warning'
// containerWidth == '100%'
// meter.total.paddingRight == 24
// The problem is you can't subtract '100%' - 24
I may just submit the fixes with my big PR
@nstuyvesant let's pls put these in a separate PR 🙂 That PR is already super large, which is understandable
Name
Nate Stuyvesant
Are you an IBM employee?
What happened?
If you navigate to any of the demos in these sections of the demo site for core, Angular, React, Svelte, or Vue UTILITY / Highlights UTILITY / Toolbar UTILITY / Zoom bar
you will get this JavaScript console error...
If you navigate to SIMPLE CHARTS / Meter or Meter (proportional) (any example), you will get this error...
If you go to SIMPLE CHARTS / Radar / Radar - Missing datapoints, you will get this error...
These happen on Safari 16.4 and Chrome 112.
Version
@carbon/charts@1.7.5
but I suspect these go back further in time since the charts still render.Data & options used
Relevant log output
Codesandbox example
https://charts.carbondesignsystem.com/?path=/story/utility-highlights--bounded-area-time-series-natural-curve
What priority level would this be in your opinion?
P0