lmichaelis opened a new issue, #19053:
URL: https://github.com/apache/echarts/issues/19053

   ### Version
   
   <= 5.4.3
   
   ### Link to Minimal Reproduction
   
   https://codesandbox.io/s/echarts-problem-visualmap-types-qcffh9
   
   ### Steps to Reproduce
   
   1. Create a blank TypeScript project
   2. Add echarts as a dependency
   3. Create a variable typed as `EChartsOption` and assign any ECharts 
configuration with a `visualMap` component with a dimension of type string 
(i.e. if using datasets, see reproduction)
   
   
   ### Current Behavior
   
   Compilation fails.
   
   ### Expected Behavior
   
   Compilation succeeds: The configuration is valid, see 
[here](https://echarts.apache.org/examples/en/editor.html?theme=dark&code=PYBwLglsB2AEC8sDeAoWsAeBBDEDOAXMmurGAJ4gCmRA5AMYCGYVA5sAE7m0A0J6AE2aMiAbVoBZGL1i0AKgFcqM2gHUqAlXIAWClQDEOEFQGVmphdFoBdEgF8-6cjnxFUpMpRqyAbowA2SrT2jrBCYIx4VGBi_MQe6HjAChz03qJxHkiwEAIYRAAMPLB-gd4AjACsRbDaVMyFsA6ZpNm5-bDlxaVKRABMAMw1dQ2dTaEJyDl5_d0BvbB9fQAsxSMxi-Mt6G0zsANzZf3lABxr9RvlW5M70x2rJfMVA5XnowXXN7sdr49HiwA2YYXIjLJotWweOwkayhHz4BQBCSMEBuOICCAAWyo0DwUGgdHWwXQzUSVCMVEIsAyWRa4Ui0QAktABFQOkUWjj6MBWWibrByHQesoJgkOrR2sSEqSEhRqHQ8EwwCwOFKSTCUHYANxAA)
   
   ### Environment
   
   ```markdown
   - OS: n/a
   - Browser: n/a
   - Framework: any TypeScript
   ```
   
   
   ### Any additional comments?
   
   The culprit is
   
   
https://github.com/apache/echarts/blob/master/src/component/visualMap/VisualMapModel.ts#L84-L87
   
   which only allows numbers to be used as dimension identifiers in `visualMap` 
components specifically (I haven't checked anything else). Changing it to 
`number | string` should be enough to fix this.
   
   Additionally, the documentation for both continuous and piecewise visual 
mapping only states that strings can be used as dimension identifiers 
([here](https://echarts.apache.org/en/option.html#visualMap-continuous.dimension)
 and 
[here](https://echarts.apache.org/en/option.html#visualMap-piecewise.dimension)).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org
For additional commands, e-mail: commits-h...@echarts.apache.org

Reply via email to