MetalBlueberry/go-plotly
The goal of the go-plotly package is to provide a pleasant Go interface for creating figure specifications which are displayed by the plotly.js JavaScript graphing library.
📋 What's Changed
- Add animations by @MetalBlueberry in https://github.com/MetalBlueberry/go-plotly/pull/28
- Implement DataArray type by @MetalBlueberry in https://github.com/MetalBlueberry/go-plotly/pull/30
- Implement Nilable values by @MetalBlueberry in https://github.com/MetalBlueberry/go-plotly/pull/31
- Fixed a bug when generating layout objects that lead to some missing types.
- And mainly quality of life changes and code documentation.
So I realised there was a bug with arrayOk types because those couldn't be nil. So the output had a bunch of null fields. This went unoticed first time because it doesn't seem to affect plotly, but I noticed it while inspecting generated images and I thing it is better to fix it ASAP I also added a place holder for animations, I will be trying to add support for those soon
📋 Changes
- Adds tools to generate schema for multiple versions. This allows to decouple the plotly versions from this library
- Get rid of Type field. Now it is determined based on the struct type. :tada:
- Add ArrayOK compatibility. Now fileds that can either have arrays or single values will have this type so you can provide any of them. Also packed some utility tools to reduce boilerplat
- Add Color types, To increase compatibility with fields that accept multiple values, similar to ArrayOK
- Move types and offilne package outside generation. This allows to use the same packages for all plotly versions plus helping to keep things organised
- offline Serve now serves figues over http, so problems with encoding are avoided
- offline Show encodes the plot as base64 transparently to avoid encoding issues.
This major improvement allows to use the same generator to produce multiple schemas. The advantage of this approach is that we can keep improving the generator code and quickly apply all the benefits for all plotly versions. Allowing users to add more features without having to migrate plotly versions. Thanks @PatrickVienne for the initial contribution and development :tada:
📋 Changes
- Code is generated with plain go.
- Package is not named grob instead of graphic_objects to simplify usage
- Constant variables names have been refactored to follow Go name conventions
- Ensure that constants are generated per trace type.
The highlight is that now the package supports unmarshalling figure data.
First version