Open joergplewe opened 5 years ago
Yeah, you're right, overviewRunDimension
and overviewRunGroup
shouldn't be there. They must have been a mistake in development which I forgot to remove.
Focus and range charts will almost always be on the same dimension (and group). Normally you don't want them to filter each other. (Arguably you may not want them to filter other charts, and just use them as a navigational aid, but that's the way dc.js works by default. This example disables filtering.)
For the same reason, you'll usually want a chart's group to be associated with the chart's dimension, because you don't want the chart to filter itself. It's not a hard and fast rule, but there are very few situations where it makes sense to do it another way.
I'll leave this open as reminder to remove the dead code, but general support questions are better suited for Stack Overflow.
I'm not really clear on your question "I cannot understand why this works at all". Why what works? Focus/range charts bind the zoom of one chart to the brush of another chart. That's separate from the filtering - as I mentioned in the other issue, charts don't pull range information from crossfilter dimension filters.
In part because they can't (no getter), in part because there is no magic binding between charts. It's just brush => set a dimension filter => redraw all charts => read data from groups. There is less "framework" than you might expect.
The issue tracker is for reporting bugs and making enhancement requests, not for general support questions. Please ask on Stack Overflow with the dc.js tag, or on the user group, and we will be glad to help you there.
When you post, creating a fiddle or a block demonstrating the problem, will help others help you. You can fork this fiddle or this block to get started!
Thank you Gordon, I will head over to the media you mention.
Just to answer you question and bring that to an end here:
overviewChart
, when brushing, sets a filter on runDimension
, right?
focusChart
then renders runGroup
, right? As well es overviewChart
does itself?
But runGroup
should not be affected by filters on runDimension
, otherwise overviewChart
would always show it's own brush.
But ok, I meanwhile found that https://github.com/crossfilter/crossfilter/wiki/Crossfilter-Gotchas#a-group-does-not-observe-its-dimensions-filters explicitely mentions that case:
One exception is when multiple charts display and/or filter the same dimension, for example in dc.js range/focus charts where one chart zooms to the range selected in another chart. Although you typically want other charts to reflect this selection, if the range chart were affected by the focus chart, you'd see it droop to zero outside of the filtered area. This pattern can be extended to multiple charts all displaying or manipulating the same filter.
I just don't get it, must be due to some basic misconception of mine. I will read that as often until I understand....
Thank you for your support and your patience of me misusing the issue tracker!!
It always takes a little time for the crossfilter & dc.js concepts to sink in. They are simple but non-intuitive. Took me months to finally get all of it.
I think you've got the main idea, though. Feel free to ask any specific questions you may have.
example range-series.html reads like that:
Hence,
overviewRunDimension
andoverviewRunGroup
are never used, which confuses newbies (like myself)OTOH I cannot understand why this works at all. If
overviewChart
sets a filter onrunDimension
it should not have any effect onrunGroup
due to https://github.com/crossfilter/crossfilter/wiki/Crossfilter-Gotchas#a-group-does-not-observe-its-dimensions-filtersNext, in case doing it presumably right (using
overviewRunDimension
andoverviewRunGroup
inoverviewChart
) it does not work any more. All values go to 0 in case of filtering.Additionially. is there a constraint that a charts
dimension
andgroup
need to be related?Confused, thanks in advance,
. J