Commit 4a393f26 by zhaochengxiang

热力图优化

parent 70f6a4e7
...@@ -23,6 +23,7 @@ class Thermodynamic extends React.Component { ...@@ -23,6 +23,7 @@ class Thermodynamic extends React.Component {
if (!data || (data.length>0&&(data[0].children||[]).length===0)) { if (!data || (data.length>0&&(data[0].children||[]).length===0)) {
this.graph?.clear(); this.graph?.clear();
} else { } else {
this.graph?.dispose();
this.graph = init(this)(this.elem, data, onClick); this.graph = init(this)(this.elem, data, onClick);
} }
} else if (resize !== prevProps.resize) { } else if (resize !== prevProps.resize) {
...@@ -87,14 +88,14 @@ const init = (ctx) => function (container, data, onClick) { ...@@ -87,14 +88,14 @@ const init = (ctx) => function (container, data, onClick) {
} }
var option = { var option = {
title: { // title: {
text: ((data||[]).length>0) ? `${data[0]?.text||''} (${data[0]?.dataAssetAndSubDirCount})` : '', // text: ((data||[]).length>0) ? `${data[0]?.text||''} (${data[0]?.dataAssetAndSubDirCount})` : '',
left: 'center', // left: 'center',
bottom: 10, // bottom: 10,
textStyle: { // textStyle: {
fontSize: 16 // fontSize: 16
} // }
}, // },
tooltip: { tooltip: {
formatter: function (info) { formatter: function (info) {
var treePathInfo = info.treePathInfo; var treePathInfo = info.treePathInfo;
...@@ -111,7 +112,7 @@ const init = (ctx) => function (container, data, onClick) { ...@@ -111,7 +112,7 @@ const init = (ctx) => function (container, data, onClick) {
}, },
series: [ series: [
{ {
// name: ((data||[]).length>0) ? `${data[0]?.text||''} (${data[0]?.dataAssetAndSubDirCount})` : '', name: ((data||[]).length>0) ? `${data[0]?.text||''} (${data[0]?.dataAssetAndSubDirCount})` : '',
type: 'treemap', type: 'treemap',
height: '85%', height: '85%',
visibleMin: 0, visibleMin: 0,
...@@ -128,7 +129,8 @@ const init = (ctx) => function (container, data, onClick) { ...@@ -128,7 +129,8 @@ const init = (ctx) => function (container, data, onClick) {
borderColor: '#555' borderColor: '#555'
}, },
breadcrumb: { breadcrumb: {
show: false, show: true,
top: '95%',
}, },
levels: getLevelOption(), levels: getLevelOption(),
data: ((data||[]).length>0) ? (data[0].children||[]) : [], data: ((data||[]).length>0) ? (data[0].children||[]) : [],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment