diff --git a/CHANGES.rst b/CHANGES.rst index cf13dd1..0e15897 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,14 @@ +Release 1.1.0 +========================================= + +* Align the API to **Highcharts (JS) v.11**. In particular, this includes: + + * Changes inherited from **Highcharts Core for Python v.1.1.0**. See `here `__. + +* **FIXED:** Fixed missing ``TreegraphOptions`` / ``TreegraphSeries`` series type. + +--------------- + Release 1.0.1 ========================================= diff --git a/README.rst b/README.rst index 1fd9241..464c58b 100644 --- a/README.rst +++ b/README.rst @@ -17,6 +17,8 @@ JavaScript data visualization library. * The **Highcharts Export Server** - enabling the programmatic creation of static (downloadable) data visualizations +The library supports Highcharts (JS) v.10.2 and higher, including Highcharts (JS) v.11.0.0. + **Highcharts Gantt for Python** is fully integrated with the broader Python ecosystem, featuring native integrations with: diff --git a/docs/_static/flowmap-example.png b/docs/_static/flowmap-example.png new file mode 100644 index 0000000..75dfc83 Binary files /dev/null and b/docs/_static/flowmap-example.png differ diff --git a/docs/_static/geoheatmap-example.png b/docs/_static/geoheatmap-example.png new file mode 100644 index 0000000..1294d4c Binary files /dev/null and b/docs/_static/geoheatmap-example.png differ diff --git a/docs/_static/pictorial-example.png b/docs/_static/pictorial-example.png new file mode 100644 index 0000000..ddc9238 Binary files /dev/null and b/docs/_static/pictorial-example.png differ diff --git a/docs/_static/treegraph-example.png b/docs/_static/treegraph-example.png new file mode 100644 index 0000000..1b588c3 Binary files /dev/null and b/docs/_static/treegraph-example.png differ diff --git a/docs/api.rst b/docs/api.rst index 9cbbda7..fd23379 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -524,6 +524,8 @@ Core Components :class:`ParentNodeOptions ` * - :mod:`.options.plot_options.pareto ` - :class:`ParetoOptions ` + * - :mod:`.options.plot_options.pictorial ` + - :class:`PictorialOptions ` * - :mod:`.options.plot_options.pie ` - :class:`PieOptions ` :class:`VariablePieOptions ` @@ -553,12 +555,17 @@ Core Components :class:`Scatter3DOptions ` * - :mod:`.options.plot_options.series ` - :class:`SeriesOptions ` + * - :mod:`.options.plot_options.sonification ` + - :class:`SeriesSonification ` * - :mod:`.options.plot_options.spline ` - :class:`SplineOptions ` * - :mod:`.options.plot_options.sunburst ` - :class:`SunburstOptions ` * - :mod:`.options.plot_options.timeline ` - :class:`TimelineOptions ` + * - :mod:`.options.plot_options.treegraph ` + - :class:`TreegraphOptions ` + :class:`TreegraphEvents ` * - :mod:`.options.plot_options.treemap ` - :class:`TreemapOptions ` * - :mod:`.options.plot_options.vbp ` @@ -691,6 +698,8 @@ Core Components :class:`SinglePointBase ` * - :mod:`.options.series.data.sunburst ` - :class:`SunburstData ` + * - :mod:`.options.series.data.treegraph ` + - :class:`TreegraphData ` * - :mod:`.options.series.data.treemap ` - :class:`TreemapData ` * - :mod:`.options.series.data.vector ` @@ -777,6 +786,9 @@ Core Components - :class:`PackedBubbleSeries ` * - :mod:`.options.series.pareto ` - :class:`ParetoSeries ` + * - :mod:`.options.series.pictorial ` + - :class:`PictorialSeries ` + :class:`PictorialPaths ` * - :mod:`.options.series.pie ` - :class:`PieSeries ` :class:`VariablePieSeries ` @@ -804,6 +816,8 @@ Core Components - :class:`SunburstSeries ` * - :mod:`.options.series.timeline ` - :class:`TimelineSeries ` + * - :mod:`.options.series.treegraph ` + - :class:`TreegraphSeries ` * - :mod:`.options.series.treemap ` - :class:`TreemapSeries ` * - :mod:`.options.series.vbp ` @@ -816,6 +830,22 @@ Core Components - :class:`WordcloudSeries ` * - :mod:`.options.series.zigzag ` - :class:`ZigZagSeries ` + * - :mod:`.options.sonification ` + - :class:`SonificationOptions ` + * - :mod:`.options.sonification.grouping ` + - :class:`PointGrouping ` + * - :mod:`.options.sonification.mapping ` + - :class:`SonificationMapping ` + :class:`AudioParameter ` + :class:`AudioFilter ` + :class:`PitchParameter ` + :class:`TremoloEffect ` + * - :mod:`.options.sonification.track_configurations ` + - :class:`InstrumentTrackConfiguration ` + :class:`SpeechTrackConfiguration ` + :class:`ContextTrackConfiguration ` + :class:`TrackConfigurationBase ` + :class:`ActiveWhen ` * - :mod:`.options.stock_tools ` - :class:`StockTools ` :class:`StockToolsGUI ` diff --git a/docs/api/options/index.rst b/docs/api/options/index.rst index 615308a..833c96a 100644 --- a/docs/api/options/index.rst +++ b/docs/api/options/index.rst @@ -30,6 +30,7 @@ plot_options/index responsive series/index + sonification/index stock_tools/index subtitle time @@ -505,12 +506,17 @@ Sub-components :class:`Scatter3DOptions ` * - :mod:`.options.plot_options.series ` - :class:`SeriesOptions ` + * - :mod:`.options.plot_options.sonification ` + - :class:`SeriesSonification ` * - :mod:`.options.plot_options.spline ` - :class:`SplineOptions ` * - :mod:`.options.plot_options.sunburst ` - :class:`SunburstOptions ` * - :mod:`.options.plot_options.timeline ` - :class:`TimelineOptions ` + * - :mod:`.options.plot_options.treegraph ` + - :class:`TreegraphOptions ` + :class:`TreegraphEvents ` * - :mod:`.options.plot_options.treemap ` - :class:`TreemapOptions ` * - :mod:`.options.plot_options.vbp ` @@ -643,6 +649,8 @@ Sub-components :class:`SinglePointBase ` * - :mod:`.options.series.data.sunburst ` - :class:`SunburstData ` + * - :mod:`.options.series.data.treegraph ` + - :class:`TreegraphData ` * - :mod:`.options.series.data.treemap ` - :class:`TreemapData ` * - :mod:`.options.series.data.vector ` @@ -756,6 +764,8 @@ Sub-components - :class:`SunburstSeries ` * - :mod:`.options.series.timeline ` - :class:`TimelineSeries ` + * - :mod:`.options.series.treegraph ` + - :class:`TreegraphSeries ` * - :mod:`.options.series.treemap ` - :class:`TreemapSeries ` * - :mod:`.options.series.vbp ` @@ -768,6 +778,22 @@ Sub-components - :class:`WordcloudSeries ` * - :mod:`.options.series.zigzag ` - :class:`ZigZagSeries ` + * - :mod:`.options.sonification ` + - :class:`SonificationOptions ` + * - :mod:`.options.sonification.grouping ` + - :class:`PointGrouping ` + * - :mod:`.options.sonification.mapping ` + - :class:`SonificationMapping ` + :class:`AudioParameter ` + :class:`AudioFilter ` + :class:`PitchParameter ` + :class:`TremoloEffect ` + * - :mod:`.options.sonification.track_configurations ` + - :class:`InstrumentTrackConfiguration ` + :class:`SpeechTrackConfiguration ` + :class:`ContextTrackConfiguration ` + :class:`TrackConfigurationBase ` + :class:`ActiveWhen ` * - :mod:`.options.stock_tools ` - :class:`StockTools ` :class:`StockToolsGUI ` diff --git a/docs/api/options/plot_options/index.rst b/docs/api/options/plot_options/index.rst index cd77980..3b61825 100644 --- a/docs/api/options/plot_options/index.rst +++ b/docs/api/options/plot_options/index.rst @@ -50,6 +50,7 @@ oscillators/index packedbubble pareto + pictorial pie pivot_points points @@ -60,9 +61,11 @@ sankey scatter series + sonification spline sunburst timeline + treegraph treemap vbp vector @@ -291,6 +294,8 @@ Sub-components :class:`ParentNodeOptions ` * - :mod:`.options.plot_options.pareto ` - :class:`ParetoOptions ` + * - :mod:`.options.plot_options.pictorial ` + - :class:`PictorialOptions ` * - :mod:`.options.plot_options.pie ` - :class:`PieOptions ` :class:`VariablePieOptions ` @@ -320,12 +325,17 @@ Sub-components :class:`Scatter3DOptions ` * - :mod:`.options.plot_options.series ` - :class:`SeriesOptions ` + * - :mod:`.options.plot_options.sonification ` + - :class:`SeriesSonification ` * - :mod:`.options.plot_options.spline ` - :class:`SplineOptions ` * - :mod:`.options.plot_options.sunburst ` - :class:`SunburstOptions ` * - :mod:`.options.plot_options.timeline ` - :class:`TimelineOptions ` + * - :mod:`.options.plot_options.treegraph ` + - :class:`TreegraphOptions ` + :class:`TreegraphEvents ` * - :mod:`.options.plot_options.treemap ` - :class:`TreemapOptions ` * - :mod:`.options.plot_options.vbp ` diff --git a/docs/api/options/plot_options/pictorial.rst b/docs/api/options/plot_options/pictorial.rst new file mode 100644 index 0000000..c3e830a --- /dev/null +++ b/docs/api/options/plot_options/pictorial.rst @@ -0,0 +1,28 @@ +########################################################################################## +:mod:`.pictorial ` +########################################################################################## + +.. contents:: Module Contents + :local: + :depth: 3 + :backlinks: entry + +-------------- + +.. module:: highcharts_gantt.options.plot_options.pictorial + +******************************************************************************************************************** +class: :class:`PictorialOptions ` +******************************************************************************************************************** + +.. autoclass:: PictorialOptions + :members: + :inherited-members: + + .. collapse:: Class Inheritance + + .. inheritance-diagram:: PictorialOptions + :top-classes: highcharts_core.metaclasses.HighchartsMeta, highcharts_gantt.metaclasses.HighchartsMeta + :parts: -1 + + | diff --git a/docs/api/options/plot_options/sonification.rst b/docs/api/options/plot_options/sonification.rst new file mode 100644 index 0000000..5eb3bc0 --- /dev/null +++ b/docs/api/options/plot_options/sonification.rst @@ -0,0 +1,28 @@ +########################################################################################## +:mod:`.sonification ` +########################################################################################## + +.. contents:: Module Contents + :local: + :depth: 3 + :backlinks: entry + +-------------- + +.. module:: highcharts_gantt.options.plot_options.sonification + +******************************************************************************************************************** +class: :class:`SeriesSonification ` +******************************************************************************************************************** + +.. autoclass:: SeriesSonification + :members: + :inherited-members: + + .. collapse:: Class Inheritance + + .. inheritance-diagram:: SeriesSonification + :top-classes: highcharts_core.metaclasses.HighchartsMeta, highcharts_gantt.metaclasses.HighchartsMeta + :parts: -1 + + | diff --git a/docs/api/options/plot_options/treegraph.rst b/docs/api/options/plot_options/treegraph.rst new file mode 100644 index 0000000..1c50cf5 --- /dev/null +++ b/docs/api/options/plot_options/treegraph.rst @@ -0,0 +1,47 @@ +########################################################################################## +:mod:`.treegraph ` +########################################################################################## + +.. contents:: Module Contents + :local: + :depth: 3 + :backlinks: entry + +-------------- + +.. module:: highcharts_gantt.options.plot_options.treegraph + +******************************************************************************************************************** +class: :class:`TreegraphOptions ` +******************************************************************************************************************** + +.. autoclass:: TreegraphOptions + :members: + :inherited-members: + + .. collapse:: Class Inheritance + + .. inheritance-diagram:: TreegraphOptions + :top-classes: highcharts_core.metaclasses.HighchartsMeta, highcharts_gantt.metaclasses.HighchartsMeta + :parts: -1 + + | + + +-------------- + +******************************************************************************************************************** +class: :class:`TreegraphEvents ` +******************************************************************************************************************** + +.. autoclass:: TreegraphEvents + :members: + :inherited-members: + + .. collapse:: Class Inheritance + + .. inheritance-diagram:: TreegraphEvents + :top-classes: highcharts_core.metaclasses.HighchartsMeta, highcharts_gantt.metaclasses.HighchartsMeta + :parts: -1 + + | diff --git a/docs/api/options/series/data/index.rst b/docs/api/options/series/data/index.rst index 31e3099..3f596bb 100644 --- a/docs/api/options/series/data/index.rst +++ b/docs/api/options/series/data/index.rst @@ -26,6 +26,7 @@ range single_point sunburst + treegraph treemap vector venn @@ -94,6 +95,8 @@ Sub-components :class:`SinglePointBase ` * - :mod:`.options.series.data.sunburst ` - :class:`SunburstData ` + * - :mod:`.options.series.data.treegraph ` + - :class:`TreegraphData ` * - :mod:`.options.series.data.treemap ` - :class:`TreemapData ` * - :mod:`.options.series.data.vector ` diff --git a/docs/api/options/series/data/treegraph.rst b/docs/api/options/series/data/treegraph.rst new file mode 100644 index 0000000..e52148e --- /dev/null +++ b/docs/api/options/series/data/treegraph.rst @@ -0,0 +1,28 @@ +########################################################################################## +:mod:`.treegraph ` +########################################################################################## + +.. contents:: Module Contents + :local: + :depth: 3 + :backlinks: entry + +-------------- + +.. module:: highcharts_gantt.options.series.data.treegraph + +******************************************************************************************************************** +class: :class:`TreegraphData ` +******************************************************************************************************************** + +.. autoclass:: TreegraphData + :members: + :inherited-members: + + .. collapse:: Class Inheritance + + .. inheritance-diagram:: TreegraphData + :top-classes: highcharts_core.metaclasses.HighchartsMeta, highcharts_gantt.metaclasses.HighchartsMeta + :parts: -1 + + | diff --git a/docs/api/options/series/index.rst b/docs/api/options/series/index.rst index 5f1c28d..dfacb70 100644 --- a/docs/api/options/series/index.rst +++ b/docs/api/options/series/index.rst @@ -45,6 +45,7 @@ organization packedbubble pareto + pictorial pie pivot_points points @@ -58,6 +59,7 @@ spline sunburst timeline + treegraph treemap vbp vector @@ -187,6 +189,8 @@ Sub-components :class:`SinglePointBase ` * - :mod:`.options.series.data.sunburst ` - :class:`SunburstData ` + * - :mod:`.options.series.data.treegraph ` + - :class:`TreegraphData ` * - :mod:`.options.series.data.treemap ` - :class:`TreemapData ` * - :mod:`.options.series.data.vector ` @@ -273,6 +277,9 @@ Sub-components - :class:`PackedBubbleSeries ` * - :mod:`.options.series.pareto ` - :class:`ParetoSeries ` + * - :mod:`.options.series.pictorial ` + - :class:`PictorialSeries ` + :class:`PictorialPaths ` * - :mod:`.options.series.pie ` - :class:`PieSeries ` :class:`VariablePieSeries ` @@ -300,6 +307,8 @@ Sub-components - :class:`SunburstSeries ` * - :mod:`.options.series.timeline ` - :class:`TimelineSeries ` + * - :mod:`.options.series.treegraph ` + - :class:`TreegraphSeries ` * - :mod:`.options.series.treemap ` - :class:`TreemapSeries ` * - :mod:`.options.series.vbp ` diff --git a/docs/api/options/series/pictorial.rst b/docs/api/options/series/pictorial.rst new file mode 100644 index 0000000..48e45af --- /dev/null +++ b/docs/api/options/series/pictorial.rst @@ -0,0 +1,48 @@ +########################################################################################## +:mod:`.pictorial ` +########################################################################################## + +.. contents:: Module Contents + :local: + :depth: 3 + :backlinks: entry + +-------------- + +.. module:: highcharts_gantt.options.series.pictorial + +******************************************************************************************************************** +class: :class:`PictorialSeries ` +******************************************************************************************************************** + +.. autoclass:: PictorialSeries + :members: + :inherited-members: + + .. collapse:: Class Inheritance + + .. inheritance-diagram:: PictorialSeries + :top-classes: highcharts_core.metaclasses.HighchartsMeta, highcharts_gantt.metaclasses.HighchartsMeta + :parts: -1 + + | + +-------------- + +.. module:: highcharts_gantt.options.series.pictorial + +******************************************************************************************************************** +class: :class:`PictorialPaths ` +******************************************************************************************************************** + +.. autoclass:: PictorialPaths + :members: + :inherited-members: + + .. collapse:: Class Inheritance + + .. inheritance-diagram:: PictorialPaths + :top-classes: highcharts_core.metaclasses.HighchartsMeta, highcharts_gantt.metaclasses.HighchartsMeta + :parts: -1 + + | diff --git a/docs/api/options/series/treegraph.rst b/docs/api/options/series/treegraph.rst new file mode 100644 index 0000000..9be839e --- /dev/null +++ b/docs/api/options/series/treegraph.rst @@ -0,0 +1,28 @@ +########################################################################################## +:mod:`.treegraph ` +########################################################################################## + +.. contents:: Module Contents + :local: + :depth: 3 + :backlinks: entry + +-------------- + +.. module:: highcharts_gantt.options.series.treegraph + +******************************************************************************************************************** +class: :class:`TreegraphSeries ` +******************************************************************************************************************** + +.. autoclass:: TreegraphSeries + :members: + :inherited-members: + + .. collapse:: Class Inheritance + + .. inheritance-diagram:: TreegraphSeries + :top-classes: highcharts_core.metaclasses.HighchartsMeta, highcharts_gantt.metaclasses.HighchartsMeta + :parts: -1 + + | diff --git a/docs/api/options/sonification/grouping.rst b/docs/api/options/sonification/grouping.rst new file mode 100644 index 0000000..9cd68eb --- /dev/null +++ b/docs/api/options/sonification/grouping.rst @@ -0,0 +1,28 @@ +########################################################################################## +:mod:`.grouping ` +########################################################################################## + +.. contents:: Module Contents + :local: + :depth: 3 + :backlinks: entry + +-------------- + +.. module:: highcharts_gantt.options.sonification.grouping + +******************************************************************************************************************** +class: :class:`SonificationGrouping ` +******************************************************************************************************************** + +.. autoclass:: SonificationGrouping + :members: + :inherited-members: + + .. collapse:: Class Inheritance + + .. inheritance-diagram:: SonificationGrouping + :top-classes: highcharts_core.metaclasses.HighchartsMeta, highcharts_gantt.metaclasses.HighchartsMeta + :parts: -1 + + | diff --git a/docs/api/options/sonification/index.rst b/docs/api/options/sonification/index.rst new file mode 100644 index 0000000..c6ecf12 --- /dev/null +++ b/docs/api/options/sonification/index.rst @@ -0,0 +1,54 @@ +####################################################################### +:mod:`.options.sonification ` +####################################################################### + +.. contents:: Module Contents + :local: + :depth: 3 + :backlinks: entry + +.. toctree:: + :titlesonly: + + grouping + mapping + track_configurations + +-------------- + +.. module:: highcharts_gantt.options.sonification + +******************************************************************************************************* +class: :class:`SonificationOptions ` +******************************************************************************************************* + +.. autoclass:: SonificationOptions + :members: + :inherited-members: + +----------------------- + +*************************** +Sub-components +*************************** + +.. list-table:: + :widths: 60 40 + :header-rows: 1 + + * - Module + - Classes / Functions + * - :mod:`.options.sonification.grouping ` + - :class:`SonificationGrouping ` + * - :mod:`.options.sonification.mapping ` + - :class:`SonificationMapping ` + :class:`AudioParameter ` + :class:`AudioFilter ` + :class:`PitchParameter ` + :class:`TremoloEffect ` + * - :mod:`.options.sonification.track_configurations ` + - :class:`InstrumentTrackConfiguration ` + :class:`SpeechTrackConfiguration ` + :class:`ContextTrackConfiguration ` + :class:`TrackConfigurationBase ` + :class:`ActiveWhen ` diff --git a/docs/api/options/sonification/mapping.rst b/docs/api/options/sonification/mapping.rst new file mode 100644 index 0000000..26f53f8 --- /dev/null +++ b/docs/api/options/sonification/mapping.rst @@ -0,0 +1,101 @@ +########################################################################################## +:mod:`.mapping ` +########################################################################################## + +.. contents:: Module Contents + :local: + :depth: 3 + :backlinks: entry + +-------------- + +.. module:: highcharts_gantt.options.sonification.mapping + +******************************************************************************************************************** +class: :class:`AudioParameter ` +******************************************************************************************************************** + +.. autoclass:: AudioParameter + :members: + :inherited-members: + + .. collapse:: Class Inheritance + + .. inheritance-diagram:: AudioParameter + :top-classes: highcharts_core.metaclasses.HighchartsMeta, highcharts_gantt.metaclasses.HighchartsMeta + :parts: -1 + + | + +----------------------- + +******************************************************************************************************************** +class: :class:`AudioParameter ` +******************************************************************************************************************** + +.. autoclass:: AudioParameter + :members: + :inherited-members: + + .. collapse:: Class Inheritance + + .. inheritance-diagram:: AudioParameter + :top-classes: highcharts_core.metaclasses.HighchartsMeta, highcharts_gantt.metaclasses.HighchartsMeta + :parts: -1 + + | + +----------------------- + +******************************************************************************************************************** +class: :class:`AudioFilter ` +******************************************************************************************************************** + +.. autoclass:: AudioFilter + :members: + :inherited-members: + + .. collapse:: Class Inheritance + + .. inheritance-diagram:: AudioFilter + :top-classes: highcharts_core.metaclasses.HighchartsMeta, highcharts_gantt.metaclasses.HighchartsMeta + :parts: -1 + + | + +----------------------- + +******************************************************************************************************************** +class: :class:`PitchParameter ` +******************************************************************************************************************** + +.. autoclass:: PitchParameter + :members: + :inherited-members: + + .. collapse:: Class Inheritance + + .. inheritance-diagram:: PitchParameter + :top-classes: highcharts_core.metaclasses.HighchartsMeta, highcharts_gantt.metaclasses.HighchartsMeta + :parts: -1 + + | + +----------------------- + +******************************************************************************************************************** +class: :class:`TremoloEffect ` +******************************************************************************************************************** + +.. autoclass:: TremoloEffect + :members: + :inherited-members: + + .. collapse:: Class Inheritance + + .. inheritance-diagram:: TremoloEffect + :top-classes: highcharts_core.metaclasses.HighchartsMeta, highcharts_gantt.metaclasses.HighchartsMeta + :parts: -1 + + | + diff --git a/docs/api/options/sonification/track_configurations.rst b/docs/api/options/sonification/track_configurations.rst new file mode 100644 index 0000000..6a07ac7 --- /dev/null +++ b/docs/api/options/sonification/track_configurations.rst @@ -0,0 +1,100 @@ +########################################################################################## +:mod:`.track_configurations ` +########################################################################################## + +.. contents:: Module Contents + :local: + :depth: 3 + :backlinks: entry + +-------------- + +.. module:: highcharts_gantt.options.sonification.track_configurations + +*************************************************************************************************************************************************************** +class: :class:`InstrumentTrackConfiguration ` +*************************************************************************************************************************************************************** + +.. autoclass:: InstrumentTrackConfiguration + :members: + :inherited-members: + + .. collapse:: Class Inheritance + + .. inheritance-diagram:: InstrumentTrackConfiguration + :top-classes: highcharts_core.metaclasses.HighchartsMeta, highcharts_gantt.metaclasses.HighchartsMeta + :parts: -1 + + | + +--------------------- + +*************************************************************************************************************************************************************** +class: :class:`SpeechTrackConfiguration ` +*************************************************************************************************************************************************************** + +.. autoclass:: SpeechTrackConfiguration + :members: + :inherited-members: + + .. collapse:: Class Inheritance + + .. inheritance-diagram:: SpeechTrackConfiguration + :top-classes: highcharts_core.metaclasses.HighchartsMeta, highcharts_gantt.metaclasses.HighchartsMeta + :parts: -1 + + | + +--------------------- + +*************************************************************************************************************************************************************** +class: :class:`ContextTrackConfiguration ` +*************************************************************************************************************************************************************** + +.. autoclass:: ContextTrackConfiguration + :members: + :inherited-members: + + .. collapse:: Class Inheritance + + .. inheritance-diagram:: ContextTrackConfiguration + :top-classes: highcharts_core.metaclasses.HighchartsMeta, highcharts_gantt.metaclasses.HighchartsMeta + :parts: -1 + + | + +--------------------- + +*************************************************************************************************************************************************************** +class: :class:`ActiveWhen ` +*************************************************************************************************************************************************************** + +.. autoclass:: ActiveWhen + :members: + :inherited-members: + + .. collapse:: Class Inheritance + + .. inheritance-diagram:: ActiveWhen + :top-classes: highcharts_core.metaclasses.HighchartsMeta, highcharts_gantt.metaclasses.HighchartsMeta + :parts: -1 + + | + +--------------------- + +*************************************************************************************************************************************************************** +class: :class:`TrackConfigurationBase ` +*************************************************************************************************************************************************************** + +.. autoclass:: TrackConfigurationBase + :members: + :inherited-members: + + .. collapse:: Class Inheritance + + .. inheritance-diagram:: TrackConfigurationBase + :top-classes: highcharts_core.metaclasses.HighchartsMeta, highcharts_gantt.metaclasses.HighchartsMeta + :parts: -1 + + | diff --git a/docs/errors.rst b/docs/errors.rst index 86fe9ad..edaf66a 100644 --- a/docs/errors.rst +++ b/docs/errors.rst @@ -206,6 +206,18 @@ HighchartsUnsupportedProtocolError (from :class:`ValueError ` -------------- +HighchartsUnsupportedExportError (from :class:`ValueError `) +========================================================================================== + +.. autoexception:: HighchartsUnsupportedExportError + + .. collapse:: Class Inheritance + + .. inheritance-diagram:: HighchartsUnsupportedExportError + :parts: -1 + +-------------- + HighchartsUnsupportedExportTypeError (from :class:`ValueError `) ========================================================================================== diff --git a/docs/index.rst b/docs/index.rst index 85d1357..75d5a85 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -38,6 +38,8 @@ Highcharts Gantt for Python .. sidebar:: Version Compatibility + **Latest Highcharts (JS) version supported:** v.11.0.0 + **Highcharts Gantt for Python** is designed to be compatible with: * Python 3.10 or higher diff --git a/docs/using.rst b/docs/using.rst index 57e8715..34757ad 100644 --- a/docs/using.rst +++ b/docs/using.rst @@ -904,6 +904,13 @@ environment. The actual file itself is produced using a .. include:: using/download_visualizations/_using_custom.rst +.. warning:: + + As of Highcharts for Python v.1.1.0, the Highcharts :term:`Export Server` does not yet fully + support all of the series types added in Highcharts (JS) v.11. Attempting to programmatically download + one of those new as-yet-unsupported visualizations will generate a + :exc:`HighchartsUnsupportedExportError `. + ----------------------------- .. target-notes:: diff --git a/docs/visualizations.rst b/docs/visualizations.rst index ff3e6be..bd9ce41 100644 --- a/docs/visualizations.rst +++ b/docs/visualizations.rst @@ -332,6 +332,14 @@ to visualize your data. :class:`highcharts_core.options.plot_options.pareto.ParetoOptions` :class:`highcharts_core.options.series.pareto.ParetoSeries` + * - **Pictorial** + - .. figure:: _static/pictorial-example.png + :alt: Pictorial Example Chart + :width: 100% + + :class:`highcharts_core.options.plot_options.pictorial.PictorialOptions` + + :class:`highcharts_core.options.series.pictorial.PictorialSeries` * - **Pie** - .. tabs:: @@ -478,6 +486,14 @@ to visualize your data. :class:`highcharts_core.options.plot_options.timeline.TimelineOptions` :class:`highcharts_core.options.series.timeline.TimelineSeries` + * - **Treegraph** + - .. figure:: _static/treegraph-example.png + :alt: Treegraph Example Chart + :width: 100% + + :class:`highcharts_core.options.plot_options.treegraph.TreegraphOptions` + + :class:`highcharts_core.options.series.treegraph.TreegraphSeries` * - **Treemap** - .. figure:: _static/treemap-example.png :alt: Treemap Example Chart @@ -636,6 +652,22 @@ to visualize your data. * - Series Type - Screenshot + Class Links + * - **Flowmap** + - .. figure:: _static/flowmap-example.png + :alt: Flowmap Example Chart + :width: 100% + + :class:`highcharts_maps.options.plot_options.flowmap.FlowmapOptions` + + :class:`highcharts_maps.options.series.flowmap.FlowmapSeries` + * - **GeoHeatmap** + - .. figure:: _static/geoheatmap-example.png + :alt: GeoHeatmap Example Chart + :width: 100% + + :class:`highcharts_maps.options.plot_options.flowmap.GeoHeatmapOptions` + + :class:`highcharts_maps.options.series.flowmap.GeoHeatmapSeries` * - **Map** - .. figure:: _static/map-example.png :alt: Map Example Chart diff --git a/highcharts_gantt/__version__.py b/highcharts_gantt/__version__.py index cd7ca49..1a72d32 100644 --- a/highcharts_gantt/__version__.py +++ b/highcharts_gantt/__version__.py @@ -1 +1 @@ -__version__ = '1.0.1' +__version__ = '1.1.0' diff --git a/highcharts_gantt/options/__init__.py b/highcharts_gantt/options/__init__.py index 15294c4..c3d683e 100644 --- a/highcharts_gantt/options/__init__.py +++ b/highcharts_gantt/options/__init__.py @@ -25,6 +25,7 @@ from highcharts_gantt.options.plot_options import PlotOptions from highcharts_gantt.options.plot_options.generic import GenericTypeOptions from highcharts_gantt.options.responsive import Responsive +from highcharts_gantt.options.sonification import SonificationOptions from highcharts_gantt.options.subtitle import Subtitle from highcharts_gantt.options.time import Time from highcharts_gantt.options.title import Title @@ -513,6 +514,20 @@ def series(self, value): default_type = default_series_type) for x in value] + @property + def sonification(self) -> Optional[SonificationOptions]: + """Configuration of global sonification settings for the entire chart. + + :rtype: :class:`SonificationOptions ` or + :obj:`None ` + """ + return self._sonification + + @sonification.setter + @class_sensitive(SonificationOptions) + def sonification(self, value): + self._sonification = value + @property def subtitle(self) -> Optional[Subtitle]: """The chart's subtitle. @@ -647,6 +662,7 @@ def _get_kwargs_from_dict(cls, as_dict): 'responsive': as_dict.get('responsive', None), 'scrollbar': as_dict.get('scrollbar', None), 'series': as_dict.get('series', None), + 'sonification': as_dict.get('sonification', None), 'stock_tools': as_dict.get('stockTools', None), 'subtitle': as_dict.get('subtitle', None), 'time': as_dict.get('time', None), @@ -686,6 +702,7 @@ def _to_untrimmed_dict(self, in_cls = None) -> dict: 'responsive': self.responsive, 'scrollbar': self.scrollbar, 'series': self.series, + 'sonification': self.sonification, 'stockTools': self.stock_tools, 'subtitle': self.subtitle, 'time': self.time, diff --git a/highcharts_gantt/options/plot_options/__init__.py b/highcharts_gantt/options/plot_options/__init__.py index db5ffe8..48741fb 100644 --- a/highcharts_gantt/options/plot_options/__init__.py +++ b/highcharts_gantt/options/plot_options/__init__.py @@ -32,6 +32,7 @@ from highcharts_gantt.options.plot_options.organization import OrganizationOptions from highcharts_gantt.options.plot_options.packedbubble import PackedBubbleOptions from highcharts_gantt.options.plot_options.pareto import ParetoOptions +from highcharts_gantt.options.plot_options.pictorial import PictorialOptions from highcharts_gantt.options.plot_options.pie import PieOptions from highcharts_gantt.options.plot_options.polygon import PolygonOptions from highcharts_gantt.options.plot_options.pyramid import PyramidOptions @@ -46,6 +47,7 @@ from highcharts_gantt.options.plot_options.sunburst import SunburstOptions from highcharts_gantt.options.plot_options.heatmap import TilemapOptions from highcharts_gantt.options.plot_options.timeline import TimelineOptions +from highcharts_gantt.options.plot_options.treegraph import TreegraphOptions from highcharts_gantt.options.plot_options.treemap import TreemapOptions from highcharts_gantt.options.plot_options.pie import VariablePieOptions from highcharts_gantt.options.plot_options.bar import VariwideOptions @@ -782,6 +784,28 @@ def pareto(self) -> Optional[ParetoOptions]: def pareto(self, value): self._pareto = value + @property + def pictorial(self) -> Optional[PictorialOptions]: + """General options to apply to all Pictorial series types. + + A pictorial series uses vector images to represent the data, with the data's shape + determined by the ``path`` parameter. + + .. figure:: ../../../_static/pictorial-example.png + :alt: Pictorial Example Chart + :align: center + + + :rtype: :class:`PictorialOptions ` or + :obj:`None ` + """ + return self._pictorial + + @pictorial.setter + @class_sensitive(PictorialOptions) + def pictorial(self, value): + self._pictorial = value + @property def pie(self) -> Optional[PieOptions]: """General options to apply to all Pie series types. @@ -1114,6 +1138,27 @@ def timeline(self) -> Optional[TimelineOptions]: def timeline(self, value): self._timeline = value + @property + def treegraph(self) -> Optional[TreegraphOptions]: + """General options to apply to all :term:`Treegraph` series types. + + A treegraph visualizes a relationship between ancestors and descendants with a clear parent-child relationship, + e.g. a family tree or a directory structure. + + .. figure:: ../../../_static/treegraph-example.png + :alt: Treegraph Example Chart + :align: center + + :rtype: :class:`TreegraphOptions ` or + :obj:`None ` + """ + return self._treegraph + + @treegraph.setter + @class_sensitive(TreegraphOptions) + def treegraph(self, value): + self._treegraph = value + @property def treemap(self) -> Optional[TreemapOptions]: """General options to apply to all Treemap series types. @@ -1383,6 +1428,7 @@ def _get_kwargs_from_dict(cls, as_dict): 'organization': as_dict.get('organization', None), 'packedbubble': as_dict.get('packedbubble', None), 'pareto': as_dict.get('pareto', None), + 'pictorial': as_dict.get('pictorial', None), 'pie': as_dict.get('pie', None), 'polygon': as_dict.get('polygon', None), 'pyramid': as_dict.get('pyramid', None), @@ -1397,6 +1443,7 @@ def _get_kwargs_from_dict(cls, as_dict): 'sunburst': as_dict.get('sunburst', None), 'tilemap': as_dict.get('tilemap', None), 'timeline': as_dict.get('timeline', None), + 'treegraph': as_dict.get('treegraph', None), 'treemap': as_dict.get('treemap', None), 'variablepie': as_dict.get('variablepie', None), 'variwide': as_dict.get('variwide', None), @@ -1569,6 +1616,7 @@ def _to_untrimmed_dict(self, in_cls = None) -> dict: 'sunburst': self.sunburst, 'tilemap': self.tilemap, 'timeline': self.timeline, + 'treegraph': self.treegraph, 'treemap': self.treemap, 'variablepie': self.variablepie, 'variwide': self.variwide, diff --git a/highcharts_gantt/options/plot_options/pictorial.py b/highcharts_gantt/options/plot_options/pictorial.py new file mode 100644 index 0000000..16a0e46 --- /dev/null +++ b/highcharts_gantt/options/plot_options/pictorial.py @@ -0,0 +1 @@ +from highcharts_stock.options.plot_options.pictorial import * \ No newline at end of file diff --git a/highcharts_gantt/options/plot_options/sonification.py b/highcharts_gantt/options/plot_options/sonification.py new file mode 100644 index 0000000..fe624bd --- /dev/null +++ b/highcharts_gantt/options/plot_options/sonification.py @@ -0,0 +1 @@ +from highcharts_stock.options.plot_options.sonification import * \ No newline at end of file diff --git a/highcharts_gantt/options/plot_options/treegraph.py b/highcharts_gantt/options/plot_options/treegraph.py new file mode 100644 index 0000000..5723585 --- /dev/null +++ b/highcharts_gantt/options/plot_options/treegraph.py @@ -0,0 +1 @@ +from highcharts_stock.options.plot_options.treegraph import * \ No newline at end of file diff --git a/highcharts_gantt/options/series/data/treegraph.py b/highcharts_gantt/options/series/data/treegraph.py new file mode 100644 index 0000000..1a860f0 --- /dev/null +++ b/highcharts_gantt/options/series/data/treegraph.py @@ -0,0 +1 @@ +from highcharts_stock.options.series.data.treegraph import * \ No newline at end of file diff --git a/highcharts_gantt/options/series/pictorial.py b/highcharts_gantt/options/series/pictorial.py new file mode 100644 index 0000000..ffd7ad1 --- /dev/null +++ b/highcharts_gantt/options/series/pictorial.py @@ -0,0 +1 @@ +from highcharts_stock.options.series.pictorial import * \ No newline at end of file diff --git a/highcharts_gantt/options/series/series_generator.py b/highcharts_gantt/options/series/series_generator.py index 204bd52..9ca96e0 100644 --- a/highcharts_gantt/options/series/series_generator.py +++ b/highcharts_gantt/options/series/series_generator.py @@ -43,6 +43,7 @@ from highcharts_gantt.options.series.organization import OrganizationSeries from highcharts_gantt.options.series.packedbubble import PackedBubbleSeries from highcharts_gantt.options.series.pareto import ParetoSeries +from highcharts_gantt.options.series.pictorial import PictorialSeries from highcharts_gantt.options.series.pie import PieSeries from highcharts_gantt.options.series.pie import VariablePieSeries from highcharts_gantt.options.series.polygon import PolygonSeries @@ -54,6 +55,7 @@ from highcharts_gantt.options.series.spline import SplineSeries from highcharts_gantt.options.series.sunburst import SunburstSeries from highcharts_gantt.options.series.timeline import TimelineSeries +from highcharts_gantt.options.series.treegraph import TreegraphSeries from highcharts_gantt.options.series.treemap import TreemapSeries from highcharts_gantt.options.series.vector import VectorSeries from highcharts_gantt.options.series.venn import VennSeries @@ -99,6 +101,7 @@ 'organization': OrganizationSeries, 'packedbubble': PackedBubbleSeries, 'pareto': ParetoSeries, + 'pictorial': PictorialSeries, 'pie': PieSeries, 'variablepie': VariablePieSeries, 'polygon': PolygonSeries, @@ -110,6 +113,7 @@ 'spline': SplineSeries, 'sunburst': SunburstSeries, 'timeline': TimelineSeries, + 'treegraph': TreegraphSeries, 'treemap': TreemapSeries, 'vector': VectorSeries, 'venn': VennSeries, diff --git a/highcharts_gantt/options/series/treegraph.py b/highcharts_gantt/options/series/treegraph.py new file mode 100644 index 0000000..a10018b --- /dev/null +++ b/highcharts_gantt/options/series/treegraph.py @@ -0,0 +1 @@ +from highcharts_stock.options.series.treegraph import * \ No newline at end of file diff --git a/highcharts_gantt/options/sonification/__init__.py b/highcharts_gantt/options/sonification/__init__.py new file mode 100644 index 0000000..7096001 --- /dev/null +++ b/highcharts_gantt/options/sonification/__init__.py @@ -0,0 +1 @@ +from highcharts_stock.options.sonification import SonificationOptions \ No newline at end of file diff --git a/highcharts_gantt/options/sonification/grouping.py b/highcharts_gantt/options/sonification/grouping.py new file mode 100644 index 0000000..7b98e24 --- /dev/null +++ b/highcharts_gantt/options/sonification/grouping.py @@ -0,0 +1 @@ +from highcharts_stock.options.sonification.grouping import * \ No newline at end of file diff --git a/highcharts_gantt/options/sonification/mapping.py b/highcharts_gantt/options/sonification/mapping.py new file mode 100644 index 0000000..d978a56 --- /dev/null +++ b/highcharts_gantt/options/sonification/mapping.py @@ -0,0 +1 @@ +from highcharts_stock.options.sonification.mapping import * \ No newline at end of file diff --git a/highcharts_gantt/options/sonification/track_configurations.py b/highcharts_gantt/options/sonification/track_configurations.py new file mode 100644 index 0000000..bbf727e --- /dev/null +++ b/highcharts_gantt/options/sonification/track_configurations.py @@ -0,0 +1 @@ +from highcharts_stock.options.sonification.track_configurations import * \ No newline at end of file diff --git a/tests/input_files/plot_options/pictorial/03.js b/tests/input_files/plot_options/pictorial/03.js new file mode 100644 index 0000000..bf97505 --- /dev/null +++ b/tests/input_files/plot_options/pictorial/03.js @@ -0,0 +1,6 @@ +{ + depth: 10, + edgeColor: '#999', + edgeWidth: 1, + groupZPadding: 4 +} diff --git a/tests/input_files/plot_options/pictorial/04.js b/tests/input_files/plot_options/pictorial/04.js new file mode 100644 index 0000000..bf97505 --- /dev/null +++ b/tests/input_files/plot_options/pictorial/04.js @@ -0,0 +1,6 @@ +{ + depth: 10, + edgeColor: '#999', + edgeWidth: 1, + groupZPadding: 4 +} diff --git a/tests/input_files/plot_options/pictorial/error-01.js b/tests/input_files/plot_options/pictorial/error-01.js new file mode 100644 index 0000000..2e4ec63 --- /dev/null +++ b/tests/input_files/plot_options/pictorial/error-01.js @@ -0,0 +1,46 @@ +{ + borderColor: '#ccc', + borderRadius: 'invalid value', + borderWidth: 2, + centerInCategory: true, + colorByPoint: true, + colors: [ + '#fff', + '#ccc', + { + linearGradient: { + x1: 0.123, + x2: 0.567, + y1: 0.891, + y2: 0.987 + }, + stops: [ + [0.123, '#cccccc'], + [0.456, '#ff0000'], + [1, '#00ff00'] + ] + }, + { + animation: { + defer: 5 + }, + patternOptions: { + aspectRatio: 0.5, + backgroundColor: '#999999', + id: 'some_id_goes_here', + opacity: 0.5, + width: 120, + x: 5, + y: 10 + }, + patternIndex: 2 + } + ], + grouping: false, + groupPadding: 6, + maxPointWidth: 12, + minPointLength: 12, + pointPadding: 6, + pointRange: 'invalid value', + pointWidth: 'invalid-value' +} diff --git a/tests/input_files/plot_options/pictorial/error-02.js b/tests/input_files/plot_options/pictorial/error-02.js new file mode 100644 index 0000000..659707f --- /dev/null +++ b/tests/input_files/plot_options/pictorial/error-02.js @@ -0,0 +1,284 @@ +{ + borderColor: '#ccc', + borderRadius: 4, + borderWidth: 'invalid value', + centerInCategory: true, + colorByPoint: true, + colors: [ + '#fff', + '#ccc', + { + linearGradient: { + x1: 0.123, + x2: 0.567, + y1: 0.891, + y2: 0.987 + }, + stops: [ + [0.123, '#cccccc'], + [0.456, '#ff0000'], + [1, '#00ff00'] + ] + }, + { + animation: { + defer: 5 + }, + patternOptions: { + aspectRatio: 0.5, + backgroundColor: '#999999', + id: 'some_id_goes_here', + opacity: 0.5, + width: 120, + x: 5, + y: 10 + }, + patternIndex: 2 + } + ], + grouping: false, + groupPadding: 6, + maxPointWidth: 12, + minPointLength: 12, + pointPadding: 6, + pointRange: 24, + pointWidth: 12, + + accessibility: { + description: 'Description goes here', + enabled: true, + exposeAsGroupOnly: true, + keyboardNavigation: { + enabled: true + }, + point: { + dateFormat: 'format string', + dateFormatter: function() { return true; }, + describeNull: false, + descriptionFormatter: function() { return true; }, + valueDecimals: 2, + valueDescriptionFormat: 'format string', + valuePrefix: '$', + valueSuffix: 'USD' + }, + }, + allowPointSelect: true, + animation: { + defer: 5 + }, + className: 'some-class-name', + clip: false, + color: '#fff', + cursor: 'alias', + custom: { + 'item1': 'some value', + 'item2': 'some value' + }, + dashStyle: 'Dash', + dataLabels: { + align: 'center', + allowOverlap: true, + animation: { + defer: 5 + }, + backgroundColor: { + linearGradient: { + x1: 0.123, + x2: 0.234, + y1: 0.345, + y2: 0.456 + }, + stops: [ + [0.12, '#999'], + [0.34, '#fff'] + ] + }, + borderColor: '#999999', + borderRadius: 24, + borderWidth: 1, + className: 'some-class-name', + color: '#000000', + crop: true, + defer: false, + enabled: true, + filter: { + operator: '>=', + property: 'some_property', + value: 123 + }, + format: 'some format', + formatter: function() { return true; }, + inside: true, + nullFormat: 'some format', + nullFormatter: function() { return true; }, + overflow: 'none', + padding: 12, + position: 'center', + rotation: 0, + shadow: false, + shape: 'rect', + style: 'style goes here', + useHTML: false, + verticalAlign: 'top', + x: 10, + y: 20, + z: 0 + }, + description: 'Description goes here', + enableMouseTracking: true, + events: { + afterAnimate: function(event) { return true; }, + click: function(event) { return true; }, + hide: function(event) { return true; }, + mouseOut: function(event) { return true; }, + show: function(event) { return true; } + }, + includeInDataExport: true, + keys: [ + 'somevalue', + 'somevalue', + 'somevalue' + ], + label: { + boxesToAvoid: [ + { + bottom: 12, + left: -46, + right: 84, + top: 24 + }, + { + bottom: 48, + left: -46, + right: 84, + top: 86 + } + ], + connectorAllowed: true, + connectorNeighbourDistance: 12, + enabled: true, + format: 'format string', + formatter: function() { return true; }, + maxFontSize: 18, + minFontSize: 6, + onArea: false, + style: 'some style string' + }, + linkedTo: 'some_id', + marker: { + enabled: true, + fillColor: '#cccccc', + height: 24, + lineWidth: 2, + radius: 2, + states: { + hover: { + enabled: true + } + }, + symbol: 'circle', + width: 48 + }, + onPoint: { + connectorOptions: { + dashstyle: 'Dash', + stroke: '#ccc', + width: 2 + }, + id: 'some-id', + position: { + align: 'left', + verticalAlign: 'top', + x: 15, + y: -46 + } + }, + opacity: 0.2, + point: { + events: { + click: function(event) { return true; }, + drag: function(event) { return true; }, + drop: function(event) { return true; }, + mouseOut: function(event) { return true; } + } + }, + pointDescriptionFormatter: function (point) { return true; }, + selected: false, + showCheckbox: true, + showInLegend: true, + skipKeyboardNavigation: false, + states: { + hover: { + animation: { + duration: 123 + }, + borderColor: '#cccccc', + brightness: 0.3, + enabled: true + }, + inactive: { + enabled: true, + opacity: 0.5 + }, + normal: { + animation: { + defer: 24 + } + }, + select: { + color: '#ff0000', + enabled: true, + } + }, + stickyTracking: true, + threshold: 123, + tooltip: { + animation: true, + backgroundColor: '#ccc', + borderColor: '#999', + borderRadius: 4, + borderWidth: 1, + className: 'some-class-name', + clusterFormat: 'format string', + dateTimeLabelFormats: { + day: 'test', + hour: 'test', + millisecond: 'test', + minute: 'test', + month: 'test', + second: 'test', + week: 'test', + year: 'test' + }, + distance: 12, + enabled: true, + followPointer: true, + followTouchMove: true, + footerFormat: 'format string', + formatter: function() { return true; }, + headerFormat: 'format string', + headerShape: 'circle', + hideDelay: 3, + nullFormat: 'format string', + nullFormatter: function() { return true; }, + outside: false, + padding: 6, + pointFormat: 'format string', + pointFormatter: function() { return true; }, + positioner: function() { return true; }, + shadow: false, + shape: 'rect', + shared: false, + snap: 4, + split: false, + stickOnContact: true, + style: 'style string goes here', + useHTML: false, + valueDecimals: 2, + valuePrefix: '$', + valueSuffix: ' USD', + xDateFormat: 'format string' + }, + turboThreshold: 'invalid value', + visible: true +} diff --git a/tests/input_files/plot_options/sonification/01.js b/tests/input_files/plot_options/sonification/01.js new file mode 100644 index 0000000..87a687a --- /dev/null +++ b/tests/input_files/plot_options/sonification/01.js @@ -0,0 +1,440 @@ +{ + contextTracks: { + valueInterval: 5, + valueMapFunction: 'linear', + valueProp: 'y', + midiName: 'some-value', + activeWhen: { + crossingDown: 2, + crossingUp: 3, + max: 5, + min: 1, + prop: 'y' + }, + mapping: { + frequency: 3, + gapBetweenNotes: 5, + highpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + lowpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + noteDuration: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pan: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pitch: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + playDelay: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + time: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + tremolo: { + depth: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + speed: 0.5 + }, + volume: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + showPlayMarker: true, + type: 'instrument' + }, + defaultInstrumentOptions: { + instrument: 'piano', + midiName: 'some-value', + roundToMusicalNotes: true, + activeWhen: { + crossingDown: 2, + crossingUp: 3, + max: 5, + min: 1, + prop: 'y' + }, + mapping: { + frequency: 3, + gapBetweenNotes: 5, + highpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + lowpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + noteDuration: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pan: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pitch: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + playDelay: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + time: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + tremolo: { + depth: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + speed: 0.5 + }, + volume: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + showPlayMarker: true, + type: 'instrument' + }, + defaultSpeechOptions: { + language: 'en-US', + activeWhen: { + crossingDown: 2, + crossingUp: 3, + max: 5, + min: 1, + prop: 'y' + }, + mapping: { + frequency: 3, + gapBetweenNotes: 5, + highpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + lowpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + noteDuration: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pan: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pitch: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + playDelay: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + time: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + tremolo: { + depth: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + speed: 0.5 + }, + volume: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + showPlayMarker: true, + type: 'speech' + }, + enabled: true, + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + tracks: { + instrument: 'piano', + midiName: 'some-value', + roundToMusicalNotes: true, + activeWhen: { + crossingDown: 2, + crossingUp: 3, + max: 5, + min: 1, + prop: 'y' + }, + mapping: { + frequency: 3, + gapBetweenNotes: 5, + highpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + lowpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + noteDuration: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pan: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pitch: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + playDelay: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + time: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + tremolo: { + depth: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + speed: 0.5 + }, + volume: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + showPlayMarker: true, + type: 'instrument' + } +} \ No newline at end of file diff --git a/tests/input_files/plot_options/sonification/02.js b/tests/input_files/plot_options/sonification/02.js new file mode 100644 index 0000000..f4de6ae --- /dev/null +++ b/tests/input_files/plot_options/sonification/02.js @@ -0,0 +1,551 @@ +{ + contextTracks: [ + { + valueInterval: 5, + valueMapFunction: 'linear', + valueProp: 'y', + midiName: 'some-value', + activeWhen: { + crossingDown: 2, + crossingUp: 3, + max: 5, + min: 1, + prop: 'y' + }, + mapping: { + frequency: 3, + gapBetweenNotes: 5, + highpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + lowpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + noteDuration: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pan: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pitch: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + playDelay: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + time: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + tremolo: { + depth: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + speed: 0.5 + }, + volume: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + showPlayMarker: true, + type: 'instrument' + }, + { + valueInterval: 5, + valueMapFunction: 'linear', + valueProp: 'y', + midiName: 'some-value', + activeWhen: { + crossingDown: 2, + crossingUp: 3, + max: 5, + min: 1, + prop: 'y' + }, + mapping: { + frequency: 3, + gapBetweenNotes: 5, + highpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + lowpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + noteDuration: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pan: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pitch: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + playDelay: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + time: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + tremolo: { + depth: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + speed: 0.5 + }, + volume: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + showPlayMarker: true, + type: 'instrument' + } + ], + defaultInstrumentOptions: { + instrument: 'piano', + midiName: 'some-value', + roundToMusicalNotes: true, + activeWhen: { + crossingDown: 2, + crossingUp: 3, + max: 5, + min: 1, + prop: 'y' + }, + mapping: { + frequency: 3, + gapBetweenNotes: 5, + highpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + lowpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + noteDuration: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pan: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pitch: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + playDelay: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + time: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + tremolo: { + depth: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + speed: 0.5 + }, + volume: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + showPlayMarker: true, + type: 'instrument' + }, + defaultSpeechOptions: { + language: 'en-US', + activeWhen: { + crossingDown: 2, + crossingUp: 3, + max: 5, + min: 1, + prop: 'y' + }, + mapping: { + frequency: 3, + gapBetweenNotes: 5, + highpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + lowpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + noteDuration: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pan: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pitch: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + playDelay: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + time: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + tremolo: { + depth: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + speed: 0.5 + }, + volume: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + showPlayMarker: true, + type: 'speech' + }, + enabled: true, + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + tracks: { + instrument: 'piano', + midiName: 'some-value', + roundToMusicalNotes: true, + activeWhen: { + crossingDown: 2, + crossingUp: 3, + max: 5, + min: 1, + prop: 'y' + }, + mapping: { + frequency: 3, + gapBetweenNotes: 5, + highpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + lowpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + noteDuration: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pan: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pitch: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + playDelay: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + time: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + tremolo: { + depth: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + speed: 0.5 + }, + volume: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + showPlayMarker: true, + type: 'instrument' + } +} \ No newline at end of file diff --git a/tests/input_files/plot_options/sonification/error-01.js b/tests/input_files/plot_options/sonification/error-01.js new file mode 100644 index 0000000..a028a43 --- /dev/null +++ b/tests/input_files/plot_options/sonification/error-01.js @@ -0,0 +1,333 @@ +{ + defaultInstrumentOptions: 'invalid value', + defaultSpeechOptions: { + language: 'en-US', + activeWhen: { + crossingDown: 2, + crossingUp: 3, + max: 5, + min: 1, + prop: 'y' + }, + mapping: { + frequency: 3, + gapBetweenNotes: 5, + highpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + lowpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + noteDuration: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pan: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pitch: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + playDelay: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + time: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + tremolo: { + depth: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + speed: 0.5 + }, + volume: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + showPlayMarker: true, + type: 'speech' + }, + enabled: true, + contextTracks: { + valueInterval: 5, + valueMapFunction: 'linear', + valueProp: 'y', + midiName: 'some-value', + activeWhen: { + crossingDown: 2, + crossingUp: 3, + max: 5, + min: 1, + prop: 'y' + }, + mapping: { + frequency: 3, + gapBetweenNotes: 5, + highpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + lowpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + noteDuration: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pan: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pitch: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + playDelay: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + time: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + tremolo: { + depth: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + speed: 0.5 + }, + volume: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + showPlayMarker: true, + type: 'instrument' + }, + tracks: { + instrument: 'piano', + midiName: 'some-value', + roundToMusicalNotes: true, + activeWhen: { + crossingDown: 2, + crossingUp: 3, + max: 5, + min: 1, + prop: 'y' + }, + mapping: { + frequency: 3, + gapBetweenNotes: 5, + highpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + lowpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + noteDuration: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pan: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pitch: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + playDelay: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + time: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + tremolo: { + depth: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + speed: 0.5 + }, + volume: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + showPlayMarker: true, + type: 'instrument' + }, + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + } +} \ No newline at end of file diff --git a/tests/input_files/plot_options/treegraph/01.js b/tests/input_files/plot_options/treegraph/01.js new file mode 100644 index 0000000..b8e4bd0 --- /dev/null +++ b/tests/input_files/plot_options/treegraph/01.js @@ -0,0 +1,22 @@ +{ + type: 'treegraph', + animationLimit: 10, + boostBlending: 'some-value-goes-here', + boostThreshold: 5000, + colorIndex: 2, + crisp: true, + cropThreshold: 500, + findNearestPointBy: 'xy', + getExtremesFromAll: true, + relativeXValue: true, + softThreshold: true, + step: 'left', + + pointInterval: 5, + pointIntervalUnit: 'day', + pointStart: 1, + stacking: 'normal', + + allowTraversingTree: true, + colorByPoint: true +} \ No newline at end of file diff --git a/tests/input_files/plot_options/treegraph/02.js b/tests/input_files/plot_options/treegraph/02.js new file mode 100644 index 0000000..b298bd6 --- /dev/null +++ b/tests/input_files/plot_options/treegraph/02.js @@ -0,0 +1,262 @@ +{ + accessibility: { + description: 'Description goes here', + enabled: true, + exposeAsGroupOnly: true, + keyboardNavigation: { + enabled: true + }, + point: { + dateFormat: 'format string', + dateFormatter: function() { return true; }, + describeNull: false, + descriptionFormatter: function() { return true; }, + valueDecimals: 2, + valueDescriptionFormat: 'format string', + valuePrefix: '$', + valueSuffix: 'USD' + }, + }, + allowPointSelect: true, + animation: { + defer: 5 + }, + className: 'some-class-name', + clip: false, + color: '#fff', + cursor: 'alias', + custom: { + 'item1': 'some value', + 'item2': 'some value' + }, + dashStyle: 'Dash', + dataLabels: { + align: 'center', + allowOverlap: true, + animation: { + defer: 5 + }, + backgroundColor: { + linearGradient: { + x1: 0.123, + x2: 0.234, + y1: 0.345, + y2: 0.456 + }, + stops: [ + [0.12, '#999'], + [0.34, '#fff'] + ] + }, + borderColor: '#999999', + borderRadius: 24, + borderWidth: 1, + className: 'some-class-name', + color: '#000000', + crop: true, + defer: false, + enabled: true, + filter: { + operator: '>=', + property: 'some_property', + value: 123 + }, + format: 'some format', + formatter: function() { return true; }, + inside: true, + nullFormat: 'some format', + nullFormatter: function() { return true; }, + overflow: 'none', + padding: 12, + position: 'center', + rotation: 0, + shadow: false, + shape: 'rect', + style: 'style goes here', + useHTML: false, + verticalAlign: 'top', + x: 10, + y: 20, + z: 0 + }, + description: 'Description goes here', + enableMouseTracking: true, + events: { + afterAnimate: function(event) { return true; }, + click: function(event) { return true; }, + hide: function(event) { return true; }, + mouseOut: function(event) { return true; }, + show: function(event) { return true; } + }, + includeInDataExport: true, + keys: [ + 'somevalue', + 'somevalue', + 'somevalue' + ], + label: { + boxesToAvoid: [ + { + bottom: 12, + left: -46, + right: 84, + top: 24 + }, + { + bottom: 48, + left: -46, + right: 84, + top: 86 + } + ], + connectorAllowed: true, + connectorNeighbourDistance: 12, + enabled: true, + format: 'format string', + formatter: function() { return true; }, + maxFontSize: 18, + minFontSize: 6, + onArea: false, + style: 'some style string' + }, + linkedTo: 'some_id', + marker: { + enabled: true, + fillColor: '#cccccc', + height: 24, + lineWidth: 2, + radius: 2, + states: { + hover: { + enabled: true + } + }, + symbol: 'circle', + width: 48 + }, + onPoint: { + connectorOptions: { + dashstyle: 'Dash', + stroke: '#ccc', + width: 2 + }, + id: 'some-id', + position: { + align: 'left', + verticalAlign: 'top', + x: 15, + y: -46 + } + }, + opacity: 0.2, + point: { + events: { + click: function(event) { return true; }, + drag: function(event) { return true; }, + drop: function(event) { return true; }, + mouseOut: function(event) { return true; } + } + }, + pointDescriptionFormatter: function (point) { return true; }, + selected: false, + showCheckbox: true, + showInLegend: true, + skipKeyboardNavigation: false, + states: { + hover: { + animation: { + duration: 123 + }, + borderColor: '#cccccc', + brightness: 0.3, + enabled: true + }, + inactive: { + enabled: true, + opacity: 0.5 + }, + normal: { + animation: { + defer: 24 + } + }, + select: { + color: '#ff0000', + enabled: true + } + }, + stickyTracking: true, + tooltip: { + animation: true, + backgroundColor: '#ccc', + borderColor: '#999', + borderRadius: 4, + borderWidth: 1, + className: 'some-class-name', + clusterFormat: 'format string', + dateTimeLabelFormats: { + day: 'test', + hour: 'test', + millisecond: 'test', + minute: 'test', + month: 'test', + second: 'test', + week: 'test', + year: 'test' + }, + distance: 12, + enabled: true, + followPointer: true, + followTouchMove: true, + footerFormat: 'format string', + formatter: function() { return true; }, + headerFormat: 'format string', + headerShape: 'circle', + hideDelay: 3, + nullFormat: 'format string', + nullFormatter: function() { return true; }, + outside: false, + padding: 6, + pointFormat: 'format string', + pointFormatter: function() { return true; }, + positioner: function() { return true; }, + shadow: false, + shape: 'rect', + shared: false, + snap: 4, + split: false, + stickOnContact: true, + style: 'style string goes here', + useHTML: false, + valueDecimals: 2, + valuePrefix: '$', + valueSuffix: ' USD', + xDateFormat: 'format string' + }, + turboThreshold: 456, + visible: true, + type: 'treegraph', + + animationLimit: 10, + boostBlending: 'some-value-goes-here', + boostThreshold: 5000, + colorIndex: 2, + crisp: true, + cropThreshold: 500, + findNearestPointBy: 'xy', + getExtremesFromAll: true, + relativeXValue: true, + softThreshold: true, + step: 'left', + + pointInterval: 5, + pointIntervalUnit: 'day', + pointStart: 1, + stacking: 'normal', + + allowTraversingTree: true, + collapseButton: { + enabled: true + }, + colorByPoint: true +} \ No newline at end of file diff --git a/tests/input_files/plot_options/treegraph/error-00.js b/tests/input_files/plot_options/treegraph/error-00.js new file mode 100644 index 0000000..ae670c0 --- /dev/null +++ b/tests/input_files/plot_options/treegraph/error-00.js @@ -0,0 +1 @@ +not a valid JavaScript file diff --git a/tests/input_files/plot_options/treegraph/error-01.js b/tests/input_files/plot_options/treegraph/error-01.js new file mode 100644 index 0000000..8f96909 --- /dev/null +++ b/tests/input_files/plot_options/treegraph/error-01.js @@ -0,0 +1,98 @@ +{ + allowTraversingTree: true, + alternateStartingDirection: false, + animationLimit: 10, + boostBlending: 'some-value-goes-here', + boostThreshold: 'invalid value', + breadcrumbs: { + buttonSpacing: 6, + buttonTheme: { + 'fill': '#fff' + }, + events: { + click: function(event) { return true; } + }, + floating: true, + format: 'some format string', + formatter: function () { return true; }, + position: None, + relativeTo: 'plot', + rtl: false, + separator: { + style: { + 'some-key': 'some-value' + }, + text: '>' + }, + useHTML: false, + zIndex: 3 + }, + colorAxis: 'some-id-goes-here', + colorByPoint: true, + colorIndex: 2, + colorKey: 'some-key-goes-here', + colors: [ + '#ccc', + '#fff', + '000000' + ], + crisp: true, + cropThreshold: 500, + findNearestPointBy: 'xy', + getExtremesFromAll: true, + ignoreHiddenPoint: true, + interactByLeaf: true, + layoutAlgorithm: 'sliceAndDice', + layoutStartingDirection: 'vertical', + levelIsConstant: true, + levels: [ + { + borderDashStyle: 'Solid', + color: '#ccc', + colorVariation: { + key: 'brightness', + to: 50 + }, + layoutAlgorithm: 'sliceAndDice', + layoutStartingDirection: 'vertical', + borderColor: '#ccc', + borderWidth: 1, + level: 1, + } + ], + linecap: 'round', + lineWidth: 1, + negativeColor: '#ccc', + pointInterval: 5, + pointIntervalUnit: 'day', + pointStart: 1, + relativeXVvalue: true, + softThreshold: true, + sortIndex: 2, + stacking: 'normal', + step: 'left', + zoneAxis: 'y', + zones: [ + { + className: 'some-class-name1', + color: '#999999', + dashStyle: 'Solid', + fillColor: '#cccccc', + value: 123 + }, + { + className: 'some-class-name1', + color: '#999999', + dashStyle: 'Solid', + fillColor: '#cccccc', + value: 123 + }, + { + className: 'some-class-name1', + color: '#999999', + dashStyle: 'Solid', + fillColor: '#cccccc', + value: 123 + } + ] +} diff --git a/tests/input_files/plot_options/treegraph/error-02.js b/tests/input_files/plot_options/treegraph/error-02.js new file mode 100644 index 0000000..7f305c2 --- /dev/null +++ b/tests/input_files/plot_options/treegraph/error-02.js @@ -0,0 +1,336 @@ +{ + allowTraversingTree: true, + alternateStartingDirection: false, + animationLimit: 10, + boostBlending: 'some-value-goes-here', + boostThreshold: 'invalid value', + breadcrumbs: { + buttonSpacing: 6, + buttonTheme: { + 'fill': '#fff' + }, + events: { + click: function(event) { return true; } + }, + floating: true, + format: 'some format string', + formatter: function () { return true; }, + position: None, + relativeTo: 'plot', + rtl: false, + separator: { + style: { + 'some-key': 'some-value' + }, + text: '>' + }, + useHTML: false, + zIndex: 3 + }, + colorAxis: 'some-id-goes-here', + colorByPoint: true, + colorIndex: 2, + colorKey: 'some-key-goes-here', + colors: [ + '#ccc', + '#fff', + '000000' + ], + crisp: true, + cropThreshold: 500, + findNearestPointBy: 'xy', + getExtremesFromAll: true, + ignoreHiddenPoint: true, + interactByLeaf: true, + layoutAlgorithm: 'sliceAndDice', + layoutStartingDirection: 'vertical', + levelIsConstant: true, + levels: [ + { + borderDashStyle: 'Solid', + color: '#ccc', + colorVariation: { + key: 'brightness', + to: 50 + }, + layoutAlgorithm: 'sliceAndDice', + layoutStartingDirection: 'vertical', + borderColor: '#ccc', + borderWidth: 1, + level: 1, + } + ], + linecap: 'round', + lineWidth: 1, + negativeColor: '#ccc', + pointInterval: 5, + pointIntervalUnit: 'day', + pointStart: 1, + relativeXVvalue: true, + softThreshold: true, + sortIndex: 2, + stacking: 'normal', + step: 'left', + zoneAxis: 'y', + zones: [ + { + className: 'some-class-name1', + color: '#999999', + dashStyle: 'Solid', + fillColor: '#cccccc', + value: 123 + }, + { + className: 'some-class-name1', + color: '#999999', + dashStyle: 'Solid', + fillColor: '#cccccc', + value: 123 + }, + { + className: 'some-class-name1', + color: '#999999', + dashStyle: 'Solid', + fillColor: '#cccccc', + value: 123 + } + ], + + accessibility: { + description: 'Description goes here', + enabled: true, + exposeAsGroupOnly: true, + keyboardNavigation: { + enabled: true + }, + point: { + dateFormat: 'format string', + dateFormatter: function() { return true; }, + describeNull: false, + descriptionFormatter: function() { return true; }, + valueDecimals: 2, + valueDescriptionFormat: 'format string', + valuePrefix: '$', + valueSuffix: 'USD' + }, + }, + allowPointSelect: true, + animation: { + defer: 5 + }, + className: 'some-class-name', + clip: false, + color: '#fff', + cursor: 'alias', + custom: { + 'item1': 'some value', + 'item2': 'some value' + }, + dashStyle: 'Dash', + dataLabels: { + align: 'center', + allowOverlap: true, + animation: { + defer: 5 + }, + backgroundColor: { + linearGradient: { + x1: 0.123, + x2: 0.234, + y1: 0.345, + y2: 0.456 + }, + stops: [ + [0.12, '#999'], + [0.34, '#fff'] + ] + }, + borderColor: '#999999', + borderRadius: 24, + borderWidth: 1, + className: 'some-class-name', + color: '#000000', + crop: true, + defer: false, + enabled: true, + filter: { + operator: '>=', + property: 'some_property', + value: 123 + }, + format: 'some format', + formatter: function() { return true; }, + inside: true, + nullFormat: 'some format', + nullFormatter: function() { return true; }, + overflow: 'none', + padding: 12, + position: 'center', + rotation: 0, + shadow: false, + shape: 'rect', + style: 'style goes here', + useHTML: false, + verticalAlign: 'top', + x: 10, + y: 20, + z: 0 + }, + description: 'Description goes here', + enableMouseTracking: true, + events: { + afterAnimate: function(event) { return true; }, + click: function(event) { return true; }, + hide: function(event) { return true; }, + mouseOut: function(event) { return true; }, + show: function(event) { return true; } + }, + includeInDataExport: true, + keys: [ + 'somevalue', + 'somevalue', + 'somevalue' + ], + label: { + boxesToAvoid: [ + { + bottom: 12, + left: -46, + right: 84, + top: 24 + }, + { + bottom: 48, + left: -46, + right: 84, + top: 86 + } + ], + connectorAllowed: true, + connectorNeighbourDistance: 12, + enabled: true, + format: 'format string', + formatter: function() { return true; }, + maxFontSize: 18, + minFontSize: 6, + onArea: false, + style: 'some style string' + }, + linkedTo: 'some_id', + marker: { + enabled: true, + fillColor: '#cccccc', + height: 24, + lineWidth: 2, + radius: 2, + states: { + hover: { + enabled: true + } + }, + symbol: 'circle', + width: 48 + }, + onPoint: { + connectorOptions: { + dashstyle: 'Dash', + stroke: '#ccc', + width: 2 + }, + id: 'some-id', + position: { + align: 'left', + verticalAlign: 'top', + x: 15, + y: -46 + } + }, + opacity: 0.2, + point: { + events: { + click: function(event) { return true; }, + drag: function(event) { return true; }, + drop: function(event) { return true; }, + mouseOut: function(event) { return true; } + } + }, + pointDescriptionFormatter: function (point) { return true; }, + selected: false, + showCheckbox: true, + showInLegend: true, + skipKeyboardNavigation: false, + states: { + hover: { + animation: { + duration: 123 + }, + borderColor: '#cccccc', + brightness: 0.3, + enabled: true + }, + inactive: { + enabled: true, + opacity: 0.5 + }, + normal: { + animation: { + defer: 24 + } + }, + select: { + color: '#ff0000', + enabled: true + } + }, + stickyTracking: true, + threshold: 123, + tooltip: { + animation: true, + backgroundColor: '#ccc', + borderColor: '#999', + borderRadius: 4, + borderWidth: 1, + className: 'some-class-name', + clusterFormat: 'format string', + dateTimeLabelFormats: { + day: 'test', + hour: 'test', + millisecond: 'test', + minute: 'test', + month: 'test', + second: 'test', + week: 'test', + year: 'test' + }, + distance: 12, + enabled: true, + followPointer: true, + followTouchMove: true, + footerFormat: 'format string', + formatter: function() { return true; }, + headerFormat: 'format string', + headerShape: 'circle', + hideDelay: 3, + nullFormat: 'format string', + nullFormatter: function() { return true; }, + outside: false, + padding: 6, + pointFormat: 'format string', + pointFormatter: function() { return true; }, + positioner: function() { return true; }, + shadow: false, + shape: 'rect', + shared: false, + snap: 4, + split: false, + stickOnContact: true, + style: 'style string goes here', + useHTML: false, + valueDecimals: 2, + valuePrefix: '$', + valueSuffix: ' USD', + xDateFormat: 'format string' + }, + turboThreshold: 456, + visible: true +} diff --git a/tests/input_files/series/pictorial/01.js b/tests/input_files/series/pictorial/01.js new file mode 100644 index 0000000..c300767 --- /dev/null +++ b/tests/input_files/series/pictorial/01.js @@ -0,0 +1,14 @@ +{ + id: 'some-id-goes-here', + index: 3, + legendIndex: 3, + name: 'Series Name Goes Here', + grouping: false, + groupPadding: 6, + maxPointWidth: 12, + minPointLength: 12, + pointPadding: 6, + pointRange: 24, + pointWidth: 12, + type: 'pictorial' +} \ No newline at end of file diff --git a/tests/input_files/series/pictorial/error-01.js b/tests/input_files/series/pictorial/error-01.js new file mode 100644 index 0000000..377682d --- /dev/null +++ b/tests/input_files/series/pictorial/error-01.js @@ -0,0 +1,168 @@ +{ + data: [ + { + borderColor: '#ccc', + borderWidth: 2, + dashStyle: 'Solid', + pointWidth: 12 + }, + { + borderColor: '#ccc', + borderWidth: 2, + dashStyle: 'Solid', + pointWidth: 12, + + dataLabels: { + align: 'center', + allowOverlap: True, + animation: { + defer: 5 + }, + backgroundColor: { + linearGradient: { + x1: 0.123, + x2: 0.234, + y1: 0.345, + y2: 0.456 + }, + stops: [ + [0.12, '#999'], + [0.34, '#fff'] + ] + }, + borderColor: '#999999', + borderRadius: 24, + borderWidth: 1, + className: 'some-class-name', + color: '#000000', + crop: True, + defer: False, + enabled: True, + filter: { + operator: '>=', + property: 'some_property', + value: 123 + }, + format: 'some format', + formatter: """function() { return true; }""", + inside: True, + nullFormat: 'some format', + nullFormatter: """function() { return true; }""", + overflow: 'none', + padding: 12, + position: 'center', + rotation: 0, + shadow: False, + shape: 'rect', + style: 'style goes here', + useHTML: False, + verticalAlign: 'top', + x: 10, + y: 20, + z: 0 + }, + dragDrop: { + draggableX: True, + draggableY: True, + dragHandle: { + className: 'draghandle-classname-goes-here', + color: '#ccc', + cursor: 'alias', + lineColor: '#ddd', + lineWidth: 2, + pathFormatter: """function() { return true; }""", + zIndex: 10 + }, + dragMaxX: 3456, + dragMaxY: 6532, + dragMinX: 123, + dragMinY: 321, + dragPrecisionX: 5, + dragPrecisionY: 5, + dragSensitivity: 2, + groupBy: 'some-property-name', + guideBox: { + default: { + className: 'some-classname-goes-here', + color: '#999', + cursor: 'pointer', + lineColor: '#ccc', + lineWidth: 2, + zIndex: 100 + } + }, + liveRedraw: True + }, + drilldown: 'some-id-goes-here', + marker: { + enabled: True, + fillColor: '#cccccc', + height: 24, + lineWidth: 2, + radius: 2, + states: { + hover: { + enabled: True + } + }, + symbol: 'circle', + width: 48 + }, + x: 'some category', + y: 123 + } + ], + id: 'some-id-goes-here', + index: 'invalid value', + legendIndex: 3, + name: 'Series Name Goes Here', + stack: 'stack-id', + xAxis: 'some-id', + yAxis: 0, + zIndex: 3, + + borderColor: '#ccc', + borderRadius: 4, + borderWidth: 2, + centerInCategory: true, + colorByPoint: true, + colors: [ + '#fff', + '#ccc', + { + linearGradient: { + x1: 0.123, + x2: 0.567, + y1: 0.891, + y2: 0.987 + }, + stops: [ + [0.123, '#cccccc'], + [0.456, '#ff0000'], + [1, '#00ff00'] + ] + }, + { + animation: { + defer: 5 + }, + patternOptions: { + aspectRatio: 0.5, + backgroundColor: '#999999', + id: 'some_id_goes_here', + opacity: 0.5, + width: 120, + x: 5, + y: 10 + }, + patternIndex: 2 + } + ], + grouping: false, + groupPadding: 6, + maxPointWidth: 12, + minPointLength: 12, + pointPadding: 6, + pointRange: 24, + pointWidth: 12 +} diff --git a/tests/input_files/series/treegraph/01.js b/tests/input_files/series/treegraph/01.js new file mode 100644 index 0000000..3324324 --- /dev/null +++ b/tests/input_files/series/treegraph/01.js @@ -0,0 +1,129 @@ +{ + data: [ + { + colorValue: 2, + dataLabels: { + align: 'center', + allowOverlap: true, + animation: { + defer: 5 + }, + backgroundColor: { + linearGradient: { + x1: 0.123, + x2: 0.234, + y1: 0.345, + y2: 0.456 + }, + stops: [ + [0.12, '#999'], + [0.34, '#fff'] + ] + }, + borderColor: '#999999', + borderRadius: 24, + borderWidth: 1, + className: 'some-class-name', + color: '#000000', + crop: true, + defer: false, + enabled: true, + filter: { + operator: '>=', + property: 'some_property', + value: 123 + }, + format: 'some format', + formatter: function() { return true; }, + inside: true, + nullFormat: 'some format', + nullFormatter: function() { return true; }, + overflow: 'none', + padding: 12, + position: 'center', + rotation: 0, + shadow: false, + shape: 'rect', + style: 'style goes here', + useHTML: false, + verticalAlign: 'top', + x: 10, + y: 20, + z: 0 + }, + dragDrop: { + draggableX: true, + draggableY: true, + dragHandle: { + className: 'draghandle-classname-goes-here', + color: '#ccc', + cursor: 'alias', + lineColor: '#ddd', + lineWidth: 2, + pathFormatter: function() { return true; }, + zIndex: 10 + }, + dragMaxX: 3456, + dragMaxY: 6532, + dragMinX: 123, + dragMinY: 321, + dragPrecisionX: 5, + dragPrecisionY: 5, + dragSensitivity: 2, + groupBy: 'some-property-name', + guideBox: { + default: { + className: 'some-classname-goes-here', + color: '#999', + cursor: 'pointer', + lineColor: '#ccc', + lineWidth: 2, + zIndex: 100 + } + }, + liveRedraw: true + }, + drilldown: 'some-id-goes-here', + parent: 'some-id-goes-here', + + accessibility: { + description: 'Some description goes here', + enabled: true + }, + className: 'some-class-name', + color: '#ccc', + colorIndex: 2, + custom: { + 'some_key': 123, + 'other_key': 456 + }, + description: 'Some description goes here', + events: { + click: function(event) { return true; }, + drag: function(event) { return true; }, + drop: function(event) { return true; }, + mouseOut: function(event) { return true; } + }, + id: 'some-id-goes-here', + labelrank: 3, + name: 'Some Name Goes here', + selected: false + } + ], + pointInterval: 5, + pointIntervalUnit: 'day', + pointStart: 1, + stacking: 'normal', + animationLimit: 10, + boostBlending: 'some-value-goes-here', + boostThreshold: 5000, + colorIndex: 2, + crisp: true, + cropThreshold: 500, + findNearestPointBy: 'xy', + getExtremesFromAll: true, + relativeXValue: true, + softThreshold: true, + step: 'left', + type: 'treegraph' +} \ No newline at end of file diff --git a/tests/input_files/series/treegraph/02.js b/tests/input_files/series/treegraph/02.js new file mode 100644 index 0000000..2ed77e4 --- /dev/null +++ b/tests/input_files/series/treegraph/02.js @@ -0,0 +1,7 @@ +{ + data: [ + ['id1'], + ['id2', 'id1'] + ], + keys: ['id', 'parent'] +} diff --git a/tests/input_files/series/treegraph/error-00.js b/tests/input_files/series/treegraph/error-00.js new file mode 100644 index 0000000..ae670c0 --- /dev/null +++ b/tests/input_files/series/treegraph/error-00.js @@ -0,0 +1 @@ +not a valid JavaScript file diff --git a/tests/input_files/series/treegraph/error-01.js b/tests/input_files/series/treegraph/error-01.js new file mode 100644 index 0000000..3ae45b1 --- /dev/null +++ b/tests/input_files/series/treegraph/error-01.js @@ -0,0 +1,211 @@ +{ + data: [ + 'invalid value', + { + colorValue: 2, + dataLabels: { + align: 'center', + allowOverlap: true, + animation: { + defer: 5 + }, + backgroundColor: { + linearGradient: { + x1: 0.123, + x2: 0.234, + y1: 0.345, + y2: 0.456 + }, + stops: [ + [0.12, '#999'], + [0.34, '#fff'] + ] + }, + borderColor: '#999999', + borderRadius: 24, + borderWidth: 1, + className: 'some-class-name', + color: '#000000', + crop: true, + defer: false, + enabled: true, + filter: { + operator: '>=', + property: 'some_property', + value: 123 + }, + format: 'some format', + formatter: function() { return true; }, + inside: true, + nullFormat: 'some format', + nullFormatter: function() { return true; }, + overflow: 'none', + padding: 12, + position: 'center', + rotation: 0, + shadow: false, + shape: 'rect', + style: 'style goes here', + useHTML: false, + verticalAlign: 'top', + x: 10, + y: 20, + z: 0 + }, + dragDrop: { + draggableX: true, + draggableY: true, + dragHandle: { + className: 'draghandle-classname-goes-here', + color: '#ccc', + cursor: 'alias', + lineColor: '#ddd', + lineWidth: 2, + pathFormatter: function() { return true; }, + zIndex: 10 + }, + dragMaxX: 3456, + dragMaxY: 6532, + dragMinX: 123, + dragMinY: 321, + dragPrecisionX: 5, + dragPrecisionY: 5, + dragSensitivity: 2, + groupBy: 'some-property-name', + guideBox: { + default: { + className: 'some-classname-goes-here', + color: '#999', + cursor: 'pointer', + lineColor: '#ccc', + lineWidth: 2, + zIndex: 100 + } + }, + liveRedraw: true + }, + drilldown: 'some-id-goes-here', + parent: 'some-id-goes-here', + value: 123.45, + + accessibility: { + description: 'Some description goes here', + enabled: true + }, + className: 'some-class-name', + color: '#ccc', + colorIndex: 2, + custom: { + 'some_key': 123, + 'other_key': 456 + }, + description: 'Some description goes here', + events: { + click: function(event) { return true; }, + drag: function(event) { return true; }, + drop: function(event) { return true; }, + mouseOut: function(event) { return true; } + }, + id: 'some-id-goes-here', + labelrank: 3, + name: 'Some Name Goes here', + selected: false + } + ], + allowTraversingTree: true, + alternateStartingDirection: false, + animationLimit: 10, + boostBlending: 'some-value-goes-here', + boostThreshold: 'invalid value', + breadcrumbs: { + buttonSpacing: 6, + buttonTheme: { + 'fill': '#fff' + }, + events: { + click: function(event) { return true; } + }, + floating: true, + format: 'some format string', + formatter: function () { return true; }, + position: None, + relativeTo: 'plot', + rtl: false, + separator: { + style: { + 'some-key': 'some-value' + }, + text: '>' + }, + useHTML: false, + zIndex: 3 + }, + colorAxis: 'some-id-goes-here', + colorByPoint: true, + colorIndex: 2, + colorKey: 'some-key-goes-here', + colors: [ + '#ccc', + '#fff', + '000000' + ], + crisp: true, + cropThreshold: 500, + findNearestPointBy: 'xy', + getExtremesFromAll: true, + ignoreHiddenPoint: true, + interactByLeaf: true, + layoutAlgorithm: 'sliceAndDice', + layoutStartingDirection: 'vertical', + levelIsConstant: true, + levels: [ + { + borderDashStyle: 'Solid', + color: '#ccc', + colorVariation: { + key: 'brightness', + to: 50 + }, + layoutAlgorithm: 'sliceAndDice', + layoutStartingDirection: 'vertical', + borderColor: '#ccc', + borderWidth: 1, + level: 1, + } + ], + linecap: 'round', + lineWidth: 1, + negativeColor: '#ccc', + pointInterval: 5, + pointIntervalUnit: 'day', + pointStart: 1, + relativeXVvalue: true, + softThreshold: true, + sortIndex: 2, + stacking: 'normal', + step: 'left', + zoneAxis: 'y', + zones: [ + { + className: 'some-class-name1', + color: '#999999', + dashStyle: 'Solid', + fillColor: '#cccccc', + value: 123 + }, + { + className: 'some-class-name1', + color: '#999999', + dashStyle: 'Solid', + fillColor: '#cccccc', + value: 123 + }, + { + className: 'some-class-name1', + color: '#999999', + dashStyle: 'Solid', + fillColor: '#cccccc', + value: 123 + } + ] +} diff --git a/tests/input_files/series/treegraph/error-02.js b/tests/input_files/series/treegraph/error-02.js new file mode 100644 index 0000000..55685be --- /dev/null +++ b/tests/input_files/series/treegraph/error-02.js @@ -0,0 +1,449 @@ +{ + data: [ + 'invalid value', + { + colorValue: 2, + dataLabels: { + align: 'center', + allowOverlap: true, + animation: { + defer: 5 + }, + backgroundColor: { + linearGradient: { + x1: 0.123, + x2: 0.234, + y1: 0.345, + y2: 0.456 + }, + stops: [ + [0.12, '#999'], + [0.34, '#fff'] + ] + }, + borderColor: '#999999', + borderRadius: 24, + borderWidth: 1, + className: 'some-class-name', + color: '#000000', + crop: true, + defer: false, + enabled: true, + filter: { + operator: '>=', + property: 'some_property', + value: 123 + }, + format: 'some format', + formatter: function() { return true; }, + inside: true, + nullFormat: 'some format', + nullFormatter: function() { return true; }, + overflow: 'none', + padding: 12, + position: 'center', + rotation: 0, + shadow: false, + shape: 'rect', + style: 'style goes here', + useHTML: false, + verticalAlign: 'top', + x: 10, + y: 20, + z: 0 + }, + dragDrop: { + draggableX: true, + draggableY: true, + dragHandle: { + className: 'draghandle-classname-goes-here', + color: '#ccc', + cursor: 'alias', + lineColor: '#ddd', + lineWidth: 2, + pathFormatter: function() { return true; }, + zIndex: 10 + }, + dragMaxX: 3456, + dragMaxY: 6532, + dragMinX: 123, + dragMinY: 321, + dragPrecisionX: 5, + dragPrecisionY: 5, + dragSensitivity: 2, + groupBy: 'some-property-name', + guideBox: { + default: { + className: 'some-classname-goes-here', + color: '#999', + cursor: 'pointer', + lineColor: '#ccc', + lineWidth: 2, + zIndex: 100 + } + }, + liveRedraw: true + }, + drilldown: 'some-id-goes-here', + parent: 'some-id-goes-here', + value: 123.45, + + accessibility: { + description: 'Some description goes here', + enabled: true + }, + className: 'some-class-name', + color: '#ccc', + colorIndex: 2, + custom: { + 'some_key': 123, + 'other_key': 456 + }, + description: 'Some description goes here', + events: { + click: function(event) { return true; }, + drag: function(event) { return true; }, + drop: function(event) { return true; }, + mouseOut: function(event) { return true; } + }, + id: 'some-id-goes-here', + labelrank: 3, + name: 'Some Name Goes here', + selected: false + } + ], + allowTraversingTree: true, + alternateStartingDirection: false, + animationLimit: 10, + boostBlending: 'some-value-goes-here', + boostThreshold: 'invalid value', + breadcrumbs: { + buttonSpacing: 6, + buttonTheme: { + 'fill': '#fff' + }, + events: { + click: function(event) { return true; } + }, + floating: true, + format: 'some format string', + formatter: function () { return true; }, + position: None, + relativeTo: 'plot', + rtl: false, + separator: { + style: { + 'some-key': 'some-value' + }, + text: '>' + }, + useHTML: false, + zIndex: 3 + }, + colorAxis: 'some-id-goes-here', + colorByPoint: true, + colorIndex: 2, + colorKey: 'some-key-goes-here', + colors: [ + '#ccc', + '#fff', + '000000' + ], + crisp: true, + cropThreshold: 500, + findNearestPointBy: 'xy', + getExtremesFromAll: true, + ignoreHiddenPoint: true, + interactByLeaf: true, + layoutAlgorithm: 'sliceAndDice', + layoutStartingDirection: 'vertical', + levelIsConstant: true, + levels: [ + { + borderDashStyle: 'Solid', + color: '#ccc', + colorVariation: { + key: 'brightness', + to: 50 + }, + layoutAlgorithm: 'sliceAndDice', + layoutStartingDirection: 'vertical', + borderColor: '#ccc', + borderWidth: 1, + level: 1, + } + ], + linecap: 'round', + lineWidth: 1, + negativeColor: '#ccc', + pointInterval: 5, + pointIntervalUnit: 'day', + pointStart: 1, + relativeXVvalue: true, + softThreshold: true, + sortIndex: 2, + stacking: 'normal', + step: 'left', + zoneAxis: 'y', + zones: [ + { + className: 'some-class-name1', + color: '#999999', + dashStyle: 'Solid', + fillColor: '#cccccc', + value: 123 + }, + { + className: 'some-class-name1', + color: '#999999', + dashStyle: 'Solid', + fillColor: '#cccccc', + value: 123 + }, + { + className: 'some-class-name1', + color: '#999999', + dashStyle: 'Solid', + fillColor: '#cccccc', + value: 123 + } + ], + + accessibility: { + description: 'Description goes here', + enabled: true, + exposeAsGroupOnly: true, + keyboardNavigation: { + enabled: true + }, + point: { + dateFormat: 'format string', + dateFormatter: function() { return true; }, + describeNull: false, + descriptionFormatter: function() { return true; }, + valueDecimals: 2, + valueDescriptionFormat: 'format string', + valuePrefix: '$', + valueSuffix: 'USD' + }, + }, + allowPointSelect: true, + animation: { + defer: 5 + }, + className: 'some-class-name', + clip: false, + color: '#fff', + cursor: 'alias', + custom: { + 'item1': 'some value', + 'item2': 'some value' + }, + dashStyle: 'Dash', + dataLabels: { + align: 'center', + allowOverlap: true, + animation: { + defer: 5 + }, + backgroundColor: { + linearGradient: { + x1: 0.123, + x2: 0.234, + y1: 0.345, + y2: 0.456 + }, + stops: [ + [0.12, '#999'], + [0.34, '#fff'] + ] + }, + borderColor: '#999999', + borderRadius: 24, + borderWidth: 1, + className: 'some-class-name', + color: '#000000', + crop: true, + defer: false, + enabled: true, + filter: { + operator: '>=', + property: 'some_property', + value: 123 + }, + format: 'some format', + formatter: function() { return true; }, + inside: true, + nullFormat: 'some format', + nullFormatter: function() { return true; }, + overflow: 'none', + padding: 12, + position: 'center', + rotation: 0, + shadow: false, + shape: 'rect', + style: 'style goes here', + useHTML: false, + verticalAlign: 'top', + x: 10, + y: 20, + z: 0 + }, + description: 'Description goes here', + enableMouseTracking: true, + events: { + afterAnimate: function(event) { return true; }, + click: function(event) { return true; }, + hide: function(event) { return true; }, + mouseOut: function(event) { return true; }, + show: function(event) { return true; } + }, + includeInDataExport: true, + keys: [ + 'somevalue', + 'somevalue', + 'somevalue' + ], + label: { + boxesToAvoid: [ + { + bottom: 12, + left: -46, + right: 84, + top: 24 + }, + { + bottom: 48, + left: -46, + right: 84, + top: 86 + } + ], + connectorAllowed: true, + connectorNeighbourDistance: 12, + enabled: true, + format: 'format string', + formatter: function() { return true; }, + maxFontSize: 18, + minFontSize: 6, + onArea: false, + style: 'some style string' + }, + linkedTo: 'some_id', + marker: { + enabled: true, + fillColor: '#cccccc', + height: 24, + lineWidth: 2, + radius: 2, + states: { + hover: { + enabled: true + } + }, + symbol: 'circle', + width: 48 + }, + onPoint: { + connectorOptions: { + dashstyle: 'Dash', + stroke: '#ccc', + width: 2 + }, + id: 'some-id', + position: { + align: 'left', + verticalAlign: 'top', + x: 15, + y: -46 + } + }, + opacity: 0.2, + point: { + events: { + click: function(event) { return true; }, + drag: function(event) { return true; }, + drop: function(event) { return true; }, + mouseOut: function(event) { return true; } + } + }, + pointDescriptionFormatter: function (point) { return true; }, + selected: false, + showCheckbox: true, + showInLegend: true, + skipKeyboardNavigation: false, + states: { + hover: { + animation: { + duration: 123 + }, + borderColor: '#cccccc', + brightness: 0.3, + enabled: true + }, + inactive: { + enabled: true, + opacity: 0.5 + }, + normal: { + animation: { + defer: 24 + } + }, + select: { + color: '#ff0000', + enabled: true + } + }, + stickyTracking: true, + threshold: 123, + tooltip: { + animation: true, + backgroundColor: '#ccc', + borderColor: '#999', + borderRadius: 4, + borderWidth: 1, + className: 'some-class-name', + clusterFormat: 'format string', + dateTimeLabelFormats: { + day: 'test', + hour: 'test', + millisecond: 'test', + minute: 'test', + month: 'test', + second: 'test', + week: 'test', + year: 'test' + }, + distance: 12, + enabled: true, + followPointer: true, + followTouchMove: true, + footerFormat: 'format string', + formatter: function() { return true; }, + headerFormat: 'format string', + headerShape: 'circle', + hideDelay: 3, + nullFormat: 'format string', + nullFormatter: function() { return true; }, + outside: false, + padding: 6, + pointFormat: 'format string', + pointFormatter: function() { return true; }, + positioner: function() { return true; }, + shadow: false, + shape: 'rect', + shared: false, + snap: 4, + split: false, + stickOnContact: true, + style: 'style string goes here', + useHTML: false, + valueDecimals: 2, + valuePrefix: '$', + valueSuffix: ' USD', + xDateFormat: 'format string' + }, + turboThreshold: 456, + visible: true +} diff --git a/tests/input_files/sonification/sonification/01.js b/tests/input_files/sonification/sonification/01.js new file mode 100644 index 0000000..dd6ecd2 --- /dev/null +++ b/tests/input_files/sonification/sonification/01.js @@ -0,0 +1,458 @@ +{ + afterSeriesWait: 300, + defaultInstrumentOptions: { + instrument: 'piano', + midiName: 'some-value', + roundToMusicalNotes: true, + activeWhen: { + crossingDown: 2, + crossingUp: 3, + max: 5, + min: 1, + prop: 'y' + }, + mapping: { + frequency: 3, + gapBetweenNotes: 5, + highpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + lowpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + noteDuration: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pan: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pitch: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + playDelay: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + time: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + tremolo: { + depth: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + speed: 0.5 + }, + volume: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + showPlayMarker: true, + type: 'instrument' + }, + defaultSpeechOptions: { + language: 'en-US', + activeWhen: { + crossingDown: 2, + crossingUp: 3, + max: 5, + min: 1, + prop: 'y' + }, + mapping: { + frequency: 3, + gapBetweenNotes: 5, + highpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + lowpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + noteDuration: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pan: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pitch: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + playDelay: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + time: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + tremolo: { + depth: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + speed: 0.5 + }, + volume: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + showPlayMarker: true, + type: 'speech' + }, + duration: 6000, + enabled: true, + events: { + afterUpdate: function() { return true; }, + beforePlay: function() { return true; }, + beforeUpdate: function() { return true; }, + onBoundaryHit: function() { return true; }, + onEnd: function() { return true; }, + onPlay: function() { return true; }, + onSeriesEnd: function() { return true; }, + onSeriesStart: function() { return true; }, + onStop: function() { return true; } + }, + globalContextTracks: { + valueInterval: 5, + valueMapFunction: 'linear', + valueProp: 'y', + midiName: 'some-value', + activeWhen: { + crossingDown: 2, + crossingUp: 3, + max: 5, + min: 1, + prop: 'y' + }, + mapping: { + frequency: 3, + gapBetweenNotes: 5, + highpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + lowpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + noteDuration: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pan: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pitch: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + playDelay: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + time: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + tremolo: { + depth: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + speed: 0.5 + }, + volume: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + showPlayMarker: true, + type: 'instrument' + }, + globalTracks: { + instrument: 'piano', + midiName: 'some-value', + roundToMusicalNotes: true, + activeWhen: { + crossingDown: 2, + crossingUp: 3, + max: 5, + min: 1, + prop: 'y' + }, + mapping: { + frequency: 3, + gapBetweenNotes: 5, + highpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + lowpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + noteDuration: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pan: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pitch: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + playDelay: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + time: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + tremolo: { + depth: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + speed: 0.5 + }, + volume: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + showPlayMarker: true, + type: 'instrument' + }, + masterVolume: 0.5, + order: 'sequential', + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + showCrosshair: true, + showTooltip: true, + updateInterval: 200 +} \ No newline at end of file diff --git a/tests/input_files/sonification/sonification/error-01.js b/tests/input_files/sonification/sonification/error-01.js new file mode 100644 index 0000000..e6466e2 --- /dev/null +++ b/tests/input_files/sonification/sonification/error-01.js @@ -0,0 +1,447 @@ +{ + afterSeriesWait: 'invalid-value', + defaultInstrumentOptions: { + activeWhen: { + crossingDown: 2, + crossingUp: 3, + max: 5, + min: 1, + prop: 'y' + }, + instrument: 'piano', + mapping: { + frequency: 3, + gapBetweenNotes: 5, + highpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + lowpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + noteDuration: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pan: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pitch: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + playDelay: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + time: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + tremolo: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + volume: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + midiName: 'some-value', + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + roundToMusicalNotes: true, + showPlayMarker: true, + type: 'instrument' + }, + defaultSpeechOptions: { + activeWhen: { + crossingDown: 2, + crossingUp: 3, + max: 5, + min: 1, + prop: 'y' + }, + language: 'en-US', + mapping: { + frequency: 3, + gapBetweenNotes: 5, + highpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + lowpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + noteDuration: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pan: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pitch: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + playDelay: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + time: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + tremolo: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + volume: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + midiName: 'some-value', + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + showPlayMarker: true, + type: 'speech' + }, + duration: 6000, + enabled: true, + events: { + afterUpdate: function() { return true; }, + beforePlay: function() { return true; }, + beforeUpdate: function() { return true; }, + onBoundaryHit: function() { return true; }, + onEnd: function() { return true; }, + onPlay: function() { return true; }, + onSeriesEnd: function() { return true; }, + onSeriesStart: function() { return true; }, + onStop: function() { return true; } + }, + globalContextTracks: { + activeWhen: { + crossingDown: 2, + crossingUp: 3, + max: 5, + min: 1, + prop: 'y' + }, + mapping: { + frequency: 3, + gapBetweenNotes: 5, + highpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + lowpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + noteDuration: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pan: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pitch: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + playDelay: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + time: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + tremolo: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + volume: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + midiName: 'some-value', + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + showPlayMarker: true, + type: 'instrument', + value_interval: 5, + valueMapFunction: 'linear', + valueProp: 'y' + }, + globalTracks: { + activeWhen: { + crossingDown: 2, + crossingUp: 3, + max: 5, + min: 1, + prop: 'y' + }, + instrument: 'piano', + mapping: { + frequency: 3, + gapBetweenNotes: 5, + highpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + lowpass: { + frequency: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + resonance: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + noteDuration: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pan: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + pitch: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + playDelay: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + time: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + tremolo: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + }, + volume: { + mapFunction: 'linear', + mapTo: 'y', + max: 12345, + min: 0, + within: 'series' + } + }, + midiName: 'some-value', + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + roundToMusicalNotes: true, + showPlayMarker: true, + type: 'instrument' + }, + masterVolume: 0.5, + order: 'sequential', + pointGrouping: { + algorithm: 'minmax', + enabled: true, + groupTimespan: 15, + prop: 'y' + }, + showCrosshair: true, + showTooltip: true, + updateInterval: 200 +} \ No newline at end of file diff --git a/tests/options/plot_options/test_pictorial.py b/tests/options/plot_options/test_pictorial.py new file mode 100644 index 0000000..be4e6f6 --- /dev/null +++ b/tests/options/plot_options/test_pictorial.py @@ -0,0 +1,97 @@ +"""Tests for ``highcharts.no_data``.""" + +import pytest + +from json.decoder import JSONDecodeError + +from highcharts_gantt.options.plot_options.pictorial import PictorialOptions as cls +from highcharts_gantt import errors +from tests.fixtures import input_files, check_input_file, to_camelCase, to_js_dict, \ + Class__init__, Class__to_untrimmed_dict, Class_from_dict, Class_to_dict, \ + Class_from_js_literal + +STANDARD_PARAMS = [ + ({}, None), + ({ + 'depth': 10, + 'edge_color': '#999', + 'edge_width': 1, + 'group_z_padding': 4 + }, None), + # + Base Bar Options + ({ + 'depth': 10, + 'edge_color': '#999', + 'edge_width': 1, + 'group_z_padding': 4, + 'grouping': False, + 'group_padding': 6, + 'max_point_width': 12, + 'min_point_length': 12, + 'point_padding': 6, + 'point_range': 24, + 'point_width': 12 + }, None), +] + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test_PictorialOptions__init__(kwargs, error): + Class__init__(cls, kwargs, error) + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test_PictorialOptions__to_untrimmed_dict(kwargs, error): + Class__to_untrimmed_dict(cls, kwargs, error) + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test_PictorialOptions_from_dict(kwargs, error): + Class_from_dict(cls, kwargs, error) + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test_PictorialOptions_to_dict(kwargs, error): + Class_to_dict(cls, kwargs, error) + + +@pytest.mark.parametrize('filename, as_file, error', [ + ('plot_options/pictorial/03.js', False, None), + ('plot_options/pictorial/04.js', False, None), + + ('plot_options/pictorial/error-01.js', + False, + (errors.HighchartsValueError, + errors.HighchartsParseError, + JSONDecodeError, + TypeError, + ValueError)), + ('plot_options/pictorial/error-02.js', + False, + (errors.HighchartsValueError, + errors.HighchartsParseError, + JSONDecodeError, + TypeError, + ValueError)), + + ('plot_options/pictorial/03.js', True, None), + ('plot_options/pictorial/04.js', True, None), + + ('plot_options/pictorial/error-01.js', + True, + (errors.HighchartsValueError, + errors.HighchartsParseError, + JSONDecodeError, + TypeError, + ValueError)), + ('plot_options/pictorial/error-02.js', + True, + (errors.HighchartsValueError, + errors.HighchartsParseError, + JSONDecodeError, + TypeError, + ValueError)), + +]) +def test_PictorialOptions_from_js_literal(input_files, filename, as_file, error): + Class_from_js_literal(cls, input_files, filename, as_file, error) diff --git a/tests/options/plot_options/test_sonification.py b/tests/options/plot_options/test_sonification.py new file mode 100644 index 0000000..12686db --- /dev/null +++ b/tests/options/plot_options/test_sonification.py @@ -0,0 +1,56 @@ +"""Tests for ``highcharts.responsive``.""" + +import pytest + +from json.decoder import JSONDecodeError + +from highcharts_gantt.options.plot_options.sonification import SeriesSonification as cls +from highcharts_core import errors +from tests.fixtures import input_files, check_input_file, to_camelCase, to_js_dict, \ + Class__init__, Class__to_untrimmed_dict, Class_from_dict, Class_to_dict, \ + Class_from_js_literal + +STANDARD_PARAMS = [ + ({}, None), +] + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test__init__(kwargs, error): + Class__init__(cls, kwargs, error) + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test__to_untrimmed_dict(kwargs, error): + Class__to_untrimmed_dict(cls, kwargs, error) + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test_from_dict(kwargs, error): + Class_from_dict(cls, kwargs, error) + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test_to_dict(kwargs, error): + Class_to_dict(cls, kwargs, error) + + +@pytest.mark.parametrize('filename, as_file, error', [ + ('plot_options/sonification/01.js', False, None), + ('plot_options/sonification/02.js', False, None), + + ('plot_options/sonification/error-01.js', False, (errors.HighchartsValueError, + errors.HighchartsParseError, + JSONDecodeError, + TypeError)), + + ('plot_options/sonification/01.js', True, None), + ('plot_options/sonification/02.js', True, None), + + ('plot_options/sonification/error-01.js', True, (errors.HighchartsValueError, + errors.HighchartsParseError, + JSONDecodeError, + TypeError)), +]) +def test_from_js_literal(input_files, filename, as_file, error): + Class_from_js_literal(cls, input_files, filename, as_file, error) diff --git a/tests/options/plot_options/test_treegraph.py b/tests/options/plot_options/test_treegraph.py new file mode 100644 index 0000000..9936214 --- /dev/null +++ b/tests/options/plot_options/test_treegraph.py @@ -0,0 +1,354 @@ +"""Tests for ``highcharts.no_data``.""" + +import pytest + +from json.decoder import JSONDecodeError + +from highcharts_gantt.options.plot_options.treegraph import TreegraphOptions as cls +from highcharts_stock import errors +from tests.fixtures import input_files, check_input_file, to_camelCase, to_js_dict, \ + Class__init__, Class__to_untrimmed_dict, Class_from_dict, Class_to_dict, \ + Class_from_js_literal + +STANDARD_PARAMS = [ + ({}, None), + ({ + 'allow_traversing_tree': True, + 'animation_limit': 10, + 'boost_blending': 'some-value-goes-here', + 'boost_threshold': 5000, + 'color_by_point': True, + 'color_index': 2, + 'crisp': True, + 'crop_threshold': 500, + 'find_nearest_point_by': 'xy', + 'get_extremes_from_all': True, + 'point_interval': 5, + 'point_interval_unit': 'day', + 'point_start': 1, + 'relative_x_value': True, + 'soft_threshold': True, + 'stacking': 'normal', + 'step': 'left', + }, None), + # + Generic Options + ({ + 'allow_traversing_tree': True, + 'animation_limit': 10, + 'boost_blending': 'some-value-goes-here', + 'boost_threshold': 5000, + 'color_by_point': True, + 'color_index': 2, + 'crisp': True, + 'crop_threshold': 500, + 'find_nearest_point_by': 'xy', + 'get_extremes_from_all': True, + 'point_interval': 5, + 'point_interval_unit': 'day', + 'point_start': 1, + 'relative_x_value': True, + 'soft_threshold': True, + 'stacking': 'normal', + 'step': 'left', + + 'accessibility': { + 'description': 'Description goes here', + 'enabled': True, + 'exposeAsGroupOnly': True, + 'keyboardNavigation': { + 'enabled': True + }, + 'point': { + 'dateFormat': 'format string', + 'dateFormatter': """function() { return true; }""", + 'describeNull': False, + 'descriptionFormatter': """function() { return true; }""", + 'valueDecimals': 2, + 'valueDescriptionFormat': 'format string', + 'valuePrefix': '$', + 'valueSuffix': 'USD' + }, + }, + 'allow_point_select': True, + 'animation': { + 'defer': 5 + }, + 'class_name': 'some-class-name', + 'clip': False, + 'color': '#fff', + 'cursor': 'alias', + 'custom': { + 'item1': 'some value', + 'item2': 'some value' + }, + 'dash_style': 'Dash', + 'data_labels': { + 'align': 'center', + 'allowOverlap': True, + 'animation': { + 'defer': 5 + }, + 'backgroundColor': { + 'linearGradient': { + 'x1': 0.123, + 'x2': 0.234, + 'y1': 0.345, + 'y2': 0.456 + }, + 'stops': [ + [0.12, '#999'], + [0.34, '#fff'] + ] + }, + 'borderColor': '#999999', + 'borderRadius': 24, + 'borderWidth': 1, + 'className': 'some-class-name', + 'color': '#000000', + 'crop': True, + 'defer': False, + 'enabled': True, + 'filter': { + 'operator': '>=', + 'property': 'some_property', + 'value': 123 + }, + 'format': 'some format', + 'formatter': """function() { return true; }""", + 'inside': True, + 'nullFormat': 'some format', + 'nullFormatter': """function() { return true; }""", + 'overflow': 'none', + 'padding': 12, + 'position': 'center', + 'rotation': 0, + 'shadow': False, + 'shape': 'rect', + 'style': 'style goes here', + 'useHTML': False, + 'verticalAlign': 'top', + 'x': 10, + 'y': 20, + 'z': 0 + }, + 'description': 'Description goes here', + 'enable_mouse_tracking': True, + 'events': { + 'afterAnimate': """function(event) { return true; }""", + 'click': """function(event) { return true; }""", + 'hide': """function(event) { return true; }""", + 'mouseOut': """function(event) { return true; }""", + 'show': """function(event) { return true; }""" + }, + 'include_in_data_export': True, + 'keys': [ + 'somevalue', + 'somevalue', + 'somevalue' + ], + 'label': { + 'boxesToAvoid': [ + { + 'bottom': 12, + 'left': -46, + 'right': 84, + 'top': 24 + }, + { + 'bottom': 48, + 'left': -46, + 'right': 84, + 'top': 86 + } + ], + 'connectorAllowed': True, + 'connectorNeighbourDistance': 12, + 'enabled': True, + 'format': 'format string', + 'formatter': """function() { return true; }""", + 'maxFontSize': 18, + 'minFontSize': 6, + 'onArea': False, + 'style': 'some style string' + }, + 'linked_to': 'some_id', + 'marker': { + 'enabled': True, + 'fillColor': '#cccccc', + 'height': 24, + 'lineWidth': 2, + 'radius': 2, + 'states': { + 'hover': { + 'enabled': True + } + }, + 'symbol': 'circle', + 'width': 48 + }, + 'on_point': { + 'connectorOptions': { + 'dashstyle': 'Dash', + 'stroke': '#ccc', + 'width': 2 + }, + 'id': 'some-id', + 'position': { + 'align': 'left', + 'verticalAlign': 'top', + 'x': 15, + 'y': -46 + } + }, + 'opacity': 0.2, + 'point': { + 'events': { + 'click': """function(event) { return true; }""", + 'drag': """function(event) { return true; }""", + 'drop': """function(event) { return true; }""", + 'mouseOut': """function(event) { return true; }""" + } + }, + 'point_description_formatter': """function (point) { return true; }""", + 'selected': False, + 'show_checkbox': True, + 'show_in_legend': True, + 'skip_keyboard_navigation': False, + 'states': { + 'hover': { + 'animation': { + 'duration': 123 + }, + 'borderColor': '#cccccc', + 'brightness': 0.3, + 'enabled': True + }, + 'inactive': { + 'enabled': True, + 'opacity': 0.5 + }, + 'normal': { + 'animation': { + 'defer': 24 + } + }, + 'select': { + 'color': '#ff0000', + 'enabled': True, + } + }, + 'sticky_tracking': True, + 'tooltip': { + 'animation': True, + 'backgroundColor': '#ccc', + 'borderColor': '#999', + 'borderRadius': 4, + 'borderWidth': 1, + 'className': 'some-class-name', + 'clusterFormat': 'format string', + 'dateTimeLabelFormats': { + 'day': 'test', + 'hour': 'test', + 'millisecond': 'test', + 'minute': 'test', + 'month': 'test', + 'second': 'test', + 'week': 'test', + 'year': 'test' + }, + 'distance': 12, + 'enabled': True, + 'followPointer': True, + 'followTouch_move': True, + 'footerFormat': 'format string', + 'formatter': """function() { return true; }""", + 'headerFormat': 'format string', + 'headerShape': 'circle', + 'hideDelay': 3, + 'nullFormat': 'format string', + 'nullFormatter': """function() { return true; }""", + 'outside': False, + 'padding': 6, + 'pointFormat': 'format string', + 'pointFormatter': """function() { return true; }""", + 'positioner': """function() { return true; }""", + 'shadow': False, + 'shape': 'rect', + 'shared': False, + 'snap': 4, + 'split': False, + 'stickOnContact': True, + 'style': 'style string goes here', + 'useHTML': False, + 'valueDecimals': 2, + 'valuePrefix': '$', + 'valueSuffix': ' USD', + 'xDateFormat': 'format string' + }, + 'turbo_threshold': 456, + 'visible': True + }, None), + +] + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test__init__(kwargs, error): + Class__init__(cls, kwargs, error) + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test__to_untrimmed_dict(kwargs, error): + Class__to_untrimmed_dict(cls, kwargs, error) + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test_from_dict(kwargs, error): + Class_from_dict(cls, kwargs, error) + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test_to_dict(kwargs, error): + Class_to_dict(cls, kwargs, error) + + +@pytest.mark.parametrize('filename, as_file, error', [ + ('plot_options/treegraph/01.js', False, None), + ('plot_options/treegraph/02.js', False, None), + + ('plot_options/treegraph/error-01.js', + False, + (errors.HighchartsValueError, + errors.HighchartsParseError, + JSONDecodeError, + TypeError, + ValueError)), + ('plot_options/treegraph/error-02.js', + False, + (errors.HighchartsValueError, + errors.HighchartsParseError, + JSONDecodeError, + TypeError, + ValueError)), + + ('plot_options/treegraph/01.js', True, None), + ('plot_options/treegraph/02.js', True, None), + + ('plot_options/treegraph/error-01.js', + True, + (errors.HighchartsValueError, + errors.HighchartsParseError, + JSONDecodeError, + TypeError, + ValueError)), + ('plot_options/treegraph/error-02.js', + True, + (errors.HighchartsValueError, + errors.HighchartsParseError, + JSONDecodeError, + TypeError, + ValueError)), + +]) +def test_from_js_literal(input_files, filename, as_file, error): + Class_from_js_literal(cls, input_files, filename, as_file, error) diff --git a/tests/options/series/test_pictorial.py b/tests/options/series/test_pictorial.py new file mode 100644 index 0000000..7b1301a --- /dev/null +++ b/tests/options/series/test_pictorial.py @@ -0,0 +1,682 @@ +"""Tests for ``highcharts.no_data``.""" + +import pytest +import datetime + +from json.decoder import JSONDecodeError + +from highcharts_gantt.options.series.pictorial import PictorialSeries as cls +from highcharts_core import errors +from tests.fixtures import input_files, check_input_file, to_camelCase, to_js_dict, \ + Class__init__, Class__to_untrimmed_dict, Class_from_dict, Class_to_dict, \ + Class_from_js_literal + +STANDARD_PARAMS = [ + ({}, None), + ({ + 'data': [ + { + 'dataLabels': { + 'align': 'center', + 'allowOverlap': True, + 'animation': { + 'defer': 5 + }, + 'backgroundColor': { + 'linearGradient': { + 'x1': 0.123, + 'x2': 0.234, + 'y1': 0.345, + 'y2': 0.456 + }, + 'stops': [ + [0.12, '#999'], + [0.34, '#fff'] + ] + }, + 'borderColor': '#999999', + 'borderRadius': 24, + 'borderWidth': 1, + 'className': 'some-class-name', + 'color': '#000000', + 'crop': True, + 'defer': False, + 'enabled': True, + 'filter': { + 'operator': '>=', + 'property': 'some_property', + 'value': 123 + }, + 'format': 'some format', + 'formatter': """function() { return true; }""", + 'inside': True, + 'nullFormat': 'some format', + 'nullFormatter': """function() { return true; }""", + 'overflow': 'none', + 'padding': 12, + 'position': 'center', + 'rotation': 0, + 'shadow': False, + 'shape': 'rect', + 'style': 'style goes here', + 'useHTML': False, + 'verticalAlign': 'top', + 'x': 10, + 'y': 20, + 'z': 0 + }, + 'dragDrop': { + 'draggableX': True, + 'draggableY': True, + 'dragHandle': { + 'className': 'draghandle-classname-goes-here', + 'color': '#ccc', + 'cursor': 'alias', + 'lineColor': '#ddd', + 'lineWidth': 2, + 'pathFormatter': """function() { return true; }""", + 'zIndex': 10 + }, + 'dragMaxX': 3456, + 'dragMaxY': 6532, + 'dragMinX': 123, + 'dragMinY': 321, + 'dragPrecisionX': 5, + 'dragPrecisionY': 5, + 'dragSensitivity': 2, + 'groupBy': 'some-property-name', + 'guideBox': { + 'default': { + 'className': 'some-classname-goes-here', + 'color': '#999', + 'cursor': 'pointer', + 'lineColor': '#ccc', + 'lineWidth': 2, + 'zIndex': 100 + } + }, + 'liveRedraw': True + }, + 'drilldown': 'some-id-goes-here', + 'marker': { + 'enabled': True, + 'fillColor': '#cccccc', + 'height': 24, + 'lineWidth': 2, + 'radius': 2, + 'states': { + 'hover': { + 'enabled': True + } + }, + 'symbol': 'circle', + 'width': 48 + }, + 'x': 'some category', + 'y': 123 + }, + { + 'dataLabels': { + 'align': 'center', + 'allowOverlap': True, + 'animation': { + 'defer': 5 + }, + 'backgroundColor': { + 'linearGradient': { + 'x1': 0.123, + 'x2': 0.234, + 'y1': 0.345, + 'y2': 0.456 + }, + 'stops': [ + [0.12, '#999'], + [0.34, '#fff'] + ] + }, + 'borderColor': '#999999', + 'borderRadius': 24, + 'borderWidth': 1, + 'className': 'some-class-name', + 'color': '#000000', + 'crop': True, + 'defer': False, + 'enabled': True, + 'filter': { + 'operator': '>=', + 'property': 'some_property', + 'value': 123 + }, + 'format': 'some format', + 'formatter': """function() { return true; }""", + 'inside': True, + 'nullFormat': 'some format', + 'nullFormatter': """function() { return true; }""", + 'overflow': 'none', + 'padding': 12, + 'position': 'center', + 'rotation': 0, + 'shadow': False, + 'shape': 'rect', + 'style': 'style goes here', + 'useHTML': False, + 'verticalAlign': 'top', + 'x': 10, + 'y': 20, + 'z': 0 + }, + 'dragDrop': { + 'draggableX': True, + 'draggableY': True, + 'dragHandle': { + 'className': 'draghandle-classname-goes-here', + 'color': '#ccc', + 'cursor': 'alias', + 'lineColor': '#ddd', + 'lineWidth': 2, + 'pathFormatter': """function() { return true; }""", + 'zIndex': 10 + }, + 'dragMaxX': 3456, + 'dragMaxY': 6532, + 'dragMinX': 123, + 'dragMinY': 321, + 'dragPrecisionX': 5, + 'dragPrecisionY': 5, + 'dragSensitivity': 2, + 'groupBy': 'some-property-name', + 'guideBox': { + 'default': { + 'className': 'some-classname-goes-here', + 'color': '#999', + 'cursor': 'pointer', + 'lineColor': '#ccc', + 'lineWidth': 2, + 'zIndex': 100 + } + }, + 'liveRedraw': True + }, + 'drilldown': 'some-id-goes-here', + 'marker': { + 'enabled': True, + 'fillColor': '#cccccc', + 'height': 24, + 'lineWidth': 2, + 'radius': 2, + 'states': { + 'hover': { + 'enabled': True + } + }, + 'symbol': 'circle', + 'width': 48 + }, + 'x': datetime.datetime(2022, 7, 26, 0, 4, 0), + 'y': 123 + }, + { + 'dataLabels': { + 'align': 'center', + 'allowOverlap': True, + 'animation': { + 'defer': 5 + }, + 'backgroundColor': { + 'linearGradient': { + 'x1': 0.123, + 'x2': 0.234, + 'y1': 0.345, + 'y2': 0.456 + }, + 'stops': [ + [0.12, '#999'], + [0.34, '#fff'] + ] + }, + 'borderColor': '#999999', + 'borderRadius': 24, + 'borderWidth': 1, + 'className': 'some-class-name', + 'color': '#000000', + 'crop': True, + 'defer': False, + 'enabled': True, + 'filter': { + 'operator': '>=', + 'property': 'some_property', + 'value': 123 + }, + 'format': 'some format', + 'formatter': """function() { return true; }""", + 'inside': True, + 'nullFormat': 'some format', + 'nullFormatter': """function() { return true; }""", + 'overflow': 'none', + 'padding': 12, + 'position': 'center', + 'rotation': 0, + 'shadow': False, + 'shape': 'rect', + 'style': 'style goes here', + 'useHTML': False, + 'verticalAlign': 'top', + 'x': 10, + 'y': 20, + 'z': 0 + }, + 'dragDrop': { + 'draggableX': True, + 'draggableY': True, + 'dragHandle': { + 'className': 'draghandle-classname-goes-here', + 'color': '#ccc', + 'cursor': 'alias', + 'lineColor': '#ddd', + 'lineWidth': 2, + 'pathFormatter': """function() { return true; }""", + 'zIndex': 10 + }, + 'dragMaxX': 3456, + 'dragMaxY': 6532, + 'dragMinX': 123, + 'dragMinY': 321, + 'dragPrecisionX': 5, + 'dragPrecisionY': 5, + 'dragSensitivity': 2, + 'groupBy': 'some-property-name', + 'guideBox': { + 'default': { + 'className': 'some-classname-goes-here', + 'color': '#999', + 'cursor': 'pointer', + 'lineColor': '#ccc', + 'lineWidth': 2, + 'zIndex': 100 + } + }, + 'liveRedraw': True + }, + 'drilldown': 'some-id-goes-here', + 'marker': { + 'enabled': True, + 'fillColor': '#cccccc', + 'height': 24, + 'lineWidth': 2, + 'radius': 2, + 'states': { + 'hover': { + 'enabled': True + } + }, + 'symbol': 'circle', + 'width': 48 + }, + 'x': datetime.date(2022, 7, 26), + 'y': 123 + } + ], + 'id': 'some-id-goes-here', + 'index': 3, + 'legend_index': 3, + 'name': 'Series Name Goes Here', + }, None), + ({ + 'data': [ + { + 'dataLabels': { + 'align': 'center', + 'allowOverlap': True, + 'animation': { + 'defer': 5 + }, + 'backgroundColor': { + 'linearGradient': { + 'x1': 0.123, + 'x2': 0.234, + 'y1': 0.345, + 'y2': 0.456 + }, + 'stops': [ + [0.12, '#999'], + [0.34, '#fff'] + ] + }, + 'borderColor': '#999999', + 'borderRadius': 24, + 'borderWidth': 1, + 'className': 'some-class-name', + 'color': '#000000', + 'crop': True, + 'defer': False, + 'enabled': True, + 'filter': { + 'operator': '>=', + 'property': 'some_property', + 'value': 123 + }, + 'format': 'some format', + 'formatter': """function() { return true; }""", + 'inside': True, + 'nullFormat': 'some format', + 'nullFormatter': """function() { return true; }""", + 'overflow': 'none', + 'padding': 12, + 'position': 'center', + 'rotation': 0, + 'shadow': False, + 'shape': 'rect', + 'style': 'style goes here', + 'useHTML': False, + 'verticalAlign': 'top', + 'x': 10, + 'y': 20, + 'z': 0 + }, + 'dragDrop': { + 'draggableX': True, + 'draggableY': True, + 'dragHandle': { + 'className': 'draghandle-classname-goes-here', + 'color': '#ccc', + 'cursor': 'alias', + 'lineColor': '#ddd', + 'lineWidth': 2, + 'pathFormatter': """function() { return true; }""", + 'zIndex': 10 + }, + 'dragMaxX': 3456, + 'dragMaxY': 6532, + 'dragMinX': 123, + 'dragMinY': 321, + 'dragPrecisionX': 5, + 'dragPrecisionY': 5, + 'dragSensitivity': 2, + 'groupBy': 'some-property-name', + 'guideBox': { + 'default': { + 'className': 'some-classname-goes-here', + 'color': '#999', + 'cursor': 'pointer', + 'lineColor': '#ccc', + 'lineWidth': 2, + 'zIndex': 100 + } + }, + 'liveRedraw': True + }, + 'drilldown': 'some-id-goes-here', + 'marker': { + 'enabled': True, + 'fillColor': '#cccccc', + 'height': 24, + 'lineWidth': 2, + 'radius': 2, + 'states': { + 'hover': { + 'enabled': True + } + }, + 'symbol': 'circle', + 'width': 48 + }, + 'x': 'some category', + 'y': 123 + }, + { + 'dataLabels': { + 'align': 'center', + 'allowOverlap': True, + 'animation': { + 'defer': 5 + }, + 'backgroundColor': { + 'linearGradient': { + 'x1': 0.123, + 'x2': 0.234, + 'y1': 0.345, + 'y2': 0.456 + }, + 'stops': [ + [0.12, '#999'], + [0.34, '#fff'] + ] + }, + 'borderColor': '#999999', + 'borderRadius': 24, + 'borderWidth': 1, + 'className': 'some-class-name', + 'color': '#000000', + 'crop': True, + 'defer': False, + 'enabled': True, + 'filter': { + 'operator': '>=', + 'property': 'some_property', + 'value': 123 + }, + 'format': 'some format', + 'formatter': """function() { return true; }""", + 'inside': True, + 'nullFormat': 'some format', + 'nullFormatter': """function() { return true; }""", + 'overflow': 'none', + 'padding': 12, + 'position': 'center', + 'rotation': 0, + 'shadow': False, + 'shape': 'rect', + 'style': 'style goes here', + 'useHTML': False, + 'verticalAlign': 'top', + 'x': 10, + 'y': 20, + 'z': 0 + }, + 'dragDrop': { + 'draggableX': True, + 'draggableY': True, + 'dragHandle': { + 'className': 'draghandle-classname-goes-here', + 'color': '#ccc', + 'cursor': 'alias', + 'lineColor': '#ddd', + 'lineWidth': 2, + 'pathFormatter': """function() { return true; }""", + 'zIndex': 10 + }, + 'dragMaxX': 3456, + 'dragMaxY': 6532, + 'dragMinX': 123, + 'dragMinY': 321, + 'dragPrecisionX': 5, + 'dragPrecisionY': 5, + 'dragSensitivity': 2, + 'groupBy': 'some-property-name', + 'guideBox': { + 'default': { + 'className': 'some-classname-goes-here', + 'color': '#999', + 'cursor': 'pointer', + 'lineColor': '#ccc', + 'lineWidth': 2, + 'zIndex': 100 + } + }, + 'liveRedraw': True + }, + 'drilldown': 'some-id-goes-here', + 'marker': { + 'enabled': True, + 'fillColor': '#cccccc', + 'height': 24, + 'lineWidth': 2, + 'radius': 2, + 'states': { + 'hover': { + 'enabled': True + } + }, + 'symbol': 'circle', + 'width': 48 + }, + 'x': datetime.datetime(2022, 7, 26, 0, 4, 0), + 'y': 123 + }, + { + 'dataLabels': { + 'align': 'center', + 'allowOverlap': True, + 'animation': { + 'defer': 5 + }, + 'backgroundColor': { + 'linearGradient': { + 'x1': 0.123, + 'x2': 0.234, + 'y1': 0.345, + 'y2': 0.456 + }, + 'stops': [ + [0.12, '#999'], + [0.34, '#fff'] + ] + }, + 'borderColor': '#999999', + 'borderRadius': 24, + 'borderWidth': 1, + 'className': 'some-class-name', + 'color': '#000000', + 'crop': True, + 'defer': False, + 'enabled': True, + 'filter': { + 'operator': '>=', + 'property': 'some_property', + 'value': 123 + }, + 'format': 'some format', + 'formatter': """function() { return true; }""", + 'inside': True, + 'nullFormat': 'some format', + 'nullFormatter': """function() { return true; }""", + 'overflow': 'none', + 'padding': 12, + 'position': 'center', + 'rotation': 0, + 'shadow': False, + 'shape': 'rect', + 'style': 'style goes here', + 'useHTML': False, + 'verticalAlign': 'top', + 'x': 10, + 'y': 20, + 'z': 0 + }, + 'dragDrop': { + 'draggableX': True, + 'draggableY': True, + 'dragHandle': { + 'className': 'draghandle-classname-goes-here', + 'color': '#ccc', + 'cursor': 'alias', + 'lineColor': '#ddd', + 'lineWidth': 2, + 'pathFormatter': """function() { return true; }""", + 'zIndex': 10 + }, + 'dragMaxX': 3456, + 'dragMaxY': 6532, + 'dragMinX': 123, + 'dragMinY': 321, + 'dragPrecisionX': 5, + 'dragPrecisionY': 5, + 'dragSensitivity': 2, + 'groupBy': 'some-property-name', + 'guideBox': { + 'default': { + 'className': 'some-classname-goes-here', + 'color': '#999', + 'cursor': 'pointer', + 'lineColor': '#ccc', + 'lineWidth': 2, + 'zIndex': 100 + } + }, + 'liveRedraw': True + }, + 'drilldown': 'some-id-goes-here', + 'marker': { + 'enabled': True, + 'fillColor': '#cccccc', + 'height': 24, + 'lineWidth': 2, + 'radius': 2, + 'states': { + 'hover': { + 'enabled': True + } + }, + 'symbol': 'circle', + 'width': 48 + }, + 'x': datetime.date(2022, 7, 26), + 'y': 123 + } + ], + 'id': 'some-id-goes-here', + 'index': 3, + 'legend_index': 3, + 'name': 'Series Name Goes Here', + 'paths': { + 'definition': None, + 'max': 123 + }, + }, None), +] + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test_PictorialSeries__init__(kwargs, error): + Class__init__(cls, kwargs, error) + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test_PictorialSeries__to_untrimmed_dict(kwargs, error): + Class__to_untrimmed_dict(cls, kwargs, error) + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test_PictorialSeries_from_dict(kwargs, error): + Class_from_dict(cls, kwargs, error) + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test_PictorialSeries_to_dict(kwargs, error): + Class_to_dict(cls, kwargs, error) + + +@pytest.mark.parametrize('filename, as_file, error', [ + ('series/pictorial/01.js', False, None), + + ('series/pictorial/error-01.js', + False, + (errors.HighchartsValueError, + errors.HighchartsParseError, + JSONDecodeError, + TypeError, + ValueError)), + + ('series/pictorial/01.js', True, None), + + ('series/pictorial/error-01.js', + True, + (errors.HighchartsValueError, + errors.HighchartsParseError, + JSONDecodeError, + TypeError, + ValueError)), + +]) +def test_PictorialSeries_from_js_literal(input_files, filename, as_file, error): + Class_from_js_literal(cls, input_files, filename, as_file, error) diff --git a/tests/options/series/test_treegraph.py b/tests/options/series/test_treegraph.py new file mode 100644 index 0000000..f2e0bf7 --- /dev/null +++ b/tests/options/series/test_treegraph.py @@ -0,0 +1,168 @@ +"""Tests for ``highcharts.no_data``.""" + +import pytest + +from json.decoder import JSONDecodeError + +from highcharts_gantt.options.series.treegraph import TreegraphSeries as cls +from highcharts_stock import errors +from tests.fixtures import input_files, check_input_file, to_camelCase, to_js_dict, \ + Class__init__, Class__to_untrimmed_dict, Class_from_dict, Class_to_dict, \ + Class_from_js_literal + +STANDARD_PARAMS = [ + ({}, None), + ({ + 'data': [ + { + 'colorValue': 2, + 'dataLabels': { + 'align': 'center', + 'allowOverlap': True, + 'animation': { + 'defer': 5 + }, + 'backgroundColor': { + 'linearGradient': { + 'x1': 0.123, + 'x2': 0.234, + 'y1': 0.345, + 'y2': 0.456 + }, + 'stops': [ + [0.12, '#999'], + [0.34, '#fff'] + ] + }, + 'borderColor': '#999999', + 'borderRadius': 24, + 'borderWidth': 1, + 'className': 'some-class-name', + 'color': '#000000', + 'crop': True, + 'defer': False, + 'enabled': True, + 'filter': { + 'operator': '>=', + 'property': 'some_property', + 'value': 123 + }, + 'format': 'some format', + 'formatter': """function() { return true; }""", + 'inside': True, + 'nullFormat': 'some format', + 'nullFormatter': """function() { return true; }""", + 'overflow': 'none', + 'padding': 12, + 'position': 'center', + 'rotation': 0, + 'shadow': False, + 'shape': 'rect', + 'style': 'style goes here', + 'useHTML': False, + 'verticalAlign': 'top', + 'x': 10, + 'y': 20, + 'z': 0 + }, + 'dragDrop': { + 'draggableX': True, + 'draggableY': True, + 'dragHandle': { + 'className': 'draghandle-classname-goes-here', + 'color': '#ccc', + 'cursor': 'alias', + 'lineColor': '#ddd', + 'lineWidth': 2, + 'pathFormatter': """function() { return true; }""", + 'zIndex': 10 + }, + 'dragMaxX': 3456, + 'dragMaxY': 6532, + 'dragMinX': 123, + 'dragMinY': 321, + 'dragPrecisionX': 5, + 'dragPrecisionY': 5, + 'dragSensitivity': 2, + 'groupBy': 'some-property-name', + 'guideBox': { + 'default': { + 'className': 'some-classname-goes-here', + 'color': '#999', + 'cursor': 'pointer', + 'lineColor': '#ccc', + 'lineWidth': 2, + 'zIndex': 100 + } + }, + 'liveRedraw': True + }, + 'drilldown': 'some-id-goes-here', + 'parent': 'some-id-goes-here', + } + ] + }, None), + +] + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test__init__(kwargs, error): + Class__init__(cls, kwargs, error) + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test__to_untrimmed_dict(kwargs, error): + Class__to_untrimmed_dict(cls, kwargs, error) + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test_from_dict(kwargs, error): + Class_from_dict(cls, kwargs, error) + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test_to_dict(kwargs, error): + Class_to_dict(cls, kwargs, error) + + +@pytest.mark.parametrize('filename, as_file, error', [ + ('series/treegraph/01.js', False, None), + ('series/treegraph/02.js', False, None), + + ('series/treegraph/error-01.js', + False, + (errors.HighchartsValueError, + errors.HighchartsParseError, + JSONDecodeError, + TypeError, + ValueError)), + ('series/treegraph/error-02.js', + False, + (errors.HighchartsValueError, + errors.HighchartsParseError, + JSONDecodeError, + TypeError, + ValueError)), + + ('series/treegraph/01.js', True, None), + ('series/treegraph/02.js', True, None), + + ('series/treegraph/error-01.js', + True, + (errors.HighchartsValueError, + errors.HighchartsParseError, + JSONDecodeError, + TypeError, + ValueError)), + ('series/treegraph/error-02.js', + True, + (errors.HighchartsValueError, + errors.HighchartsParseError, + JSONDecodeError, + TypeError, + ValueError)), + +]) +def test_from_js_literal(input_files, filename, as_file, error): + Class_from_js_literal(cls, input_files, filename, as_file, error) diff --git a/tests/options/test_sonification.py b/tests/options/test_sonification.py new file mode 100644 index 0000000..3ffe3c3 --- /dev/null +++ b/tests/options/test_sonification.py @@ -0,0 +1,54 @@ +"""Tests for ``highcharts.responsive``.""" + +import pytest + +from json.decoder import JSONDecodeError + +from highcharts_gantt.options.sonification import SonificationOptions as cls +from highcharts_core import errors +from tests.fixtures import input_files, check_input_file, to_camelCase, to_js_dict, \ + Class__init__, Class__to_untrimmed_dict, Class_from_dict, Class_to_dict, \ + Class_from_js_literal + +STANDARD_PARAMS = [ + ({}, None), +] + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test__init__(kwargs, error): + Class__init__(cls, kwargs, error) + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test__to_untrimmed_dict(kwargs, error): + Class__to_untrimmed_dict(cls, kwargs, error) + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test_from_dict(kwargs, error): + Class_from_dict(cls, kwargs, error) + + +@pytest.mark.parametrize('kwargs, error', STANDARD_PARAMS) +def test_to_dict(kwargs, error): + Class_to_dict(cls, kwargs, error) + + +@pytest.mark.parametrize('filename, as_file, error', [ + ('sonification/sonification/01.js', False, None), + + ('sonification/sonification/error-01.js', False, (errors.HighchartsValueError, + errors.HighchartsParseError, + JSONDecodeError, + TypeError)), + + ('sonification/sonification/01.js', True, None), + + ('sonification/sonification/error-01.js', True, (errors.HighchartsValueError, + errors.HighchartsParseError, + JSONDecodeError, + TypeError)), +]) +def test_from_js_literal(input_files, filename, as_file, error): + Class_from_js_literal(cls, input_files, filename, as_file, error)