mussonindustrial / embr

Modules for Ignition by Inductive Automation 🔥
MIT License
8 stars 1 forks source link

Missing Designer Properties - Scale Position #166

Open benmusson opened 1 month ago

benmusson commented 1 month ago

The designer schema does not contain suggestions for options.scales[id].position.

https://github.com/mussonindustrial/embr/blob/739afb0db7275b8acf94316d6eb9fc7acf38cb12/modules/charts/common/src/main/resources/chart-js.props.json#L2115C1-L2186C11

paul-griffith commented 1 month ago

Consider self-hiding some of this stuff behind visibleWhen if appropriate (e.g. this example from the pie chart):

          "showPercentSymbol": {
            "type": "boolean",
            "description": "Whether to show the percent symbol next to the percent value",
            "default": true,
            "visibleWhen": {
              "property": "showValueAsPercent",
              "equals": true
            }
          }
benmusson commented 1 month ago

How does the work if the properties aren't siblings, or if more nuanced logic is required?

For example: Line charts have points, so the user should be shown the data.datasets[id].point~ properties if the chart is a line chart. The chart is a line chart if data.datasets[id].type == 'line', or if data.datasets[id].type == undefined and type == 'line'.

benmusson commented 1 month ago

@paul-griffith Any value in exploring using PropertySuggestionSourceRegistry?

Also, what is DynamicSuggestionsValidator, and is this something I can use in my own schemas?

Also if this a better discussion for the forum (for visibility) that's cool with me.

paul-griffith commented 1 month ago

How does the work if the properties aren't siblings, or if more nuanced logic is required?

I don't think it does; the visibleWhen extension is just something we glued on for our own internal purposes, so if the functionality isn't exposed in a first party use case it's probably not there for third parties either 😢. It might work using relative json path references, but no guarantees.

Any value in exploring using PropertySuggestionSourceRegistry?

Maybe? That's more intended for stuff like "the list of named queries" or "the list of reports" to be populated into the property editor from elsewhere on the backend, but I haven't used your module to know if that might be appropriate.

Also, what is DynamicSuggestionsValidator, and is this something I can use in my own schemas?

DynamicSuggestions are for use within a single component's props - something like "give me the list of configured axes in my axes properties schema":

image
benmusson commented 1 month ago

Great, this gives a lot to work on.