EQWorks / widget-studio

Widget-creating tool for charts, maps, tables, stats
https://eqworks.github.io/widget-studio/
2 stars 3 forks source link

`dataHasVariance` should be independent of `useTransformedData` internal memoized values #67

Closed vxsl closed 2 years ago

vxsl commented 2 years ago

it would be nice if we could find some reasonable way to compute dataHasVariance outside useTransformedData, instead making it a computed state in model.js.

Because the fact that it relies on computing groupedData means that we're forcing users to select an aggregation, and THEN telling them that the aggregation is not applicable :laughing:

example:

https://user-images.githubusercontent.com/53827672/151007928-cb55f1aa-e0b9-4469-af29-9fe365a66ccf.mp4

Besides, it's the only piece of state that violates the pattern established so far in the code.

just thinking out loud here, because it might not be possible (I'm thinking it might be way too expensive to compute dataHasVariance from rows (instead of groupedData))

geoerika commented 2 years ago

How about, after we select the groupBy key and we determine dataHasVariance, we automatically disable the aggregation dropdown Select? dataHasVariance is in the global state now, we can use it in the control section to accomplish this, no? To have a finer control on this, I suggest (if possible) we disable all valueKeys controls until we have dataHasVariance established.

vxsl commented 2 years ago

I think this will be fixed by #68, because isReady will no longer have to be true for the data processing to happen. If not, can reopen