You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "zhmadeinkorea (via GitHub)" <gi...@apache.org> on 2024/08/19 06:18:13 UTC

[I] [Feature] Using blur in heatmap (catesian2d) [echarts]

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

   ### What problem does this feature solve?
   
   I want to give blurring effect of point in heatmap. I also want to give effect when coordinate system is catesian2d.
   
   let arr = [
       //x, y, value
       [0.000, 37.300, 320.975], 
       [2.500, 37.300, 294.121],
   .
   .
   .
   .
   ];
   Data is in the same format as above.
   Sorry if there's something that sets up the above features and I haven't found it. I haven't found it, please help.
   
   
   ![blur](https://github.com/user-attachments/assets/3c3e5863-cb49-42aa-8563-6cfc6d43e538)
   
   
   I made this heatmap and used "Heatmap - 20K data demo".
   and I want to point blur like "Heatmap on Baidu Map demo"
   
   
   ![geo_blur](https://github.com/user-attachments/assets/1876d587-ecb0-447d-9e26-ffd44d40c5ac)
   
   
   please help me
   
   
   
   ### What does the proposed API look like?
   
   let arr= [
       [0.000, 37.300, 320.975],
       [2.500, 37.300, 294.121],
       [5.000, 37.300, 270.164],
       [7.500, 37.300, 253.959],
       [10.000, 37.300, 236.359],
       [12.500, 37.300, 213.479],
       [15.000, 37.300, 192.662],
       [17.500, 37.300, 184.157],
       [20.000, 37.300, 176.095],
       [22.500, 37.300, 164.266],
       [25.000, 37.300, 155.423],
       [27.500, 37.300, 157.904],
   .
   .
   .
   ];
   
   
   
   
   function getMin2DArr(arr, idx) {
       const min = Math.min.apply(null, arr.map((el) => el[idx]));
       const max = Math.max.apply(null, arr.map((el) => el[idx]));
       return min;
   }
   
   
   
   function getMax2DArr(arr, idx) {
       const min = Math.min.apply(null, arr.map((el) => el[idx]));
       const max = Math.max.apply(null, arr.map((el) => el[idx]));
       return max;
   }
   
   
   
   var dom = document.getElementById('chart-container');
   var myChart = echarts.init(dom, null, {
       renderer: 'canvas',
       useDirtyRect: false
   });
   var app = {};
   
   var option;
   
   let xData = [];
   let yData = [];
   
   function generateData(theta, min, max) {
       let data = [];
   
       for (var i = 0; i < arr.length; i++){
       data.push([arr[i][0], arr[i][1], arr[i][2]]);
   
       }
   
   
       for (var i = 0; i < getMax2DArr(datFile, 0); i++) {
           xData.push(i);
       }
   
       for (var i = 0; i < getMax2DArr(datFile, 1); i++) {
           yData.push(datFile[i]);
       }
       return data;
   }
   
   let data = generateData(2, -5, 5);
   option = {
       tooltip: {
           position: "top"
       },
   
       xAxis: [{
           type: 'category',
           data: xData
       }],
       yAxis: {
           type: 'value',
           data: yData
       },
       visualMap: {
           min: getMin2DArr(datFile, 2),
           max: getMax2DArr(datFile, 2),
           calculable: true,
           realtime: false,
           inRange: {
               color: [
                   '#313695', '#00a31b', '#f0d800', '#f06c00', '#f00000', '#cc0055'
               ]
           }
       },
       series: [{
               name: 'val',
               type: 'heatmap',
               data: data,
               coordinateSystem: 'cartesian2d',
               animation: false,
               emphasis: {
                   foucs: 'series',
                   blurScope: 'coordinateSystem'
               },
               blurSize: 6,
               pointSize: 6
           },
       ]
   };
   
   
   
   if (option && typeof option === 'object') {
       myChart.setOption(option);
   }
   
   window.addEventListener('resize', myChart.resize);


-- 
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-unsubscribe@echarts.apache.org.apache.org

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


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


Re: [I] [Feature] Using blur in heatmap (catesian2d) [echarts]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #20268:
URL: https://github.com/apache/echarts/issues/20268#issuecomment-5348017553

   This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.


-- 
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-unsubscribe@echarts.apache.org

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


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


Re: [I] [Feature] Using blur in heatmap (catesian2d) [echarts]

Posted by "helgasoft (via GitHub)" <gi...@apache.org>.
helgasoft commented on issue #20268:
URL: https://github.com/apache/echarts/issues/20268#issuecomment-2297366190

   I think _cartesian2d_ heatmap is just a color matrix. 
   API says [pointSize](https://echarts.apache.org/en/option.html#series-heatmap.pointSize) and _blurSize_ are valid only with _geo_ coordinate system. So _cartesian2d_ points cannot be merged on zoom, like in _geo_.


-- 
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-unsubscribe@echarts.apache.org

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


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


Re: [I] [Feature] Using blur in heatmap (catesian2d) [echarts]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #20268:
URL: https://github.com/apache/echarts/issues/20268#issuecomment-5431616622

   This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!


-- 
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-unsubscribe@echarts.apache.org

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


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


Re: [I] [Feature] Using blur in heatmap (catesian2d) [echarts]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #20268: [Feature] Using blur in heatmap (catesian2d)
URL: https://github.com/apache/echarts/issues/20268


-- 
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-unsubscribe@echarts.apache.org

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


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