Skip to content

2.0.0

Latest

Choose a tag to compare

@spryker-release-bot spryker-release-bot released this 16 Nov 14:12

Included commits: 1.1.2...2.0.0

Breaking Changes

  • Replaced the Plotly charts with ECharts. The chart, barChart, lineChart and pieChart Twig functions render @ChartGui/Chart/chart.twig and need the spryker/chart 2.x script.
  • Removed the @ChartGui/Chart/bar-chart.twig, @ChartGui/Chart/line-chart.twig, @ChartGui/Chart/pie-chart.twig and @ChartGui/Chart/_partials/plotly-chart.twig templates. The chartContent block moved from _partials/plotly-chart.twig to @ChartGui/Chart/chart.twig.
  • Changed AbstractChartTwigPlugin::getTemplateName() from abstract to a method returning @ChartGui/Chart/chart.twig, and removed its overrides from BarChartTwigPlugin, LineChartTwigPlugin, PieChartTwigPlugin and ChartTwigPlugin.
  • Changed the Twig context that AbstractChartTwigPlugin::getChartContext() passes to @ChartGui/Chart/chart.twig: removed layout, added chartKind and chartView. Without chartView the template uses ChartDataTransfer.view.
  • Added the chartAssets() call to @ChartGui/Chart/chart.twig. ChartGuiTwigPlugin has to be registered in the Zed Twig plugin stack, and a project override of chart.twig has to call chartAssets().
  • Removed the deprecated BartChartTwigPlugin - use BarChartTwigPlugin instead.
  • Removed ChartGuiConfig::getDefaultChartLayout() and the ChartLayout transfer declaration. The chart size is defined by CSS now.

Improvements

  • Added the chart view templates cartesian, daily-bar, pie, order-status and ranking and the shared empty-state and error-state templates in @ChartGui/Chart/strategies/. chart.twig includes chart-strategy.twig and the <view>-chart-strategy.twig of the chart's view.
  • Added the chartTitle, chartBody, chartTemplates and chartAssets blocks to @ChartGui/Chart/chart.twig. Each chart template in @ChartGui/Chart/strategies/ and @ChartGui/Chart/_partials/ has its own block, named after the template (pieTemplate, legendRowTemplate, …).
  • A chart without ChartDataTransfer.view gets the pie view for a pie series and the cartesian view otherwise. Added ChartGuiCommunicationFactory::createChartViewResolver() and the AbstractChartTwigPlugin::CHART_KIND constant.
  • Added the chartAssets() Twig function and the ChartGuiTwigPlugin::TWIG_FUNCTION_NAME_CHART_ASSETS constant. A page renders the chart stylesheet and script once, however many charts it shows.
  • Added ChartGuiCommunicationFactory::createChartAssetRenderer(), the chartGuiAssetsRendered Twig global and the @ChartGui/Chart/_partials/chart-assets.twig and @ChartGui/Chart/_partials/pie-legend.twig templates.
  • Introduced the spryker-zed-chart-gui-main Zed frontend entry with the .chart, .chart__title, .chart-plot--*, .chart-state__icon, .chart-marker, .chart-legend, .chart-legend__*, .chart-ranking and .chart-ranking__* CSS classes. The ranking list shows five rows and scrolls.
  • Declared ChartDataTransfer with key, title, traces and view, and ChartDataTraceTransfer with the properties the chart template reads.
  • Added the Zed translations of the chart templates, such as Total items, Daily orders, No data to display and Chart could not be loaded.

Adjustments

  • Added the spryker/chart ^2.0.0 requirement.
  • Added a conflict with spryker/sales-statistics below 1.4.0: the Top ordered products chart needs the ranking view that TopOrdersChartPlugin sets since that version.