FishEye: Tag 2bc3363ec5c0fbc39df85bd2d99cde84826b2405 refers to a dead (removed) revision in file `arms/js/analysis/mockData/circularPackingEx.json'. FishEye: No comparison available. Pass `N' to diff? FishEye: Tag 2bc3363ec5c0fbc39df85bd2d99cde84826b2405 refers to a dead (removed) revision in file `arms/js/analysis/mockData/circularPackingEx_bk.json'. FishEye: No comparison available. Pass `N' to diff? FishEye: Tag 2bc3363ec5c0fbc39df85bd2d99cde84826b2405 refers to a dead (removed) revision in file `arms/js/analysis/mockData/temp.json'. FishEye: No comparison available. Pass `N' to diff? Index: arms/js/analysis/resource/chart/circularPackingChart.js =================================================================== diff -u -rff74f257d9f13a2e595189c59b87d6ed3c9add38 -r2bc3363ec5c0fbc39df85bd2d99cde84826b2405 --- arms/js/analysis/resource/chart/circularPackingChart.js (.../circularPackingChart.js) (revision ff74f257d9f13a2e595189c59b87d6ed3c9add38) +++ arms/js/analysis/resource/chart/circularPackingChart.js (.../circularPackingChart.js) (revision 2bc3363ec5c0fbc39df85bd2d99cde84826b2405) @@ -1,226 +1,3 @@ -function exampleCircularPackingChart() { - var chartDom = document.getElementById('circularPacking'); - var myChart = echarts.init(chartDom); - var option; - - $.when( - $.get("./js/analysis/mockData/circularPackingEx.json"), - $.getScript( - "../reference/jquery-plugins/d3-5.16.0/d3.min.js", - /*'https://fastly.jsdelivr.net/npm/d3-hierarchy@2.0.0/dist/d3-hierarchy.min.js'*/ - ) - ).done(function (res) { - run(res[0]); - }); - function run(rawData) { - const dataWrap = prepareData(rawData); - console.log(dataWrap); - initChart(dataWrap.seriesData, dataWrap.maxDepth); - } - function prepareData(rawData) { - const seriesData = []; - let maxDepth = 0; - function convert(source, basePath, depth) { - if (source == null) { - return; - } - if (maxDepth > 5) { - return; - } - maxDepth = Math.max(depth, maxDepth); - seriesData.push({ - id: basePath, - value: source.$count, - depth: depth, - index: seriesData.length - }); - for (var key in source) { - if (source.hasOwnProperty(key) && !key.match(/^\$/)) { - var path = basePath + '.' + key; - convert(source[key], path, depth + 1); - } - } - } - convert(rawData, '제품-이름', 0); - return { - seriesData: seriesData, - maxDepth: maxDepth - }; - } - function initChart(seriesData, maxDepth) { - var displayRoot = stratify(); - function stratify() { - return d3 - .stratify() - .parentId(function (d) { - return d.id.substring(0, d.id.lastIndexOf('.')); - })(seriesData) - .sum(function (d) { - return d.value || 0; - }) - .sort(function (a, b) { - return b.value - a.value; - }); - } - function overallLayout(params, api) { - var context = params.context; - d3 - .pack() - .size([api.getWidth() - 2, api.getHeight() - 2]) - .padding(3)(displayRoot); - context.nodes = {}; - displayRoot.descendants().forEach(function (node, index) { - context.nodes[node.id] = node; - }); - } - function renderItem(params, api) { - var context = params.context; - // Only do that layout once in each time `setOption` called. - if (!context.layout) { - context.layout = true; - overallLayout(params, api); - } - var nodePath = api.value('id'); - var node = context.nodes[nodePath]; - if (!node) { - // Reder nothing. - return; - } - var isLeaf = !node.children || !node.children.length; - var focus = new Uint32Array( - node.descendants().map(function (node) { - return node.data.index; - }) - ); - var nodeName = isLeaf - ? nodePath - .slice(nodePath.lastIndexOf('.') + 1) - .split(/(?=[A-Z][^A-Z])/g) - .join('\n') - : ''; - var z2 = api.value('depth') * 2; - return { - type: 'circle', - focus: focus, - shape: { - cx: node.x, - cy: node.y, - r: node.r - }, - transition: ['shape'], - z2: z2, - textContent: { - type: 'text', - style: { - // transition: isLeaf ? 'fontSize' : null, - text: nodeName, - fontFamily: 'Arial', - width: node.r * 1.3, - overflow: 'truncate', - fontSize: node.r / 3 - }, - emphasis: { - style: { - overflow: null, - fontSize: Math.max(node.r / 3, 12) - } - } - }, - textConfig: { - position: 'inside' - }, - style: { - fill: api.visual('color') - }, - emphasis: { - style: { - fontFamily: 'Arial', - fontSize: 12, - shadowBlur: 20, - shadowOffsetX: 3, - shadowOffsetY: 5, - shadowColor: 'rgba(0,0,0,0.3)' - } - } - }; - } - option = { - dataset: { - source: seriesData - }, - tooltip: {}, - visualMap: [ - { - show: false, - min: 0, - max: maxDepth, - dimension: 'depth', - inRange: { - color: ["#264961", "#4A8FBD", "#82A5BD", "#5E7788", "#5D8AA8", "#2c5571"]//['#006edd', '#e0ffff'] - } - } - ], - hoverLayerThreshold: Infinity, - series: { - type: 'custom', - renderItem: renderItem, - progressive: 0, - coordinateSystem: 'none', - encode: { - tooltip: 'value', - itemName: 'id' - }, - itemStyle: { - color: function(params) { - // 예시: value (사람수) 를 기준으로. - if (params.data.value % 5 === 4) { - return "rgba(255,255,51,0.71)"; - } else if (params.data.value % 5 ===3) { - return "rgba(151,78,163,0.73)"; - } else if(params.data.value % 5 === 2) { - return "rgba(77,175,74,0.65)"; - } else if(params.data.value % 5 === 1) { - return "rgba(255,127,0,0.7)"; - } else { - return "rgba(55,125,184,0.62)"; - } - } - } - } - }; - myChart.setOption(option); - myChart.on('click', { seriesIndex: 0 }, function (params) { - drillDown(params.data.id); - }); - function drillDown(targetNodeId) { - displayRoot = stratify(); - if (targetNodeId != null) { - displayRoot = displayRoot.descendants().find(function (node) { - return node.data.id === targetNodeId; - }); - } - // A trick to prevent d3-hierarchy from visiting parents in this algorithm. - displayRoot.parent = null; - myChart.setOption({ - dataset: { - source: seriesData - } - }); - } - // Reset: click on the blank area. - myChart.getZr().on('click', function (event) { - if (!event.target) { - drillDown(); - } - }); - } - - option && myChart.setOption(option, true); - window.addEventListener('resize', function () { - myChart.resize(); - }); -} - function drawCircularPacking(target, psServiceName,rawData, issueStatusList, colorArr) { var chartDom = document.getElementById(target); var myChart = echarts.init(chartDom); Index: arms/js/analysisScope.js =================================================================== diff -u -rbbdd5d06282f6d39eaabd8f3cea240b5fce723d6 -r2bc3363ec5c0fbc39df85bd2d99cde84826b2405 --- arms/js/analysisScope.js (.../analysisScope.js) (revision bbdd5d06282f6d39eaabd8f3cea240b5fce723d6) +++ arms/js/analysisScope.js (.../analysisScope.js) (revision 2bc3363ec5c0fbc39df85bd2d99cde84826b2405) @@ -62,8 +62,7 @@ "js/analysis/resource/chart/RadialPolarBarChart.js", //CirclePacking with d3 Chart - "js/analysis/resource/chart/circularPackingChart.js", - "js/analysis/mockData/circularPackingEx.json" + "js/analysis/resource/chart/circularPackingChart.js" ], [ "../reference/jquery-plugins/dataTables-1.10.16/media/css/jquery.dataTables_lightblue4.css",