EQWorks / widget-studio

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

Reset process - selecting key value first with zero variance #58

Closed geoerika closed 2 years ago

geoerika commented 2 years ago

Problem:

Recording: https://user-images.githubusercontent.com/41120953/148788762-0c55e1cc-8efb-4032-9728-2c990d6bb68a.mov

vxsl commented 2 years ago

fixed by taking zeroVarianceColumns into consideration when computing renderableValueKeys:

  renderableValueKeys: computed(
    [
      (state) => state.valueKeys,
      (state) => state.mapValueKeys,
      (state) => state.group,
      (state) => state.type,
      (state) => state.zeroVarianceColumns,
    ],
    (
      valueKeys,
      mapValueKeys,
      group,
      type,
      zeroVarianceColumns,
    ) => (
      type === 'map'
        ? mapValueKeys.filter(({ key, agg }) => key && (agg || zeroVarianceColumns.includes(key)))
        : valueKeys.filter(({ key, agg }) => key && (agg || zeroVarianceColumns.includes(key) || !group))
    )
  ),

Perhaps you can add this to #55

geoerika commented 2 years ago

Did you test this? Because zeroVarianceColumns is not calculated until you use the useTransformedData which is called fromWidgetAdapter, soisReadywon't be set true in WidgetView, which calls WidgetAdapter. I believe the fix is more complex than this. I was thinking that the only way to do it would be to call useTransformData earlier (in WidgetView) and pass the data down to WidgetAdapter. I tested your solution myself and it didn't work

vxsl commented 2 years ago

Hmmm, that's very strange, I did test it and just double-checked, and it is working on my machine...

geoerika commented 2 years ago

Let me know, I can still try to include the ideas I listed here into my PR, np. I just wanted to know if you agree with it.

geoerika commented 2 years ago

Ok, let me try again

vxsl commented 2 years ago

for reference

https://user-images.githubusercontent.com/53827672/148802639-4b421d81-78d7-46cb-babe-934db47e116b.mp4

geoerika commented 2 years ago

Ok, just tested again, you are right, it is working. Don't know what happened when I tried it first. All good, will include this in #55.

geoerika commented 2 years ago

@vxsl done!

vxsl commented 2 years ago

:ok_hand: