I need to make dynamic configuration of Panel Option.
1.What I need
The data structure: [ { name: A} , { name: B}, { name: C}, { name: A}, { name: C} ] etc.
From data I need to get unique names and FOR EACH unique name I need to make
- Select,
-Boolean,
-Number imput ect.
After that I would need to structure data like this for each unique name an object with those option values. That would look like this :
options:
{
A:{
select: selected option,
boolean: true,
input: 4
},
B :{
select: selected option,
boolean: false,
input: 1
}, …
}
So my idea is to make .addCustomEditor and component which would handle this behaviour. And yes I have already made for each uniqe name select, boolean field etc. but the problem is I don’t know how get this data to Panel component. So where the graph get’s render.
I would like to know is there another apporach how would you handle this and if you took same apporach as me how would you pass data to the component (default name if you are creating data visualization is SimplePanel.tsx)
down below are screenshots just showing apporach the code is not even close to it should be but just you can have better understanding.
- moudle.ts
2.FieldSelectEditor.tsx
3.SimplePanel.tsx- how the data should look like in real