appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
33.78k stars 3.63k forks source link

[Feature]: Support for Geo/Map custom chart in EChart #29448

Open practical-programmer opened 9 months ago

practical-programmer commented 9 months ago

Is there an existing issue for this?

Summary

ECharts is now a standard library for charts. It has a very rich library of available chart types, and one type of them is based on Maps.

EChart map charts: https://echarts.apache.org/examples/en/index.html#chart-type-map Sample echart with custom svg map: https://echarts.apache.org/examples/en/editor.html?c=geo-svg-lines&lang=js

We have a use-case that we would like to show a custom echart map in Appsmith frontend. The SVG represents our factory layout and we would like to visualize statuses of machines on this layout with custom color rules.

We will supply the data using a datasource, probably a REST API.

The problem we face is that to use a custom map chart in ECharts, we have to register our custom SVG. This can be seen in example (link above).

code is:

  ROOT_PATH + '/data/asset/geo/MacOdrum-LV5-floorplan-web.svg',
  function (svg) {
    echarts.registerMap('MacOdrum-LV5-floorplan-web', { svg: svg });

And in Appsmith currently we were not able to get hold of echarts object to register it

Why should this be worked on?

If echarts is standard library, it's standard visualization charts should be supported. Custom charts with developer provided configuration are already supported, so Map chart should be supported too.

somangshu commented 9 months ago

@practical-programmer in appsmith, this is a separate widget. While we have already started migrating towards eCharts (starting with the chart widget), we still need to migrate the Map chart widget.

The basic use cases that are provided today in the widget will be migrated safely to eChart implementation once we start doing it. You use case however is a bit more peculiar, we will consider this while we are starting.

For now, please see if map chart current implementation can give you what you need.

practical-programmer commented 9 months ago

@somangshu thank you for the response and clarification - this is what we expected for now. Regarding testing the Map Chart current implementation - as it only supports predefined world maps, unfortunately there is no way for us to solve our requirement with it