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

Move Column Settings from Plugin to Viewer with Column Settings Layout API #2521

Closed
wants to merge 8 commits into from

Conversation

ada-x64
Copy link
Contributor

@ada-x64 ada-x64 commented Feb 1, 2024

Based on #2500; merges #2502 for SVG testing support

This PR aims to create a control-based API for column settings, bringing column-based settings from plugin configs to the viewer. This will allow us to support column settings which persist across plugins, e.g. numeric precision.

The design intends to allow plugin authors to use a number of viewer-defined "style controls." These style controls will affect column_config settings per row. This PR only changes the plugin API and maintains the existing style controls on the datagrid and x/y scatter chart. Following PRs will break up the current monolithic and type-based controls into more fine-grained and reusable controls.

Changes:

  • Create and integrate new plugin API
    • Remove plugin.pluginAttributes
    • Add plugin.column_style_controls(type, group)
    • Move column configurations from plugins to viewer
      • Layout API - returned from plugin.column_style_controls
      • Data API - added to plugin.restore(plugin_config, column_config)
  • Integrate plugin API to the datagrid
    • Tests pass
  • Integrate plugin API to the x/y scatter chart
    • Tests pass
  • Add migrations
  • Clean up cruft

Notes:

  • Is modifying restore the best option for updating the plugins? We could also use restyle.

@ada-x64 ada-x64 force-pushed the features/plugin-layout-api branch 2 times, most recently from 19f10e6 to ab36413 Compare February 12, 2024 22:21
const converted = convert(JSON.parse(JSON.stringify(old)), {
replace_defaults: true,
verbose: true,
});
expect(converted).toEqual(current);
});
}
});

test.describe("migrate", async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously this tested that 1) the migration script did what was expected and that 2) the viewer restored to the expected value. This caused a lot of noise when debugging, so the test has been reconfigured to only test 2) since we test 1) above.

@ada-x64 ada-x64 force-pushed the features/plugin-layout-api branch from ab36413 to d5ab6c7 Compare February 12, 2024 22:35
@ada-x64 ada-x64 marked this pull request as ready for review February 12, 2024 22:35
@ada-x64 ada-x64 force-pushed the features/plugin-layout-api branch from d5ab6c7 to e927bd9 Compare February 16, 2024 17:56
@ada-x64 ada-x64 force-pushed the features/plugin-layout-api branch 2 times, most recently from f9dff51 to 49178d0 Compare February 26, 2024 15:58
ada-x64 and others added 8 commits February 28, 2024 10:06
integrate can_render_column_styles to viewer
initial datagrid integration
fix datagrid tests

symbols integration
update migrations

Co-authored-by: Davis Silverman <[email protected]>
Co-authored-by: Broch Stilley <[email protected]>
better column_config update repr
@ada-x64 ada-x64 force-pushed the features/plugin-layout-api branch from 49178d0 to 6e2fe6b Compare February 28, 2024 20:44
@texodus
Copy link
Member

texodus commented Mar 11, 2024

Thanks for the PR!

Superseded by #2563

@texodus texodus closed this Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants