Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mod data views using X,Y,Z #29

Open
hski-github opened this issue May 16, 2021 · 9 comments
Open

Mod data views using X,Y,Z #29

hski-github opened this issue May 16, 2021 · 9 comments
Labels
documentation Issues related to documentation enhancements and missing topics

Comments

@hski-github
Copy link

I would be useful to get an example, where not only X and Y are used, but a third categorial axis Z would be configured and used.

X = Apples, Oranges
Y = 16000, 31000
Z = USA, Spain

Would be interesting to understand, how this is then represented in dataView.rows() and dataView.hierarchy("X") resp. dataView.hierarchy("Z").

@objerke
Copy link
Collaborator

objerke commented May 17, 2021

@hski-github Is it something like this that you would like to see in the text?

hierarchies

@ebrandin
Copy link
Collaborator

ebrandin commented May 17, 2021

Given this image it is also easier to elaborate on #28. It is possible to get all dataview rows from any hierarchy root node. Using xRoot.rows() in this example is therefor equivelent to using dataView.allRows(). You can also get all rows from zRoot.rows(), but the order of the rows will in this case be [1,3,2,4]. This is due to the fact that the order of the rows in the dataview is defined by the order of the hierarchies in the manifest.

@hski-github
Copy link
Author

I had to think for a while to understand what you are showing with this diagram. Therefor I think this drawing is not really helpful.

I was more thinking about a kind of JSON file which would show, what data you get using what methods.

And maybe it is good to start with showing some example data e.g. "For example given this data table as original data source"

Product | Product Category | Country | Sales

"When putting Product on X, Country on Z and Sales resp. Sum(Sales) on Y you would get the following rows via dataView.rows"

"And then dataView.hierarchy("X") you would get" etc.

@objerke
Copy link
Collaborator

objerke commented May 18, 2021

I think it would be difficult to convey the data in a JSON file because one important aspect when comparing hierarchies and allRows is that they refer to the same set of data view rows. I'll try to display the difference between two hierarchies and a single and hopefully this image is better.
more hierarchies

I think one way to try this out is via the js-dev-bachart example, which has two hierarchies. Set some breakpoints in the developer tools, somewhere where the x hierarchy is used in combination with the color hierarchy, and it will be a much more interactive experience compared to static data.

@hski-github
Copy link
Author

Yes, you are probably right regarding JSON.

Maybe you can add method call signature also to the hierarchy part like you did with dataView.allRows.

Don‘t automatically understand the „filtered out“. The filtering is happening outside of the mod, so I am confused why you bring this information.

@objerke
Copy link
Collaborator

objerke commented May 18, 2021

I might have been unclear in the drawing, all of the lines from a node represents the rows that are retrieved when calling node.rows() from that node.

  • In the dual axis example, the x->apples node returns 2 rows.
  • In the single axis example, the x->apples->spain node returns 1 row.

A filtered out row is not sent to the mod since it is no longer part of the data view. Its underlying hierarchy node can be kept via configuration in the properties panel to allow for scales that show holes. We need to be able to separate between the cases when a row is filtered out and when it is non existing. That's when hierarchies really come handy because they contain more information than the bare rows. The following image illustrates what happens when a value on the X axis is filtered out.

hierarchy filtering

The first bar chart re-render its scale without the first publisher. The other two (one of them a mod) keeps the publisher in the scale without any bar. This is possible since the hierarchy leaf node for that value is kept but its list of rows is empty.

We talk a bit about hierarchies in this video https://www.youtube.com/watch?v=gexpop2grIM&t=1250s

@hski-github
Copy link
Author

hski-github commented May 18, 2021

Oh, I was not aware of that an empty child is then in the hierarchy. It is really good, that you extend the documentation around hierarchies. ;-)

That means, that the full list of possible values is available as children even if I filtered out 90% or data, right? What is the order of the children especially assuming that there is a custom sort order configured for the column?

@ebrandin
Copy link
Collaborator

Sorry for this late reply.

This way the Mod will be able to read all possible values of a categorical axis. But bear in mind that this is something the end user controls, not you as a Mod developer.

The order of hierarchy nodes will be the same as any Spotfire visualization, thus it will follow any sort order set on the data table columns.

@hski-github
Copy link
Author

hski-github commented Jul 6, 2021

I learned now that a leave node with empty rows is only in the hierarchy, if the user has set the corresponding Advanced Setting of the axis. If this Advanced Setting is not done, then the hierarchy contains only leaves with contains rows.

image

@objerke objerke added the documentation Issues related to documentation enhancements and missing topics label Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issues related to documentation enhancements and missing topics
Projects
None yet
Development

No branches or pull requests

3 participants