dc-js / dc.js

Multi-Dimensional charting built to work natively with crossfilter rendered with d3.js
Apache License 2.0
7.41k stars 1.81k forks source link

Examples currently failing on dc@5 #1788

Open gordonwoodhull opened 3 years ago

gordonwoodhull commented 3 years ago

The following examples are failing on dc-v5 due to changes in the API.

No rush, we can deal with these in due time. But the examples are a manual test suite which needs to be fixed each major version, at least. They exercise weird features of dc.js!

Uncaught Error: Mandatory attribute chart.group is missing on chart[#search]
    at TextFilterWidget$1.checkForMandatoryAttributes (base-mixin.ts:448)
    at base-mixin.ts:466
    at Array.forEach (<anonymous>)
    at TextFilterWidget$1.render (base-mixin.ts:466)
    at ChartGroup.renderAll (chart-group.ts:39)
    at Object.renderAll (chart-registry.ts:164)
    at text-filter-widget.html:73
Uncaught (in promise) TypeError: monthChart.filterHandler is not a function
    at time-intervals.html:114

is attempting to set

        .colors(["orange"])

and this results in black bars.

when brushing

brush-ordinal.html:91 Assertion failed: console.assert
applyFilters @ brush-ordinal.html:91
filter @ filter-handler.ts:99
filter @ base-mixin.ts:660
replaceFilter @ base-mixin.ts:600
applyBrushSelection @ coordinate-grid-mixin.ts:918
(anonymous) @ coordinate-grid-mixin.ts:912
(anonymous) @ events.ts:42
setTimeout (async)
events.trigger @ events.ts:40
_brushing @ coordinate-grid-mixin.ts:911
(anonymous) @ coordinate-grid-mixin.ts:848
(anonymous) @ d3compat.ts:15
call @ d3.js:1224
emit @ d3.js:5162
start @ d3.js:5148
started @ d3.js:5254
(anonymous) @ d3.js:1985
brush-ordinal.html:92 Uncaught TypeError: Cannot read property 'filterType' of undefined
    at MyDataAdapter.applyFilters (brush-ordinal.html:92)
    at MyDataAdapter.filter (filter-handler.ts:99)
    at BarChart$1.filter (base-mixin.ts:660)
    at BarChart$1.replaceFilter (base-mixin.ts:600)
    at BarChart$1.applyBrushSelection (coordinate-grid-mixin.ts:918)
    at coordinate-grid-mixin.ts:912
    at events.ts:42

no error, no data appears in table when brushing

focus-ordinal-bar.html:107 Uncaught (in promise) TypeError: focus.filterHandler is not a function
    at focus-ordinal-bar.html:107

fails to focus charts 2-4. Probably this is another example made simpler by #1785

I'll be glad to help fix these sometime. For now I thought it would be helpful just to run through and log the bugs/errors.

kum-deepak commented 3 years ago

http://127.0.0.1:8888/web/examples/multi-focus.html will be fixed by #1790.

kum-deepak commented 3 years ago

Fixes are being carried out in the examples branch. PR #1810

kum-deepak commented 3 years ago

Composite Multi Dim brushing is facing a peculiar issue. In this case, it has scatter and bar charts. The Scatter chart needs area brushing, the associated dimension has been set up accordingly. The dimension in the parent is from one of the Scatter charts. The new approach to filter optimizes that one underlying dimension gets filters only once. In this case, it gets the first filter call for the parent chart - a RangeFilter - not something the dimension likes. In the previous version, it received filter twice, once through the parent chart, and then through the child - a RangedTwoDimensionalFilter.

Bypassing it is possible:

This issue will be encountered only if Scatter charts are composed and the dimension in the parent is one of the Scatter charts.

We can take a more elaborate way to fix it - by introducing flags indicating the type of brushing and filter a chart type supports. Maybe in the next major release.

kum-deepak commented 3 years ago

All the examples work now in the dc-v5 branch.