diff --git a/JSD-8199-需求确认书V2.docx b/JSD-8199-需求确认书V2.docx new file mode 100644 index 0000000..df988f9 Binary files /dev/null and b/JSD-8199-需求确认书V2.docx differ diff --git a/README.md b/README.md index d4deea5..7bcd487 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ # open-JSD-8199 -JSD-8199 甘特图扩展 \ No newline at end of file +JSD-8199 甘特图扩展\ +免责说明:该源码为第三方爱好者提供,不保证源码和方案的可靠性,也不提供任何形式的源码教学指导和协助!\ +仅作为开发者学习参考使用!禁止用于任何商业用途!\ +为保护开发者隐私,开发者信息已隐去!若原开发者希望公开自己的信息,可联系hugh处理。 \ No newline at end of file diff --git a/lib/finekit-10.0.jar b/lib/finekit-10.0.jar new file mode 100644 index 0000000..19d504a Binary files /dev/null and b/lib/finekit-10.0.jar differ diff --git a/plugin.xml b/plugin.xml new file mode 100644 index 0000000..a05fac0 --- /dev/null +++ b/plugin.xml @@ -0,0 +1,19 @@ + + + com.fr.plugin.third.party.jsd8199 + + yes + 0.5 + 10.0 + 2019-01-01 + fr.open + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/third/party/jsdibjj/CustomGanttChart.java b/src/main/java/com/fr/plugin/third/party/jsdibjj/CustomGanttChart.java new file mode 100644 index 0000000..c99f0d4 --- /dev/null +++ b/src/main/java/com/fr/plugin/third/party/jsdibjj/CustomGanttChart.java @@ -0,0 +1,1154 @@ +package com.fr.plugin.third.party.jsdibjj; + +import com.fanruan.api.cal.FormulaKit; +import com.fanruan.api.log.LogKit; +import com.fanruan.api.report.chart.BaseChartWithData; +import com.fanruan.api.script.FineCanvas; +import com.fanruan.api.util.AssistKit; +import com.fanruan.api.util.IOKit; +import com.fanruan.api.util.StringKit; +import com.fr.base.BaseFormula; +import com.fr.base.chart.cross.FormulaProcessor; +import com.fr.chart.ChartWebParaProvider; +import com.fr.extended.chart.HyperLinkPara; +import com.fr.json.JSON; +import com.fr.json.JSONArray; +import com.fr.json.JSONFactory; +import com.fr.json.JSONObject; +import com.fr.plugin.third.party.jsdibjj.color.ColorUtils; +import com.fr.plugin.third.party.jsdibjj.data.CustomGanttColumnFieldCollection; +import com.fr.stable.serialize.SerializationUtils; +import com.fr.stable.xml.XMLPrintWriter; +import com.fr.stable.xml.XMLableReader; + +import java.awt.*; +import java.awt.image.BufferedImage; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + + +public class CustomGanttChart extends BaseChartWithData { + + private static final String ID = "CUSTOM_GANTT_CHART_JSD8199"; + + private BaseFormula titleFormula = FormulaKit.newFormula(StringKit.EMPTY); + + private int titleTextStyleColor = Color.BLACK.getRGB(); + private String titleTextStyleFontStyle = "normal"; + private String titleTextStyleFontWeight = "normal"; + private String titleTextStyleFontFamily = "sans-serif"; + private int titleTextStyleFontSize = 18; + private String titleLeft = "center"; + + + private int seriesNameTextStyleColor = Color.BLACK.getRGB(); + private String seriesNameTextStyleFontFamily = "sans-serif"; + private int seriesNameTextStyleFontSize = 18; + + private int yAxisAxisLabelColor = Color.BLACK.getRGB(); + private String yAxisAxisLabelFontStyle = "normal"; + private String yAxisAxisLabelFontWeight = "normal"; + private String yAxisAxisLabelFontFamily = "sans-serif"; + private int yAxisAxisLabelFontSize = 12; + + + private long minTimestampValue = 0; + private long maxTimestampValue = 0; + private long currentTimestampValue = 0; + private boolean currentTimeLineVisible = false; + + + private PieType pieType = PieType.PIE; + + private String legendPosition = "left"; + + private List colors = new ArrayList<>(); + + private boolean fillGapOption = false; + private int fillGapColor = Color.RED.getRGB(); + + private boolean currentTimeLineOption = true; + private int currentTimeLineColor = Color.RED.getRGB(); + private int currentTimeLineWidth = 2; + + private int displayScale = 100; + private int displayXScale = 100; + + private boolean animationOption = false; + + private String symbolType = "rect"; + private int symbolWidth = 2; + + private int emphasisBorderColor = Color.RED.getRGB(); + private int emphasisBorderWidth = 2; + private boolean emphasisOption = false; + + /** + * 按项目循环颜色 + */ + private boolean projectCycleColor = false; + + private boolean dataSort = false; + private int oddBackgroundColor = Color.WHITE.getRGB(); + private int evenBackgroundColor = Color.WHITE.getRGB(); + + public int getOddBackgroundColor() { + return oddBackgroundColor; + } + + public void setOddBackgroundColor(int oddBackgroundColor) { + this.oddBackgroundColor = oddBackgroundColor; + } + + public int getEvenBackgroundColor() { + return evenBackgroundColor; + } + + public void setEvenBackgroundColor(int evenBackgroundColor) { + this.evenBackgroundColor = evenBackgroundColor; + } + + public int getSeriesNameTextStyleColor() { + return seriesNameTextStyleColor; + } + + public void setSeriesNameTextStyleColor(int seriesNameTextStyleColor) { + this.seriesNameTextStyleColor = seriesNameTextStyleColor; + } + + public String getSeriesNameTextStyleFontFamily() { + return seriesNameTextStyleFontFamily; + } + + public void setSeriesNameTextStyleFontFamily(String seriesNameTextStyleFontFamily) { + this.seriesNameTextStyleFontFamily = seriesNameTextStyleFontFamily; + } + + public int getSeriesNameTextStyleFontSize() { + return seriesNameTextStyleFontSize; + } + + public void setSeriesNameTextStyleFontSize(int seriesNameTextStyleFontSize) { + this.seriesNameTextStyleFontSize = seriesNameTextStyleFontSize; + } + + public boolean isDataSort() { + return dataSort; + } + + public void setDataSort(boolean dataSort) { + this.dataSort = dataSort; + } + + public boolean isProjectCycleColor() { + return projectCycleColor; + } + + public void setProjectCycleColor(boolean projectCycleColor) { + this.projectCycleColor = projectCycleColor; + } + + public int getyAxisAxisLabelColor() { + return yAxisAxisLabelColor; + } + + public void setyAxisAxisLabelColor(int yAxisAxisLabelColor) { + this.yAxisAxisLabelColor = yAxisAxisLabelColor; + } + + public String getyAxisAxisLabelFontStyle() { + return yAxisAxisLabelFontStyle; + } + + public void setyAxisAxisLabelFontStyle(String yAxisAxisLabelFontStyle) { + this.yAxisAxisLabelFontStyle = yAxisAxisLabelFontStyle; + } + + public String getyAxisAxisLabelFontWeight() { + return yAxisAxisLabelFontWeight; + } + + public void setyAxisAxisLabelFontWeight(String yAxisAxisLabelFontWeight) { + this.yAxisAxisLabelFontWeight = yAxisAxisLabelFontWeight; + } + + public String getyAxisAxisLabelFontFamily() { + return yAxisAxisLabelFontFamily; + } + + public void setyAxisAxisLabelFontFamily(String yAxisAxisLabelFontFamily) { + this.yAxisAxisLabelFontFamily = yAxisAxisLabelFontFamily; + } + + public int getyAxisAxisLabelFontSize() { + return yAxisAxisLabelFontSize; + } + + public void setyAxisAxisLabelFontSize(int yAxisAxisLabelFontSize) { + this.yAxisAxisLabelFontSize = yAxisAxisLabelFontSize; + } + + public int getTitleTextStyleColor() { + return titleTextStyleColor; + } + + public void setTitleTextStyleColor(int titleTextStyleColor) { + this.titleTextStyleColor = titleTextStyleColor; + } + + public String getTitleTextStyleFontStyle() { + return titleTextStyleFontStyle; + } + + public void setTitleTextStyleFontStyle(String titleTextStyleFontStyle) { + this.titleTextStyleFontStyle = titleTextStyleFontStyle; + } + + public String getTitleTextStyleFontWeight() { + return titleTextStyleFontWeight; + } + + public void setTitleTextStyleFontWeight(String titleTextStyleFontWeight) { + this.titleTextStyleFontWeight = titleTextStyleFontWeight; + } + + public String getTitleTextStyleFontFamily() { + return titleTextStyleFontFamily; + } + + public void setTitleTextStyleFontFamily(String titleTextStyleFontFamily) { + this.titleTextStyleFontFamily = titleTextStyleFontFamily; + } + + public int getTitleTextStyleFontSize() { + return titleTextStyleFontSize; + } + + public void setTitleTextStyleFontSize(int titleTextStyleFontSize) { + this.titleTextStyleFontSize = titleTextStyleFontSize; + } + + public String getTitleLeft() { + return titleLeft; + } + + public void setTitleLeft(String titleLeft) { + this.titleLeft = titleLeft; + } + + public String getSymbolType() { + return symbolType; + } + + public void setSymbolType(String symbolType) { + this.symbolType = symbolType; + } + + public int getSymbolWidth() { + return symbolWidth; + } + + public void setSymbolWidth(int symbolWidth) { + this.symbolWidth = symbolWidth; + } + + public boolean isAnimationOption() { + return animationOption; + } + + public void setAnimationOption(boolean animationOption) { + this.animationOption = false; + } + + public int getEmphasisBorderColor() { + return emphasisBorderColor; + } + + public void setEmphasisBorderColor(int emphasisBorderColor) { + this.emphasisBorderColor = emphasisBorderColor; + } + + public int getEmphasisBorderWidth() { + return emphasisBorderWidth; + } + + public void setEmphasisBorderWidth(int emphasisBorderWidth) { + this.emphasisBorderWidth = emphasisBorderWidth; + } + + public boolean isEmphasisOption() { + return emphasisOption; + } + + public void setEmphasisOption(boolean emphasisOption) { + this.emphasisOption = emphasisOption; + } + + public int getDisplayScale() { + return displayScale; + } + + public void setDisplayScale(int scale) { + if (scale <= 0) { + scale = 0; + } + if (scale >= 100) { + scale = 100; + } + this.displayScale = scale; + } + + public int getDisplayXScale() { + return displayXScale; + } + + public void setDisplayXScale(int scale) { + if (scale <= 0) { + scale = 0; + } + if (scale >= 100) { + scale = 100; + } + this.displayXScale = scale; + } + + public boolean isFillGapOption() { + return fillGapOption; + } + + public void setFillGapOption(boolean fillGapOption) { + this.fillGapOption = false; + } + + public int getFillGapColor() { + return fillGapColor; + } + + public void setFillGapColor(int fillGapColor) { + this.fillGapColor = fillGapColor; + } + + public boolean isCurrentTimeLineOption() { + return currentTimeLineOption; + } + + public void setCurrentTimeLineOption(boolean currentTimeLineOption) { + this.currentTimeLineOption = currentTimeLineOption; + } + + public int getCurrentTimeLineColor() { + return currentTimeLineColor; + } + + public void setCurrentTimeLineColor(int currentTimeLineColor) { + this.currentTimeLineColor = currentTimeLineColor; + } + + public int getCurrentTimeLineWidth() { + return currentTimeLineWidth; + } + + public void setCurrentTimeLineWidth(int currentTimeLineWidth) { + this.currentTimeLineWidth = currentTimeLineWidth; + } + + public List getColors() { + List tempColors = new ArrayList<>(); + tempColors.add(getColorRGB(25, 79, 151)); + tempColors.add(getColorRGB(85, 85, 85)); + tempColors.add(getColorRGB(189, 107, 8)); + tempColors.add(getColorRGB(0, 104, 107)); + tempColors.add(getColorRGB(200, 45, 49)); + tempColors.add(getColorRGB(98, 91, 161)); + tempColors.add(getColorRGB(137, 137, 137)); + tempColors.add(getColorRGB(156, 152, 0)); + tempColors.add(getColorRGB(0, 127, 84)); + tempColors.add(getColorRGB(161, 149, 197)); + tempColors.add(getColorRGB(16, 54, 103)); + tempColors.add(getColorRGB(241, 146, 114)); + tempColors.add(getColorRGB(193, 140, 0)); + tempColors.add(getColorRGB(54, 54, 54)); + tempColors.add(getColorRGB(66, 111, 179)); + tempColors.add(getColorRGB(102, 191, 127)); + tempColors.add(getColorRGB(249, 205, 118)); + tempColors.add(getColorRGB(57, 40, 132)); + tempColors.add(getColorRGB(0, 174, 113)); + tempColors.add(getColorRGB(147, 170, 214)); + tempColors.add(getColorRGB(73, 7, 97)); + tempColors.add(getColorRGB(250, 241, 75)); + tempColors.add(getColorRGB(149, 83, 5)); + tempColors.add(getColorRGB(1, 98, 65)); + tempColors.add(getColorRGB(115, 136, 193)); + tempColors.add(getColorRGB(143, 30, 32)); + tempColors.add(getColorRGB(249, 205, 118)); + tempColors.add(getColorRGB(214, 155, 1)); + tempColors.add(getColorRGB(183, 183, 183)); + tempColors.add(getColorRGB(81, 31, 144)); + tempColors.add(getColorRGB(153, 208, 185)); + tempColors.add(getColorRGB(199, 195, 0)); + return tempColors; + } + + public void setColors(List colors) { + this.colors = colors; + } + + public PieType getPieType() { + return pieType; + } + + public void setPieType(PieType pieType) { + this.pieType = pieType; + } + + public BaseFormula getTitleFormula() { + return titleFormula; + } + + public void setTitleFormula(BaseFormula titleFormula) { + this.titleFormula = titleFormula; + } + + + public String getLegendPosition() { + return legendPosition; + } + + public void setLegendPosition(String legendPosition) { + this.legendPosition = legendPosition; + } + + + private int getColorRGB(int r, int g, int b) { + Color color = new Color(r, g, b); + return color.getRGB(); + } + + + @Override + protected Image designImage(int width, int height, int resolution, ChartWebParaProvider chartWebPara) { + return IOKit.readImageWithCache("com/fr/plugin/third/party/jsdibjj/images/gantt_type.png"); + } + + @Override + protected Image exportImage(int width, int height, int resolution, ChartWebParaProvider chartWebPara) { + BufferedImage bufferedImage = new BufferedImage(5, 5, BufferedImage.TYPE_INT_ARGB); + try { + FineCanvas canvas = new FineCanvas("/com/fr/plugin/demo/echarts-adapter.js", "/com/fr/plugin/demo/echarts.js"); + canvas.loadText("canvas.height = " + height, "canvas.width = " + width); + canvas.loadText("var myChart = echarts.init(canvas)"); + canvas.loadText("option = " + createAttributeConfig(chartWebPara).toString()); + canvas.loadText("myChart.setOption(option);"); + bufferedImage = canvas.paint(); + } catch (Exception ex) { + LogKit.error(ex.getMessage(), ex); + } + return bufferedImage; + } + + @Override + public CustomGanttChart clone() throws CloneNotSupportedException { + CustomGanttChart result = (CustomGanttChart) super.clone(); + if (getTitleFormula() != null) { + result.setTitleFormula(this.getTitleFormula().clone()); + } + + result.setTitleTextStyleColor(this.getTitleTextStyleColor()); + result.setTitleTextStyleFontStyle(this.getTitleTextStyleFontStyle()); + result.setTitleTextStyleFontWeight(this.getTitleTextStyleFontWeight()); + result.setTitleTextStyleFontFamily(this.getTitleTextStyleFontFamily()); + result.setTitleTextStyleFontSize(this.getTitleTextStyleFontSize()); + result.setTitleLeft(this.getTitleLeft()); + + result.setyAxisAxisLabelColor(this.getyAxisAxisLabelColor()); + result.setyAxisAxisLabelFontStyle(this.getyAxisAxisLabelFontStyle()); + result.setyAxisAxisLabelFontWeight(this.getyAxisAxisLabelFontWeight()); + result.setyAxisAxisLabelFontFamily(this.getyAxisAxisLabelFontFamily()); + result.setyAxisAxisLabelFontSize(this.getyAxisAxisLabelFontSize()); + + result.setPieType(this.getPieType()); + result.setLegendPosition(this.getLegendPosition()); + + result.setColors(this.getColors()); + + result.setFillGapOption(this.isFillGapOption()); + result.setFillGapColor(this.getFillGapColor()); + + result.setCurrentTimeLineOption(this.isCurrentTimeLineOption()); + result.setCurrentTimeLineColor(this.getCurrentTimeLineColor()); + result.setCurrentTimeLineWidth(this.getCurrentTimeLineWidth()); + + result.setDisplayScale(this.getDisplayScale()); + result.setDisplayXScale(this.getDisplayXScale()); + + result.setAnimationOption(this.isAnimationOption()); + result.setSymbolType(this.getSymbolType()); + result.setSymbolWidth(this.getSymbolWidth()); + + result.setEmphasisBorderColor(this.getEmphasisBorderColor()); + result.setEmphasisBorderWidth(this.getEmphasisBorderWidth()); + result.setEmphasisOption(this.isEmphasisOption()); + result.setProjectCycleColor(this.isProjectCycleColor()); + result.setDataSort(this.isDataSort()); + + + result.setSeriesNameTextStyleFontFamily(this.getSeriesNameTextStyleFontFamily()); + result.setSeriesNameTextStyleFontSize(this.getSeriesNameTextStyleFontSize()); + result.setSeriesNameTextStyleColor(this.getSeriesNameTextStyleColor()); + return result; + } + + @Override + public int hashCode() { + return super.hashCode() + AssistKit.hashCode(this.getTitleFormula(), this.getPieType(), this.getLegendPosition(), + this.getTitleTextStyleColor(), this.getTitleTextStyleFontStyle(), this.getTitleTextStyleFontWeight(), + this.getTitleTextStyleFontFamily(), this.getTitleTextStyleFontSize(), this.getTitleLeft(), + this.getyAxisAxisLabelColor(), this.getyAxisAxisLabelFontStyle(), this.getyAxisAxisLabelFontWeight(), this.getyAxisAxisLabelFontFamily(), this.getyAxisAxisLabelFontSize(), + this.getColors(), + this.isFillGapOption(), this.getFillGapColor(), + this.isCurrentTimeLineOption(), this.getCurrentTimeLineColor(), this.getCurrentTimeLineWidth(), + this.getDisplayScale(), this.getDisplayXScale(), + this.isAnimationOption(), this.getSymbolType(), this.getSymbolWidth(), + this.getSeriesNameTextStyleFontFamily(), this.getSeriesNameTextStyleFontSize(), this.getSeriesNameTextStyleColor(), + this.getEmphasisBorderColor(), this.getEmphasisBorderWidth(), this.isEmphasisOption(), this.isProjectCycleColor(), this.isDataSort()); + } + + @Override + public boolean equals(Object ob) { + return super.equals(ob) + && ob instanceof CustomGanttChart + && AssistKit.equals(this.getTitleFormula(), ((CustomGanttChart) ob).getTitleFormula()) + + && AssistKit.equals(this.getTitleTextStyleColor(), ((CustomGanttChart) ob).getTitleTextStyleColor()) + && AssistKit.equals(this.getTitleTextStyleFontStyle(), ((CustomGanttChart) ob).getTitleTextStyleFontStyle()) + && AssistKit.equals(this.getTitleTextStyleFontWeight(), ((CustomGanttChart) ob).getTitleTextStyleFontWeight()) + && AssistKit.equals(this.getTitleTextStyleFontFamily(), ((CustomGanttChart) ob).getTitleTextStyleFontFamily()) + && AssistKit.equals(this.getTitleTextStyleFontSize(), ((CustomGanttChart) ob).getTitleTextStyleFontSize()) + && AssistKit.equals(this.getTitleLeft(), ((CustomGanttChart) ob).getTitleLeft()) + + && AssistKit.equals(this.getyAxisAxisLabelColor(), ((CustomGanttChart) ob).getyAxisAxisLabelColor()) + && AssistKit.equals(this.getyAxisAxisLabelFontStyle(), ((CustomGanttChart) ob).getyAxisAxisLabelFontStyle()) + && AssistKit.equals(this.getyAxisAxisLabelFontWeight(), ((CustomGanttChart) ob).getyAxisAxisLabelFontWeight()) + && AssistKit.equals(this.getyAxisAxisLabelFontFamily(), ((CustomGanttChart) ob).getyAxisAxisLabelFontFamily()) + && AssistKit.equals(this.getyAxisAxisLabelFontSize(), ((CustomGanttChart) ob).getyAxisAxisLabelFontSize()) + + && AssistKit.equals(this.getPieType(), ((CustomGanttChart) ob).getPieType()) + && AssistKit.equals(this.getLegendPosition(), ((CustomGanttChart) ob).getLegendPosition()) + + && AssistKit.equals(this.isFillGapOption(), ((CustomGanttChart) ob).isFillGapOption()) + && AssistKit.equals(this.getFillGapColor(), ((CustomGanttChart) ob).getFillGapColor()) + + && AssistKit.equals(this.isCurrentTimeLineOption(), ((CustomGanttChart) ob).isCurrentTimeLineOption()) + && AssistKit.equals(this.getCurrentTimeLineColor(), ((CustomGanttChart) ob).getCurrentTimeLineColor()) + && AssistKit.equals(this.getCurrentTimeLineWidth(), ((CustomGanttChart) ob).getCurrentTimeLineWidth()) + + && AssistKit.equals(this.getDisplayScale(), ((CustomGanttChart) ob).getDisplayScale()) + && AssistKit.equals(this.getDisplayXScale(), ((CustomGanttChart) ob).getDisplayXScale()) + + && AssistKit.equals(this.isAnimationOption(), ((CustomGanttChart) ob).isAnimationOption()) + && AssistKit.equals(this.getSymbolType(), ((CustomGanttChart) ob).getSymbolType()) + && AssistKit.equals(this.getSymbolWidth(), ((CustomGanttChart) ob).getSymbolWidth()) + + && AssistKit.equals(this.getEmphasisBorderColor(), ((CustomGanttChart) ob).getEmphasisBorderColor()) + && AssistKit.equals(this.getEmphasisBorderWidth(), ((CustomGanttChart) ob).getEmphasisBorderWidth()) + && AssistKit.equals(this.isEmphasisOption(), ((CustomGanttChart) ob).isEmphasisOption()) + && AssistKit.equals(this.isProjectCycleColor(), ((CustomGanttChart) ob).isProjectCycleColor()) + && AssistKit.equals(this.isDataSort(), ((CustomGanttChart) ob).isDataSort()) + + && AssistKit.equals(this.getSeriesNameTextStyleFontFamily(), ((CustomGanttChart) ob).getSeriesNameTextStyleFontFamily()) + && AssistKit.equals(this.getSeriesNameTextStyleFontSize(), ((CustomGanttChart) ob).getSeriesNameTextStyleFontSize()) + && AssistKit.equals(this.getSeriesNameTextStyleColor(), ((CustomGanttChart) ob).getSeriesNameTextStyleColor()); + } + + @Override + public JSONObject createAttributeConfig(ChartWebParaProvider chartWebPara) { + JSONObject jsonObject = super.createAttributeConfig(chartWebPara); + CustomGanttColumnFieldCollection columnFieldCollection = getFieldCollection(CustomGanttColumnFieldCollection.class); + jsonObject.put("dataStatus", false); + List projectNames = CustomGanttDataFactory.createProjectNames(columnFieldCollection); + if (projectNames.size() <= 0) { + return jsonObject; + } + jsonObject.put("dataStatus", true); + + minTimestampValue = CustomGanttDataFactory.createMinTimestamp(columnFieldCollection); + maxTimestampValue = CustomGanttDataFactory.createMaxTimestamp(columnFieldCollection); + currentTimestampValue = System.currentTimeMillis(); + currentTimeLineVisible = false; + if ((currentTimestampValue >= minTimestampValue) && (currentTimestampValue <= maxTimestampValue)) { + currentTimeLineVisible = true; + } + JSONObject currentDateObject = JSONFactory.createJSON(JSON.OBJECT); + currentDateObject.put("visible", currentTimeLineVisible); + currentDateObject.put("value", currentTimestampValue); + + JSONObject dateLineObject = JSONFactory.createJSON(JSON.OBJECT); + dateLineObject.put("enable", isCurrentTimeLineOption()); + dateLineObject.put("color", CustomGanttDataFactory.rgbToHex(new Color(getCurrentTimeLineColor()))); + dateLineObject.put("width", getCurrentTimeLineWidth()); + dateLineObject.put("currentDate", currentTimestampValue); + dateLineObject.put("currentDateShow", CustomGanttDataFactory.timestampToDate(currentTimestampValue)); + + List datas = CustomGanttDataFactory.createData(columnFieldCollection); + List suspendedDatas = new ArrayList<>(); + createSeriesDataColor(datas, projectNames, suspendedDatas); + + CustomGanttData tempCustomGanttData; + int flag = 0; + + JSONArray categoriesData = JSONFactory.createJSON(JSON.ARRAY); + JSONArray suspendedValuesData = JSONFactory.createJSON(JSON.ARRAY); + String category = ""; + String suspendedFirstContent = ""; + for (int i = 0, max = projectNames.size() - 1; i <= max; i++) { + category = projectNames.get(i); + categoriesData.put(category); + } + + //从大到小排序,针对日期有重叠的,日期小的在上面,最后绘制图表 + //改成日期大的在上面 + Collections.sort(datas, new Comparator() { + @Override + public int compare(CustomGanttData o1, CustomGanttData o2) { + long diff = o1.beginDate - o2.beginDate; + if (diff > 0) { + return 1; + } else if (diff < 0) { + return -1; + } + return 0; + } + }); + //添加奇偶背景颜色 + if (isDataSort()) { + long minBeginDate = 0; + long maxEndDate = 0; + if (datas.size() >= 1) { + maxEndDate = datas.get(0).endDate; + minBeginDate = datas.get(datas.size() - 1).beginDate; + } + + for (int i = 0, max = projectNames.size() - 1; i <= max; i++) { + tempCustomGanttData = new CustomGanttData(); + tempCustomGanttData.index = i; + tempCustomGanttData.beginDate = minBeginDate; + tempCustomGanttData.endDate = maxEndDate; + tempCustomGanttData.showType = CustomGanttData.SHOW_TYPE_BACKGROUND; + if ((i % 2) == 0) { + tempCustomGanttData.completedColor = getOddBackgroundColor(); + } else { + tempCustomGanttData.completedColor = getEvenBackgroundColor(); + } + tempCustomGanttData.completedColorHex = CustomGanttDataFactory.rgbToHex(new Color(tempCustomGanttData.completedColor)); + datas.add(0, tempCustomGanttData); + } + } + + List milestoneDatas = CustomGanttDataFactory.createMilestoneDatas(columnFieldCollection); + datas.addAll(milestoneDatas); + + JSONArray seriesData = CustomGanttDataFactory.createJsonData(columnFieldCollection, datas, this); + JSONObject ganttDataJsonObject = JSONFactory.createJSON(JSON.OBJECT); + ganttDataJsonObject.put("categories", categoriesData); + ganttDataJsonObject.put("seriesData", seriesData); + ganttDataJsonObject.put("animationOption", isAnimationOption()); + ganttDataJsonObject.put("symbolType", getSymbolType()); + ganttDataJsonObject.put("symbolWidth", getSymbolWidth()); + ganttDataJsonObject.put("minDate", CustomGanttDataFactory.createMinTimestamp(columnFieldCollection)); + ganttDataJsonObject.put("maxDate", CustomGanttDataFactory.createMaxTimestamp(columnFieldCollection)); + ganttDataJsonObject.put("currentDate", currentDateObject); + ganttDataJsonObject.put("dateLine", dateLineObject); + ganttDataJsonObject.put("displayScale", (100 - getDisplayScale())); + ganttDataJsonObject.put("displayXScale", getDisplayXScale()); + + JSONArray linesData = createLinesData(datas); + ganttDataJsonObject.put("linesData", linesData); + + jsonObject.put("ganttData", ganttDataJsonObject); + + + JSONObject titleJson = new JSONObject(); + String ganttTitle = (String) getTitleFormula().getResult(); + if (StringKit.isEmpty(ganttTitle)) { + ganttTitle = ""; + } + titleJson.put("titleText", ganttTitle); + titleJson.put("titleTextStyleColor", CustomGanttDataFactory.rgbToHex(new Color(this.titleTextStyleColor))); + titleJson.put("titleTextStyleFontStyle", titleTextStyleFontStyle); + titleJson.put("titleTextStyleFontWeight", titleTextStyleFontWeight); + titleJson.put("titleTextStyleFontFamily", titleTextStyleFontFamily); + titleJson.put("titleTextStyleFontSize", titleTextStyleFontSize); + titleJson.put("titleLeft", titleLeft); + jsonObject.put("ganttTitle", titleJson); + + JSONObject seriesNameJson = new JSONObject(); + seriesNameJson.put("seriesNameTextStyleFontFamily", seriesNameTextStyleFontFamily); + seriesNameJson.put("seriesNameTextStyleFontSize", seriesNameTextStyleFontSize); + seriesNameJson.put("seriesNameTextStyleColor", CustomGanttDataFactory.rgbToHex(new Color(this.seriesNameTextStyleColor))); + jsonObject.put("seriesNameFont", seriesNameJson); + + JSONObject yAxisAxisLabelFontJson = new JSONObject(); + yAxisAxisLabelFontJson.put("yAxisAxisLabelColor", CustomGanttDataFactory.rgbToHex(new Color(this.yAxisAxisLabelColor))); + yAxisAxisLabelFontJson.put("yAxisAxisLabelFontStyle", yAxisAxisLabelFontStyle); + yAxisAxisLabelFontJson.put("yAxisAxisLabelFontWeight", yAxisAxisLabelFontWeight); + yAxisAxisLabelFontJson.put("yAxisAxisLabelFontFamily", yAxisAxisLabelFontFamily); + yAxisAxisLabelFontJson.put("yAxisAxisLabelFontSize", yAxisAxisLabelFontSize); + jsonObject.put("yAxisAxisLabelFont", yAxisAxisLabelFontJson); + + JSONObject fillGapJson = new JSONObject(); + fillGapJson.put("enable", this.fillGapOption); + fillGapJson.put("color", CustomGanttDataFactory.rgbToHex(new Color(this.fillGapColor))); + JSONArray flashingData = JSONFactory.createJSON(JSON.ARRAY); + if (isFillGapOption()) { + flashingData = CustomGanttDataFactory.createFlashingData(datas); + } + fillGapJson.put("flashingData", flashingData); + + jsonObject.put("fillGap", fillGapJson); + + //jsonObject.put("projectCycleColor", projectCycleColor); + jsonObject.put("projectCycleColor", true); + + JSONArray graphDatasConfJson = CustomGanttDataFactory.createMilestoneData(columnFieldCollection); + jsonObject.put("graphDatasConf", graphDatasConfJson); + return jsonObject; + } + + @Override + public void dealFormula(FormulaProcessor formulaProcessor) { + if (titleFormula != null) { + formulaProcessor.dealWith(titleFormula); + } + super.dealFormula(formulaProcessor); + } + + @Override + public String getID() { + return ID; + } + + @Override + public void readAttr(XMLableReader xmLableReader) { + super.readAttr(xmLableReader); + this.setPieType(PieType.parseInt(xmLableReader.getAttrAsInt("pieType", 0))); + this.setTitleFormula(FormulaKit.newFormula(xmLableReader.getAttrAsString("title", "新建图表标题"))); + + //private int seriesNameTextStyleColor = Color.BLACK.getRGB(); + //private String seriesNameTextStyleFontFamily = "sans-serif"; + //private int seriesNameTextStyleFontSize = 18; + this.setSeriesNameTextStyleColor(xmLableReader.getAttrAsInt("seriesNameTextStyleColor", Color.BLACK.getRGB())); + this.setSeriesNameTextStyleFontFamily(xmLableReader.getAttrAsString("seriesNameTextStyleFontFamily", "sans-serif")); + this.setSeriesNameTextStyleFontSize(xmLableReader.getAttrAsInt("seriesNameTextStyleFontSize", 18)); + + + this.setTitleTextStyleColor(xmLableReader.getAttrAsInt("titleTextStyleColor", Color.BLACK.getRGB())); + this.setTitleTextStyleFontStyle(xmLableReader.getAttrAsString("titleTextStyleFontStyle", "normal")); + this.setTitleTextStyleFontWeight(xmLableReader.getAttrAsString("titleTextStyleFontWeight", "normal")); + this.setTitleTextStyleFontFamily(xmLableReader.getAttrAsString("titleTextStyleFontFamily", "sans-serif")); + this.setTitleTextStyleFontSize(xmLableReader.getAttrAsInt("titleTextStyleFontSize", 18)); + this.setTitleLeft(xmLableReader.getAttrAsString("titleLeft", "center")); + + this.setyAxisAxisLabelColor(xmLableReader.getAttrAsInt("yAxisAxisLabelColor", Color.BLACK.getRGB())); + this.setyAxisAxisLabelFontStyle(xmLableReader.getAttrAsString("yAxisAxisLabelFontStyle", "normal")); + this.setyAxisAxisLabelFontWeight(xmLableReader.getAttrAsString("yAxisAxisLabelFontWeight", "normal")); + this.setyAxisAxisLabelFontFamily(xmLableReader.getAttrAsString("yAxisAxisLabelFontFamily", "sans-serif")); + this.setyAxisAxisLabelFontSize(xmLableReader.getAttrAsInt("yAxisAxisLabelFontSize", 12)); + + this.setLegendPosition(xmLableReader.getAttrAsString("legendPosition", StringKit.EMPTY)); + String colorContent = xmLableReader.getAttrAsString("colors", StringKit.EMPTY); + setColors(toColorList(colorContent)); + + this.setFillGapOption(xmLableReader.getAttrAsBoolean("fillGapOption", false)); + this.setFillGapColor(xmLableReader.getAttrAsInt("fillGapColor", Color.RED.getRGB())); + + this.setCurrentTimeLineOption(xmLableReader.getAttrAsBoolean("currentTimeLineOption", false)); + this.setCurrentTimeLineColor(xmLableReader.getAttrAsInt("currentTimeLineColor", Color.RED.getRGB())); + this.setCurrentTimeLineWidth(xmLableReader.getAttrAsInt("currentTimeLineWidth", 2)); + + this.setDisplayScale(xmLableReader.getAttrAsInt("displayScale", 100)); + this.setDisplayXScale(xmLableReader.getAttrAsInt("displayXScale", 100)); + + this.setAnimationOption(xmLableReader.getAttrAsBoolean("animationOption", false)); + this.setSymbolType(xmLableReader.getAttrAsString("symbolType", "rect")); + this.setSymbolWidth(xmLableReader.getAttrAsInt("symbolWidth", 2)); + + this.setEmphasisBorderColor(xmLableReader.getAttrAsInt("emphasisBorderColor", Color.RED.getRGB())); + this.setEmphasisBorderWidth(xmLableReader.getAttrAsInt("emphasisBorderWidth", 2)); + this.setEmphasisOption(xmLableReader.getAttrAsBoolean("emphasisOption", false)); + this.setProjectCycleColor(xmLableReader.getAttrAsBoolean("projectCycleColor", false)); + this.setDataSort(xmLableReader.getAttrAsBoolean("dataSort", false)); + + this.setOddBackgroundColor(xmLableReader.getAttrAsInt("oddBackgroundColor", Color.WHITE.getRGB())); + this.setEvenBackgroundColor(xmLableReader.getAttrAsInt("evenBackgroundColor", Color.WHITE.getRGB())); + } + + @Override + public void writeAttr(XMLPrintWriter xmlPrintWriter) { + super.writeAttr(xmlPrintWriter); + String colorContent = getColorContent(); + xmlPrintWriter.attr("pieType", pieType.ordinal()) + .attr("title", titleFormula.toString()) + + .attr("titleTextStyleColor", titleTextStyleColor) + .attr("titleTextStyleFontStyle", titleTextStyleFontStyle) + .attr("titleTextStyleFontWeight", titleTextStyleFontWeight) + .attr("titleTextStyleFontFamily", titleTextStyleFontFamily) + .attr("titleTextStyleFontSize", titleTextStyleFontSize) + .attr("titleLeft", titleLeft) + + .attr("yAxisAxisLabelColor", yAxisAxisLabelColor) + .attr("yAxisAxisLabelFontStyle", yAxisAxisLabelFontStyle) + .attr("yAxisAxisLabelFontWeight", yAxisAxisLabelFontWeight) + .attr("yAxisAxisLabelFontFamily", yAxisAxisLabelFontFamily) + .attr("yAxisAxisLabelFontSize", yAxisAxisLabelFontSize) + + .attr("legendPosition", legendPosition) + .attr("colors", colorContent) + .attr("fillGapOption", fillGapOption) + .attr("fillGapColor", fillGapColor) + .attr("currentTimeLineOption", currentTimeLineOption) + .attr("currentTimeLineColor", currentTimeLineColor) + .attr("currentTimeLineWidth", currentTimeLineWidth) + .attr("displayScale", displayScale) + .attr("displayXScale", displayXScale) + .attr("animationOption", animationOption) + .attr("symbolType", symbolType) + .attr("symbolWidth", symbolWidth) + .attr("emphasisBorderColor", emphasisBorderColor) + .attr("emphasisBorderWidth", emphasisBorderWidth) + .attr("emphasisOption", emphasisOption) + .attr("projectCycleColor", projectCycleColor) + .attr("dataSort", dataSort) + + .attr("seriesNameTextStyleColor", seriesNameTextStyleColor) + .attr("seriesNameTextStyleFontFamily", seriesNameTextStyleFontFamily) + .attr("seriesNameTextStyleFontSize", seriesNameTextStyleFontSize) + + .attr("oddBackgroundColor", oddBackgroundColor) + .attr("evenBackgroundColor", evenBackgroundColor) + + ; + + + } + + private JSONArray createLinesData(List ganttDatas) { + JSONArray datas = new JSONArray(); + if ((ganttDatas == null) || (ganttDatas.size() <= 0)) { + return datas; + } + + /* + { + coords: [ + [900, 600], + [1000, 300] + ], + lineStyle: { + color: 'red' + } + }*/ + + CustomGanttData tempGanttData; + JSONObject objJson; + JSONArray coordsJsonArray; + JSONArray coordsData0JsonArray; + JSONArray coordsData1JsonArray; + JSONObject lineStyleJson; + + long x0 = 0, x1 = 0; + int y = 0; + for (int i = 0, max = ganttDatas.size() - 1; i <= max; i++) { + tempGanttData = ganttDatas.get(i); + if (CustomGanttData.SHOW_TYPE_FILL.equalsIgnoreCase(tempGanttData.showType)) { + continue; + } + + x0 = tempGanttData.beginDate; + x1 = (long) ((tempGanttData.endDate - tempGanttData.beginDate) * tempGanttData.schedule) + tempGanttData.beginDate; + y = tempGanttData.index; + + coordsData0JsonArray = new JSONArray(); + coordsData0JsonArray.add(x0); + coordsData0JsonArray.add(y); + + coordsData1JsonArray = new JSONArray(); + coordsData1JsonArray.add(x1); + coordsData1JsonArray.add(y); + + coordsJsonArray = new JSONArray(); + coordsJsonArray.add(coordsData0JsonArray); + coordsJsonArray.add(coordsData1JsonArray); + + lineStyleJson = new JSONObject(); + lineStyleJson.put("color", tempGanttData.completedColorHex); + + objJson = new JSONObject(); + objJson.put("coords", coordsJsonArray); + objJson.put("lineStyle", lineStyleJson); + datas.add(objJson); + } + return datas; + } + + + private List toColorList(String content) { + List tempColors = new ArrayList<>(); + if (StringKit.isEmpty(content)) { + return tempColors; + } + content = content.trim(); + if (StringKit.isEmpty(content)) { + return tempColors; + } + String[] tempArray = content.split(","); + if ((tempArray == null) || (tempArray.length <= 0)) { + return tempColors; + } + String tempValue; + int tempColorValue; + for (int i = 0, max = tempArray.length - 1; i <= max; i++) { + tempValue = tempArray[i]; + tempColorValue = Integer.valueOf(tempValue); + tempColors.add(tempColorValue); + } + + return tempColors; + } + + private String getColorContent() { + if ((this.colors == null) || (this.colors.size() <= 0)) { + return ""; + } + + String content = ""; + for (int i = 0, max = this.colors.size() - 1; i <= max; i++) { + content = content + this.colors.get(i); + if (i < max) { + content = content + ","; + } + } + return content; + } + + + /** + * 生成进度颜色 + * + * @param datas + * @return + */ + private List createSeriesDataColor(List datas, List projectNames, List suspendedDatas) { + if ((datas == null) || (datas.size() <= 0)) { + return datas; + } + + if ((projectNames == null) || (projectNames.size() <= 0)) { + return datas; + } + + List> groups = new ArrayList<>(); + for (int i = 0, max = projectNames.size() - 1; i <= max; i++) { + groups.add(new ArrayList()); + } + + CustomGanttData ganttData; + for (int i = 0, max = datas.size() - 1; i <= max; i++) { + ganttData = datas.get(i); + groups.get(ganttData.index).add(ganttData); + } + + List colors = new ArrayList<>(); + List grayColors = new ArrayList<>(); + + List colorValues = getColors(); + Color color, grayColor; + for (int i = 0, max = colorValues.size() - 1; i <= max; i++) { + color = new Color(colorValues.get(i)); + colors.add(color); + grayColor = ColorUtils.toDark(color); + grayColors.add(grayColor); + } + + if (colors.size() <= 0) { + color = Color.blue; + colors.add(color); + grayColor = ColorUtils.toDark(color); + grayColors.add(grayColor); + } + + // Collections.reverse(colors); + int colorSize = colors.size(); + List ganttDatas; + int tempValue = 0, tempIndex = 0; + long tempPrevEndDate = 0; + List tempDatas = new ArrayList<>(); + List tempGapDatas = new ArrayList<>(); + List tempSeriesDatas = new ArrayList<>(); + CustomGanttData tempGanttData; + List tempColors = new ArrayList<>(); + Color tempColor; + CustomGanttData tempSeriesGanttData; + CustomGanttData tempSeriesGanttData1; + long diffMinValue = 24 * 60 * 60 * 1000L, diffValue = 0; + for (int i = 0, max = groups.size() - 1; i <= max; i++) { + ganttDatas = groups.get(i); + Collections.sort(ganttDatas, new Comparator() { + @Override + public int compare(CustomGanttData o1, CustomGanttData o2) { + long diff = o1.beginDate - o2.beginDate; + if (diff > 0) { + return 1; + } else if (diff < 0) { + return -1; + } + return 0; + } + }); + + tempValue = max - i; + tempIndex = tempValue % colorSize; + color = colors.get(tempIndex); + if (isProjectCycleColor()) { + tempColors = ColorUtils.getCycleColors(colors, ganttDatas.size()); + } else { + tempColors = ColorUtils.getGradientColors(color, ganttDatas.size()); + } + int fillGapColorValue = this.fillGapColor; + String fillGapColorHexValue = CustomGanttDataFactory.rgbToHex(new Color(this.fillGapColor)); + tempPrevEndDate = 0; + tempSeriesDatas.clear(); + for (int j = 0, jMax = ganttDatas.size() - 1; j <= jMax; j++) { + tempColor = tempColors.get(j); + ganttData = ganttDatas.get(j); + ganttData.completedColor = tempColor.getRGB(); + ganttData.completedColorHex = CustomGanttDataFactory.rgbToHex(tempColor); + ganttData.days = getDiffDays(ganttData); + tempSeriesGanttData = (CustomGanttData) SerializationUtils.clone(ganttData); + if (j == 0) { + tempSeriesDatas.add(tempSeriesGanttData); + } else { + tempSeriesGanttData1 = tempSeriesDatas.get(tempSeriesDatas.size() - 1); + if ((tempSeriesGanttData1.beginDate <= tempSeriesGanttData.beginDate) && (tempSeriesGanttData1.endDate >= tempSeriesGanttData.beginDate)) { + if (tempSeriesGanttData1.endDate < tempSeriesGanttData.endDate) { + tempSeriesGanttData1.endDate = tempSeriesGanttData.endDate; + } + } else { + tempSeriesDatas.add(tempSeriesGanttData); + } + } + } + + for (int j = 0, jMax = tempSeriesDatas.size() - 1; j <= jMax; j++) { + ganttData = tempSeriesDatas.get(j); + diffValue = ganttData.beginDate - tempPrevEndDate; + if ((isFillGapOption()) && (j >= 1) && (tempPrevEndDate > 0) && (tempPrevEndDate < ganttData.beginDate) && (diffValue > diffMinValue)) { + tempGanttData = new CustomGanttData(); + tempGanttData.index = ganttData.index; + tempGanttData.showType = CustomGanttData.SHOW_TYPE_FILL; + tempGanttData.beginDate = tempPrevEndDate; + tempGanttData.endDate = ganttData.beginDate; + tempGanttData.completedColor = fillGapColorValue; + tempGanttData.completedColorHex = fillGapColorHexValue; + tempGanttData.days = getDiffDays(tempGanttData); + tempGanttData.middleValue = (tempGanttData.endDate + tempGanttData.beginDate) / 2; + tempGanttData.beginDateShow = CustomGanttDataFactory.timestampToDate(tempGanttData.beginDate); + tempGanttData.endDateShow = CustomGanttDataFactory.timestampToDate(tempGanttData.endDate); + tempDatas.add(tempGanttData); + } + + if ((isFillGapOption()) && currentTimeLineVisible && (j == 0) && (currentTimestampValue < ganttData.beginDate) && ((ganttData.beginDate - currentTimestampValue) > diffMinValue)) { + tempGanttData = new CustomGanttData(); + tempGanttData.index = ganttData.index; + tempGanttData.showType = CustomGanttData.SHOW_TYPE_FILL; + tempGanttData.beginDate = currentTimestampValue; + tempGanttData.endDate = ganttData.beginDate; + tempGanttData.completedColor = fillGapColorValue; + tempGanttData.completedColorHex = fillGapColorHexValue; + tempGanttData.days = getDiffDays(tempGanttData); + tempGanttData.middleValue = (tempGanttData.endDate + tempGanttData.beginDate) / 2; + tempGanttData.beginDateShow = CustomGanttDataFactory.timestampToDate(tempGanttData.beginDate); + tempGanttData.endDateShow = CustomGanttDataFactory.timestampToDate(tempGanttData.endDate); + tempDatas.add(tempGanttData); + } + tempPrevEndDate = ganttData.endDate; + } + } + suspendedDatas.addAll(tempDatas); + datas.addAll(tempDatas); + return datas; + } + + private int getDiffDays(CustomGanttData ganttData) { + if (ganttData == null) { + return 0; + } + long diffMinValue = 24 * 60 * 60 * 1000L; + int days = (int) ((ganttData.endDate - ganttData.beginDate) / diffMinValue + 1); + return days; + } + + private static final HyperLinkPara categoryHyperLinkPara = new HyperLinkPara() { + @Override + public String getName() { + return "分类"; + } + + @Override + public String getFormulaContent() { + return "category"; + } + + @Override + public String[] getProps() { + return new String[]{"data", "category"}; + } + }; + + private static final HyperLinkPara seriesHyperLinkPara = new HyperLinkPara() { + @Override + public String getName() { + return "系列名"; + } + + @Override + public String getFormulaContent() { + return "series"; + } + + @Override + public String[] getProps() { + return new String[]{"data", "originalName"}; + } + }; + + private static final HyperLinkPara seriesValueHyperLinkPara = new HyperLinkPara() { + @Override + public String getName() { + return "系列名值"; + } + + @Override + public String getFormulaContent() { + return "seriesValue"; + } + + @Override + public String[] getProps() { + return new String[]{"data", "seriesValue"}; + } + }; + + @Override + protected HyperLinkPara[] hyperLinkParas() { + return new HyperLinkPara[]{ + categoryHyperLinkPara, + seriesHyperLinkPara, + seriesValueHyperLinkPara + }; + } + + +} diff --git a/src/main/java/com/fr/plugin/third/party/jsdibjj/CustomGanttData.java b/src/main/java/com/fr/plugin/third/party/jsdibjj/CustomGanttData.java new file mode 100644 index 0000000..1466e7f --- /dev/null +++ b/src/main/java/com/fr/plugin/third/party/jsdibjj/CustomGanttData.java @@ -0,0 +1,51 @@ +package com.fr.plugin.third.party.jsdibjj; + +import java.io.Serializable; + +public class CustomGanttData implements Serializable, Cloneable { + public static String SHOW_TYPE_SERIES = "SERIES"; + public static String SHOW_TYPE_FILL = "FILL"; + public static String SHOW_TYPE_BACKGROUND = "BACKGROUND"; + public static String SHOW_TYPE_IMAGE = "IMAGE"; + + public int index = 0; + public long beginDate = 0; + public long endDate = 0; + + public String beginDateShow = ""; + public String endDateShow = ""; + + public long milestoneDate = 0; + public double schedule = 0; + public String scheduleShow = ""; + public String showName = ""; + public String category = ""; + public String originalName = ""; + public String seriesValue = ""; + public String milestoneInfo =""; + + /** + * 已完成颜色 + */ + public int completedColor = 0; + public String completedColorHex = ""; + /** + * 未完成颜色 + */ + public int incompleteColor = 0; + public String incompleteColorHex = ""; + + public long prevEndDate = 0; + public boolean visible = true; + public String showType = SHOW_TYPE_SERIES; + + public int days = 0; + + /*脱节的中间值,主要为脱节闪烁用的*/ + public long middleValue = 0; + + @Override + public String toString() { + return this.showName + ":" + this.beginDateShow + "-" + this.endDateShow; + } +} diff --git a/src/main/java/com/fr/plugin/third/party/jsdibjj/CustomGanttDataFactory.java b/src/main/java/com/fr/plugin/third/party/jsdibjj/CustomGanttDataFactory.java new file mode 100644 index 0000000..166c24a --- /dev/null +++ b/src/main/java/com/fr/plugin/third/party/jsdibjj/CustomGanttDataFactory.java @@ -0,0 +1,510 @@ +package com.fr.plugin.third.party.jsdibjj; + +import com.fanruan.api.log.LogKit; +import com.fanruan.api.util.StringKit; +import com.fr.general.GeneralUtils; +import com.fr.json.JSON; +import com.fr.json.JSONArray; +import com.fr.json.JSONFactory; +import com.fr.json.JSONObject; +import com.fr.plugin.third.party.jsdibjj.data.CustomGanttColumnFieldCollection; + +import java.awt.*; +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.List; + +public class CustomGanttDataFactory { + public static synchronized List createProjectNames(CustomGanttColumnFieldCollection dataSource) { + List projectList = new ArrayList<>(); + if (dataSource == null) { + return projectList; + } + List projectNames = dataSource.getProjectName().getValues(); + int size = projectNames.size(); + if (size <= 0) { + return projectList; + } + String tempValue; + Object tempObj; + + for (int i = 0, max = size - 1; i <= max; i++) { + tempObj = projectNames.get(i); + if (tempObj == null) { + tempValue = ""; + addNotRepeatingObj(tempValue, projectList); + continue; + } + tempValue = GeneralUtils.objectToString(tempObj); + addNotRepeatingObj(tempValue, projectList); + } + Collections.reverse(projectList); + return projectList; + } + + public static synchronized JSONArray createJsonData(CustomGanttColumnFieldCollection dataSource, CustomGanttChart ganttChartConf) { + List datas = createData(dataSource); + return createJsonData(dataSource, datas, ganttChartConf); + } + + + public static synchronized JSONArray createFlashingData(List datas) { + JSONArray jsonContent = JSONFactory.createJSON(JSON.ARRAY); + if ((datas == null) || (datas.size() <= 0)) { + return jsonContent; + } + JSONArray jsonArray; + CustomGanttData ganttData; + for (int i = 0, max = datas.size() - 1; i <= max; i++) { + ganttData = datas.get(i); + if (!StringKit.equals(ganttData.showType, CustomGanttData.SHOW_TYPE_FILL)) { + continue; + } + jsonArray = JSONFactory.createJSON(JSON.ARRAY); + jsonArray.put(ganttData.index); + jsonArray.put(ganttData.middleValue); + JSONObject valueJson = JSONFactory.createJSON(JSON.OBJECT); + valueJson.put("value", jsonArray); + jsonContent.put(valueJson); + } + return jsonContent; + } + + public static synchronized JSONArray createJsonData(CustomGanttColumnFieldCollection dataSource, List datas, CustomGanttChart ganttChartConf) { + JSONArray jsonContent = JSONFactory.createJSON(JSON.ARRAY); + if ((datas == null) || (datas.size() <= 0)) { + return jsonContent; + } + JSONObject jsonObject; + JSONArray jsonArray; + CustomGanttData ganttData; + + JSONObject emphasisJson = JSONFactory.createJSON(JSON.OBJECT); + if (ganttChartConf.isEmphasisOption()) { + JSONObject itemStyleJson = JSONFactory.createJSON(JSON.OBJECT); + itemStyleJson.put("borderColor", rgbToHex(new Color(ganttChartConf.getEmphasisBorderColor()))); + itemStyleJson.put("borderWidth", ganttChartConf.getEmphasisBorderWidth()); + itemStyleJson.put("borderType", "solid"); + //itemStyleJson.put("borderWidth",2); + emphasisJson.put("itemStyle", itemStyleJson); + } + /* + JSONObject itemStyleJson = JSONFactory.createJSON(JSON.OBJECT).put("normal", JSONFactory.createJSON(JSON.OBJECT).put("color", "#7b9ce1")); + JSONObject emphasisJson = JSONFactory.createJSON(JSON.OBJECT); + emphasisJson.put("borderColor", "red"); + emphasisJson.put("borderWidth", 20); + emphasisJson.put("borderType", "solid"); + itemStyleJson.put("","")*/ + + for (int i = 0, max = datas.size() - 1; i <= max; i++) { + ganttData = datas.get(i); + jsonObject = JSONFactory.createJSON(JSON.OBJECT); + jsonObject.put("category", ganttData.category); + jsonObject.put("name", ganttData.showName); + jsonObject.put("originalName", ganttData.originalName); + jsonObject.put("showType", ganttData.showType); + jsonObject.put("days", ganttData.days); + jsonObject.put("beginDateShow", ganttData.beginDateShow); + jsonObject.put("endDateShow", ganttData.endDateShow); + jsonObject.put("middleValue", ganttData.middleValue); + jsonObject.put("seriesValue", ganttData.seriesValue); + + jsonArray = JSONFactory.createJSON(JSON.ARRAY); + jsonArray.put(ganttData.index); + jsonArray.put(ganttData.beginDate); + jsonArray.put(ganttData.endDate); + jsonArray.put(ganttData.showName); + jsonArray.put(ganttData.milestoneDate); + jsonArray.put(ganttData.schedule); + jsonArray.put(ganttData.completedColorHex); + jsonArray.put(ganttData.incompleteColorHex); + jsonArray.put(ganttData.scheduleShow); + jsonArray.put(ganttData.showType); + jsonArray.put(ganttData.middleValue); + jsonArray.put(ganttData.seriesValue); + jsonObject.put("value", jsonArray); + jsonObject.put("itemStyle", JSONFactory.createJSON(JSON.OBJECT).put("normal", JSONFactory.createJSON(JSON.OBJECT).put("color", "#7b9ce1"))); + jsonObject.put("emphasis", emphasisJson); + jsonContent.put(jsonObject); + } + return jsonContent; + } + + public static synchronized long createMinTimestamp(CustomGanttColumnFieldCollection dataSource) { + List beginDates = dataSource.getBeginDate().getValues(); + int size = beginDates.size(); + if (size <= 0) { + return 0; + } + Calendar cal = Calendar.getInstance(); + cal.set(2999, 1, 1); + long minTimestamp = cal.getTimeInMillis(); + ; + long tempTimestamp = 0; + int count = 0; + for (int i = 0, max = size - 1; i <= max; i++) { + tempTimestamp = objectToTimestamp(beginDates.get(i)); + if (minTimestamp > tempTimestamp) { + minTimestamp = tempTimestamp; + count++; + } + } + if (count <= 0) { + return 0; + } + return minTimestamp; + } + + + public static synchronized long createMaxTimestamp(CustomGanttColumnFieldCollection dataSource) { + List endDates = dataSource.getEndDate().getValues(); + int size = endDates.size(); + if (size <= 0) { + return 0; + } + Calendar cal = Calendar.getInstance(); + cal.set(1000, 1, 1); + + long maxTimestamp = cal.getTimeInMillis(); + long tempTimestamp = 0; + int count = 0; + for (int i = 0, max = size - 1; i <= max; i++) { + tempTimestamp = objectToTimestamp(endDates.get(i)); + if (maxTimestamp < tempTimestamp) { + maxTimestamp = tempTimestamp; + count++; + } + } + if (count <= 0) { + return 0; + } + return maxTimestamp; + } + + public static synchronized List createData(CustomGanttColumnFieldCollection dataSource) { + List datas = new ArrayList<>(); + List projectList = createProjectNames(dataSource); + if (projectList.size() <= 0) { + return datas; + } + List projectNames = dataSource.getProjectName().getValues(); + List seriesNames = dataSource.getSeriesName().getValues(); + List seriesValues = dataSource.getSeriesValue().getValues(); + List beginDates = dataSource.getBeginDate().getValues(); + List endDates = dataSource.getEndDate().getValues(); + List schedules = dataSource.getSchedule().getValues(); + int size = projectNames.size(); + if (size <= 0) { + return datas; + } + String projectName, seriesName; + CustomGanttData ganttData; + for (int i = 0, max = size - 1; i <= max; i++) { + projectName = objectToString(projectNames.get(i)); + seriesName = objectToString(seriesNames.get(i)); + ganttData = new CustomGanttData(); + ganttData.category = projectName; + ganttData.index = getIndex(projectName, projectList); + ganttData.showName = createSeriesName(seriesName); + ganttData.originalName = seriesName; + ganttData.schedule = objectToRate(schedules.get(i)); + ganttData.scheduleShow = objectToRateShow(ganttData.schedule); + ganttData.beginDate = objectToTimestamp(beginDates.get(i)); + ganttData.endDate = objectToTimestamp(endDates.get(i)); + ganttData.beginDateShow = String.valueOf(beginDates.get(i)); + ganttData.endDateShow = String.valueOf(endDates.get(i)); + ganttData.seriesValue = String.valueOf(seriesValues.get(i)); + if ((ganttData.beginDate <= 0) || (ganttData.endDate <= 0)) { + LogKit.error("甘特图定制,解析开始时间或结束时间出错"); + return new ArrayList(); + } + datas.add(ganttData); + } + + return datas; + } + + + public static synchronized List createMilestoneDatas(CustomGanttColumnFieldCollection dataSource) { + List datas = new ArrayList<>(); + List projectList = createProjectNames(dataSource); + if (projectList.size() <= 0) { + return datas; + } + List projectNames = dataSource.getProjectName().getValues(); + List seriesNames = dataSource.getSeriesName().getValues(); + List seriesValues = dataSource.getSeriesValue().getValues(); + List beginDates = dataSource.getBeginDate().getValues(); + List endDates = dataSource.getEndDate().getValues(); + List schedules = dataSource.getSchedule().getValues(); + List milestoneDates = dataSource.getMilestoneDate().getValues(); + List milestoneIcons = dataSource.getMilestoneIcon().getValues(); + List milestoneInfos = dataSource.getMilestoneInfo().getValues(); + int size = projectNames.size(); + if (size <= 0) { + return datas; + } + + if (milestoneDates.size() <= 0) { + return datas; + } + + if (milestoneIcons.size() <= 0) { + return datas; + } + + String projectName, seriesName; + CustomGanttData ganttData; + String path; + for (int i = 0, max = size - 1; i <= max; i++) { + projectName = objectToString(projectNames.get(i)); + seriesName = objectToString(seriesNames.get(i)); + ganttData = new CustomGanttData(); + ganttData.category = projectName; + ganttData.index = getIndex(projectName, projectList); + ganttData.showName = createSeriesName(seriesName); + ganttData.originalName = seriesName; + ganttData.schedule = 0; + ganttData.scheduleShow = getIconPath(i, milestoneInfos); + ganttData.beginDate = objectToTimestamp(milestoneDates.get(i)); + ganttData.endDate = objectToTimestamp(milestoneDates.get(i)); + ganttData.beginDateShow = String.valueOf(milestoneDates.get(i));; + ganttData.endDateShow = ""; + path = getIconPath(i, milestoneIcons); + if (StringKit.isEmpty(path)) { + continue; + } + ganttData.seriesValue = path; + + if ((ganttData.beginDate <= 0) || (ganttData.endDate <= 0)) { + continue; + } + ganttData.showType = CustomGanttData.SHOW_TYPE_IMAGE; + datas.add(ganttData); + } + + return datas; + } + + public static synchronized JSONArray createMilestoneData(CustomGanttColumnFieldCollection dataSource) { + JSONArray dataArray = new JSONArray(); + + List projectList = createProjectNames(dataSource); + if (projectList.size() <= 0) { + return dataArray; + } + List projectNames = dataSource.getProjectName().getValues(); + List milestoneDates = dataSource.getMilestoneDate().getValues(); + List milestoneIcons = dataSource.getMilestoneIcon().getValues(); + int size = projectNames.size(); + if (size <= 0) { + return dataArray; + } + + if (milestoneDates.size() <= 0) { + return dataArray; + } + String projectName; + int x; + long y; + String type = ""; + String path = ""; + JSONObject milestoneJson; + for (int i = 0, max = size - 1; i <= max; i++) { + projectName = objectToString(projectNames.get(i)); + x = getIndex(projectName, projectList); + y = objectToTimestamp(milestoneDates.get(i)); + if (y <= 0) { + continue; + } + type = "diamond"; + path = getIconPath(i, milestoneIcons); + if (StringKit.isNotEmpty(path)) { + type = "image"; + } + milestoneJson = new JSONObject(); + milestoneJson.put("x", x); + milestoneJson.put("y", y); + milestoneJson.put("type", type); + milestoneJson.put("path", path); + dataArray.add(milestoneJson); + } + return dataArray; + } + + private static String getIconPath(int index, List icons) { + if (index < 0) { + return ""; + } + if ((icons == null) || (icons.size() <= 0) || (index >= icons.size())) { + return ""; + } + + String path = String.valueOf(icons.get(index)); + path = StringKit.trim(path); + if (StringKit.isEmpty(path)) { + return ""; + } + return path; + } + + + /** + * 针对echarts的bug处理,若系列名称有数字,有中文,会默认按数字处理,有中文会显示NaN,故在前面加中文处理 + * + * @param name + * @return + */ + private static String createSeriesName(String name) { + String tempName = name; + if (StringKit.isEmpty(name)) { + tempName = ""; + } + return "甘特图" + tempName; + } + + private static synchronized String objectToString(Object obj) { + String tempValue = GeneralUtils.objectToString(obj); + return tempValue; + } + + + private static ThreadLocal threadLocalFormat = new ThreadLocal() { + @Override + protected SimpleDateFormat initialValue() { + return new SimpleDateFormat("yyyy-MM-dd"); + } + }; + + private static ThreadLocal threadLocalFormat1 = new ThreadLocal() { + @Override + protected SimpleDateFormat initialValue() { + return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + } + }; + + public static synchronized String timestampToDate(long value) { + Date date = new Date(value); + return threadLocalFormat.get().format(date); + } + + /** + * 转为时间戳 + * + * @param obj + * @return + */ + private static synchronized long objectToTimestamp(Object obj) { + if (obj == null) { + return 0; + } + + Date tempDate = null; + if (obj instanceof Date) { + tempDate = (Date) obj; + return tempDate.getTime(); + } + + String tempValue = GeneralUtils.objectToString(obj); + if (StringKit.isEmpty(tempValue)) { + return 0; + } + int length = tempValue.length(); + try { + if (length == 10) { + tempDate = threadLocalFormat.get().parse(tempValue); + } else if (length == 19) { + tempDate = threadLocalFormat1.get().parse(tempValue); + } + } catch (Exception e) { + return 0; + } + if (tempDate != null) { + return tempDate.getTime(); + } + return 0; + } + + /** + * 转为0-1的四位小数 + * + * @param obj + * @return + */ + private static synchronized double objectToRate(Object obj) { + if (obj == null) { + return 0; + } + + double tempValue = 0; + if (obj instanceof Double) { + tempValue = (Double) obj; + } else { + String tempContent = objectToString(obj); + if (StringKit.isEmpty(tempContent)) { + return 0; + } + tempContent = tempContent.trim(); + if (StringKit.isEmpty(tempContent)) { + return 0; + } + tempValue = Double.valueOf(tempContent); + } + + if (tempValue <= 0) { + return 0; + } + + if (tempValue >= 1) { + return 1; + } + BigDecimal bigDecimal = new BigDecimal(String.valueOf(tempValue)); + tempValue = bigDecimal.setScale(4, BigDecimal.ROUND_HALF_UP).doubleValue(); + return tempValue; + } + + private static synchronized String objectToRateShow(double value) { + BigDecimal bigDecimal = new BigDecimal(String.valueOf(value)); + BigDecimal bigDecimal1 = new BigDecimal("100"); + String tempValue = bigDecimal.multiply(bigDecimal1).doubleValue() + "%"; + return tempValue; + } + + private static synchronized void addNotRepeatingObj(String value, List values) { + String tempValue = value; + if (StringKit.isEmpty(tempValue)) { + tempValue = ""; + } + if (values.contains(tempValue)) { + return; + } + values.add(tempValue); + } + + private static synchronized int getIndex(String value, List values) { + int index = values.indexOf(value); + return index; + } + + + public static String rgbToHex(Color color) { + if (color == null) { + return "#000000"; + } + String value = "#" + String.format("%02X", color.getRed()) + String.format("%02X", color.getGreen()) + String.format("%02X", color.getBlue()); + return value; + } + + + public static Color colorToGray(Color color) { + if (color == null) { + return new Color(0); + } + + int gray = (int) ((color.getRed() * 30 + color.getGreen() * 59 + color.getBlue() * 11 + 50) * 0.01); + return new Color(gray); + } + + +} diff --git a/src/main/java/com/fr/plugin/third/party/jsdibjj/CustomGanttType.java b/src/main/java/com/fr/plugin/third/party/jsdibjj/CustomGanttType.java new file mode 100644 index 0000000..51ad1e2 --- /dev/null +++ b/src/main/java/com/fr/plugin/third/party/jsdibjj/CustomGanttType.java @@ -0,0 +1,56 @@ +package com.fr.plugin.third.party.jsdibjj; + +import com.fanruan.api.report.chart.BaseChartType; +import com.fanruan.api.report.chart.BaseChartWithData; +import com.fr.intelli.record.Focus; +import com.fr.intelli.record.Original; +import com.fr.record.analyzer.EnableMetrics; + +@EnableMetrics +public class CustomGanttType extends BaseChartType { + + /** + * 该种图表所有的图表对象实例,比如柱形图就有堆积柱形图,百分比堆积柱形图等等 + * + * @return 所有的图表对象实例 + */ + @Focus(id = "com.fr.plugin.third.party.jsd8199", text = "plugin-jsd-8199", source = Original.PLUGIN) + public BaseChartWithData[] getChartTypes() { + return new BaseChartWithData[]{ + new CustomGanttChart() + }; + } + + /** + * 图表在web端展现时需要的JS文件 + * + * @return JS文件数组 + */ + public String[] getRequiredJS() { + return new String[]{ + "com/fr/plugin/third/party/jsdibjj/web/echarts.min.js", + "com/fr/plugin/third/party/jsdibjj/web/customGanttPlusWrapper.js" + }; + } + + /** + * 图表在web端展现时需要的CSS文件 + * + * @return CSS文件数组 + */ + public String[] getRequiredCss() { + return new String[]{ + "com/fr/plugin/third/party/jsdibjj/web/customGanttPlus.css" + }; + } + + /** + * JS对象名,该对象一般是一个函数,执行后会在给定的dom中绘制图表 + * + * @return JS对象名 + */ + public String getWrapperName() { + return "customGanttPlusWrapper"; + } + +} diff --git a/src/main/java/com/fr/plugin/third/party/jsdibjj/CustomGanttUI.java b/src/main/java/com/fr/plugin/third/party/jsdibjj/CustomGanttUI.java new file mode 100644 index 0000000..3771b31 --- /dev/null +++ b/src/main/java/com/fr/plugin/third/party/jsdibjj/CustomGanttUI.java @@ -0,0 +1,60 @@ +package com.fr.plugin.third.party.jsdibjj; + +import com.fanruan.api.design.chart.*; +import com.fr.design.gui.frpane.AttributeChangeListener; +import com.fr.plugin.third.party.jsdibjj.data.CustomGanttDataCellFieldsPane; +import com.fr.plugin.third.party.jsdibjj.data.CustomGanttDataSetFieldsPane; +import com.fr.plugin.third.party.jsdibjj.ui.CustomGanttShowSettingsPane; +import com.fr.plugin.third.party.jsdibjj.ui.CustomGanttTitlePane; +import com.fr.plugin.third.party.jsdibjj.ui.CustomGanttTypePane; + + +public class CustomGanttUI extends BaseChartTypeUI { + public String CHART_NAME = "甘特图定制"; + + @Override + public DefaultTypePane getPlotTypePane() { + return new CustomGanttTypePane(); + } + + @Override + public BaseDataPane getChartDataPane(AttributeChangeListener listener) { + return new BaseDataPane(listener) { + @Override + protected SingleDataPane createSingleDataPane() { + return new SingleDataPane(new CustomGanttDataSetFieldsPane(), + new CustomGanttDataCellFieldsPane() + ); + } + }; + } + + @Override + public BaseOtherPane[] getAttrPaneArray(AttributeChangeListener listener) { + return new BaseOtherPane[]{new CustomGanttTitlePane(), new CustomGanttShowSettingsPane(), new DefaultOtherPane()}; + } + + @Override + public String getIconPath() { + return "com/fr/plugin/third/party/jsdibjj/images/chart_icon.png"; + } + + @Override + public String getName() { + return CHART_NAME; + } + + @Override + public String[] getSubName() { + return new String[]{ + CHART_NAME + }; + } + + @Override + public String[] getDemoImagePath() { + return new String[]{ + "com/fr/plugin/third/party/jsdibjj/images/chart_type_demo.png" + }; + } +} diff --git a/src/main/java/com/fr/plugin/third/party/jsdibjj/PieType.java b/src/main/java/com/fr/plugin/third/party/jsdibjj/PieType.java new file mode 100644 index 0000000..2711406 --- /dev/null +++ b/src/main/java/com/fr/plugin/third/party/jsdibjj/PieType.java @@ -0,0 +1,20 @@ +package com.fr.plugin.third.party.jsdibjj; + +/** + * @author fr.open + * @version 10.0 + * Created by fr.open on 2019-09-05 + */ +public enum PieType { + PIE, + RING; + + public static PieType parseInt(int index) { + for (PieType type : PieType.values()) { + if (type.ordinal() == index) { + return type; + } + } + return PIE; + } +} diff --git a/src/main/java/com/fr/plugin/third/party/jsdibjj/UIComboBoxWithNone.java b/src/main/java/com/fr/plugin/third/party/jsdibjj/UIComboBoxWithNone.java new file mode 100644 index 0000000..5a82c69 --- /dev/null +++ b/src/main/java/com/fr/plugin/third/party/jsdibjj/UIComboBoxWithNone.java @@ -0,0 +1,39 @@ +package com.fr.plugin.third.party.jsdibjj; + + +import com.fanruan.api.design.ui.component.UIComboBox; +import com.fr.design.i18n.Toolkit; + +import java.util.List; + +public class UIComboBoxWithNone extends UIComboBox { + protected String getDefaultLocaleString() { + return Toolkit.i18nText("Fine-Design_Chart_Use_None"); + } + + public UIComboBoxWithNone() { + this.addDefaultItem(); + } + + public void refreshBoxItems(List var1) { + super.refreshBoxItems(var1); + this.addDefaultItem(); + } + + public void clearBoxItems() { + super.clearBoxItems(); + this.addDefaultItem(); + } + + private void addDefaultItem() { + this.addItem(this.getDefaultLocaleString()); + } + + public void setSelectedItem(Object var1) { + super.setSelectedItem(var1); + if (this.getSelectedIndex() == -1) { + super.setSelectedItem(this.getDefaultLocaleString()); + } + + } +} \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/third/party/jsdibjj/color/ColorUtils.java b/src/main/java/com/fr/plugin/third/party/jsdibjj/color/ColorUtils.java new file mode 100644 index 0000000..61c1dd1 --- /dev/null +++ b/src/main/java/com/fr/plugin/third/party/jsdibjj/color/ColorUtils.java @@ -0,0 +1,220 @@ +package com.fr.plugin.third.party.jsdibjj.color; + + +import java.awt.Color; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class ColorUtils { + /** + * 颜色变暗 + * + * @param color + * @return + */ + public static Color toDark(Color color) { + if (color == null) { + return Color.black; + } + float[] hsb = rgb2hsb(color.getRed(), color.getGreen(), color.getBlue()); + float h = hsb[0]; + float s = hsb[1]; + float b = hsb[2]; + if (s >= 0.5) { + s = (float) (s - 0.5); + } else { + s = 0; + } + int[] rgb = hsb2rgb(h, s, b); + Color tempColor = new Color(rgb[0], rgb[2], rgb[2]); + return tempColor; + } + + public static float[] rgb2hsb(int rgbR, int rgbG, int rgbB) { + assert 0 <= rgbR && rgbR <= 255; + assert 0 <= rgbG && rgbG <= 255; + assert 0 <= rgbB && rgbB <= 255; + int[] rgb = new int[]{rgbR, rgbG, rgbB}; + Arrays.sort(rgb); + int max = rgb[2]; + int min = rgb[0]; + + float hsbB = max / 255.0f; + float hsbS = max == 0 ? 0 : (max - min) / (float) max; + + float hsbH = 0; + if (max == rgbR && rgbG >= rgbB) { + hsbH = (rgbG - rgbB) * 60f / (max - min) + 0; + } else if (max == rgbR && rgbG < rgbB) { + hsbH = (rgbG - rgbB) * 60f / (max - min) + 360; + } else if (max == rgbG) { + hsbH = (rgbB - rgbR) * 60f / (max - min) + 120; + } else if (max == rgbB) { + hsbH = (rgbR - rgbG) * 60f / (max - min) + 240; + } + + return new float[]{hsbH, hsbS, hsbB}; + } + + public static int[] hsb2rgb(float h, float s, float v) { + assert Float.compare(h, 0.0f) >= 0 && Float.compare(h, 360.0f) <= 0; + assert Float.compare(s, 0.0f) >= 0 && Float.compare(s, 1.0f) <= 0; + assert Float.compare(v, 0.0f) >= 0 && Float.compare(v, 1.0f) <= 0; + + float r = 0, g = 0, b = 0; + int i = (int) ((h / 60) % 6); + float f = (h / 60) - i; + float p = v * (1 - s); + float q = v * (1 - f * s); + float t = v * (1 - (1 - f) * s); + switch (i) { + case 0: + r = v; + g = t; + b = p; + break; + case 1: + r = q; + g = v; + b = p; + break; + case 2: + r = p; + g = v; + b = t; + break; + case 3: + r = p; + g = q; + b = v; + break; + case 4: + r = t; + g = p; + b = v; + break; + case 5: + r = v; + g = p; + b = q; + break; + default: + break; + } + return new int[]{(int) (r * 255.0), (int) (g * 255.0), + (int) (b * 255.0)}; + } + + /** + * 获取渐变颜色 当前颜色到 红绿蓝 渐变 + * + * @param color + * @param count + * @return + */ + public static List getGradientColors(Color color, int count) { + List colors = new ArrayList<>(); + if (count <= 0) { + return colors; + } + if (count <= 1) { + count = 1; + } + int max = count - 1; + if (color == null) { + for (int i = 0; i <= max; i++) { + colors.add(Color.black); + } + return colors; + } + if (count == 1) { + colors.add(color); + return colors; + } + + Color endColor = new Color(220, 220, 220); + endColor = Color.RED; + + int maxStep = Math.abs(Math.abs(color.getRGB()) - Math.abs(endColor.getRGB())); + int tempStep = Math.abs(Math.abs(color.getRGB()) - Math.abs(Color.GREEN.getRGB())); + if (tempStep >= maxStep) { + maxStep = tempStep; + endColor = Color.GREEN; + } + + tempStep = Math.abs(Math.abs(color.getRGB()) - Math.abs(Color.BLUE.getRGB())); + if (tempStep >= maxStep) { + maxStep = tempStep; + endColor = Color.BLUE; + } + endColor = new Color(220, 220, 220); + double redStep = (endColor.getRed() - color.getRed()) / (count + 1); + double greenStep = (endColor.getGreen() - color.getGreen()) / (count + 1); + double blueStep = (endColor.getBlue() - color.getBlue()) / (count + 1); + + int redValue = color.getRed(); + int greenValue = color.getGreen(); + int blueValue = color.getBlue(); + + double redTempValue = color.getRed(); + double greenTempValue = color.getGreen(); + double blueTempValue = color.getBlue(); + + Color tempColor = null; + for (int i = 0; i <= max; i++) { + if (redValue >= 255) { + redValue = 255; + } + if (greenValue >= 255) { + greenValue = 255; + } + if (blueValue >= 255) { + blueValue = 255; + } + tempColor = new Color(redValue, greenValue, blueValue); + colors.add(tempColor); + redTempValue = (redTempValue + redStep); + greenTempValue = (greenTempValue + greenStep); + blueTempValue = (blueTempValue + blueStep); + redValue = (int) redTempValue; + greenValue = (int) greenTempValue; + blueValue = (int) blueTempValue; + } + return colors; + } + + + /** + * 获取循环颜色 + * + * @param confColors + * @param count + * @return + */ + public static List getCycleColors(List confColors, int count) { + List colors = new ArrayList<>(); + if (count <= 0) { + return colors; + } + if (count <= 1) { + count = 1; + } + int max = count - 1; + if ((confColors == null) || (confColors.size() <= 0)) { + for (int i = 0; i <= max; i++) { + colors.add(Color.black); + } + return colors; + } + int size = confColors.size(); + int index = 0; + for (int i = 0; i <= max; i++) { + index = i % size; + colors.add(confColors.get(index)); + } + return colors; + } + + +} diff --git a/src/main/java/com/fr/plugin/third/party/jsdibjj/data/CustomGanttColumnFieldCollection.java b/src/main/java/com/fr/plugin/third/party/jsdibjj/data/CustomGanttColumnFieldCollection.java new file mode 100644 index 0000000..9d15db6 --- /dev/null +++ b/src/main/java/com/fr/plugin/third/party/jsdibjj/data/CustomGanttColumnFieldCollection.java @@ -0,0 +1,135 @@ +package com.fr.plugin.third.party.jsdibjj.data; + +import com.fanruan.api.report.chart.field.BaseColumnFieldCollection; +import com.fr.chartx.data.annotations.KeyField; +import com.fr.chartx.data.field.ColumnField; + + +public class CustomGanttColumnFieldCollection extends BaseColumnFieldCollection { + + + /** + * 项目名称 + */ + //@KeyField + private ColumnField projectName = new ColumnField(); + + + /** + * 系列值 + */ + // @KeyField + private ColumnField seriesValue = new ColumnField(); + + + /** + * 系列名称 + */ + //@KeyField + private ColumnField seriesName = new ColumnField(); + + /** + * 开始时间 + */ + private ColumnField beginDate = new ColumnField(); + /** + * 结束时间 + */ + private ColumnField endDate = new ColumnField(); + + /** + * 里程碑时间 + */ + private ColumnField milestoneDate = new ColumnField(); + + + /** + * 里程碑图片 + */ + private ColumnField milestoneIcon = new ColumnField(); + + + /** + * 里程碑信息 + */ + private ColumnField milestoneInfo = new ColumnField(); + + /** + * 进度 + */ + private ColumnField schedule = new ColumnField(); + + + public ColumnField getProjectName() { + return projectName; + } + + public void setProjectName(ColumnField projectName) { + this.projectName = projectName; + } + + + public ColumnField getSeriesValue() { + return seriesValue; + } + + public void setSeriesValue(ColumnField seriesValue) { + this.seriesValue = seriesValue; + } + + public ColumnField getSeriesName() { + return seriesName; + } + + public void setSeriesName(ColumnField seriesName) { + this.seriesName = seriesName; + } + + public ColumnField getBeginDate() { + return beginDate; + } + + public void setBeginDate(ColumnField beginDate) { + this.beginDate = beginDate; + } + + public ColumnField getEndDate() { + return endDate; + } + + public void setEndDate(ColumnField endDate) { + this.endDate = endDate; + } + + public ColumnField getMilestoneDate() { + return milestoneDate; + } + + public void setMilestoneDate(ColumnField milestoneDate) { + this.milestoneDate = milestoneDate; + } + + public ColumnField getSchedule() { + return schedule; + } + + public void setSchedule(ColumnField schedule) { + this.schedule = schedule; + } + + public ColumnField getMilestoneIcon() { + return milestoneIcon; + } + + public void setMilestoneIcon(ColumnField milestoneIcon) { + this.milestoneIcon = milestoneIcon; + } + + public ColumnField getMilestoneInfo() { + return milestoneInfo; + } + + public void setMilestoneInfo(ColumnField milestoneInfo) { + this.milestoneInfo = milestoneInfo; + } +} \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/third/party/jsdibjj/data/CustomGanttDataCellFieldsPane.java b/src/main/java/com/fr/plugin/third/party/jsdibjj/data/CustomGanttDataCellFieldsPane.java new file mode 100644 index 0000000..a7d8b29 --- /dev/null +++ b/src/main/java/com/fr/plugin/third/party/jsdibjj/data/CustomGanttDataCellFieldsPane.java @@ -0,0 +1,96 @@ +package com.fr.plugin.third.party.jsdibjj.data; + +import com.fanruan.api.design.chart.field.BaseCellDataFieldsPane; +import com.fanruan.api.design.ui.component.formula.UIFormulaTextField; + +import java.awt.*; + +public class CustomGanttDataCellFieldsPane extends BaseCellDataFieldsPane { + private UIFormulaTextField projectNamePane; + private UIFormulaTextField seriesNamePane; + private UIFormulaTextField seriesValuePane; + private UIFormulaTextField beginDatePane; + private UIFormulaTextField endDatePane; + private UIFormulaTextField milestoneDatePane; + private UIFormulaTextField milestoneIconPane; + private UIFormulaTextField milestoneInfoPane; + private UIFormulaTextField schedulePane; + + public void initComponents() { + projectNamePane = new UIFormulaTextField(); + seriesNamePane = new UIFormulaTextField(); + seriesValuePane = new UIFormulaTextField(); + beginDatePane = new UIFormulaTextField(); + endDatePane = new UIFormulaTextField(); + milestoneDatePane = new UIFormulaTextField(); + milestoneIconPane = new UIFormulaTextField(); + milestoneInfoPane = new UIFormulaTextField(); + schedulePane = new UIFormulaTextField(); + super.initComponents(); + } + + @Override + protected String[] fieldLabels() { + return new String[]{ + "项目名称", "系列名称", "系列值", "开始时间", "结束时间", "里程碑时间", "里程碑图标", "里程碑信息", "进度" + }; + } + + @Override + protected Component[] fieldComponents() { + return new Component[]{ + projectNamePane, + seriesNamePane, + seriesValuePane, + beginDatePane, + endDatePane, + milestoneDatePane, + milestoneIconPane, + milestoneInfoPane, + schedulePane + }; + } + + @Override + protected UIFormulaTextField[] formulaPanes() { + return new UIFormulaTextField[]{ + projectNamePane, + seriesNamePane, + seriesValuePane, + beginDatePane, + endDatePane, + milestoneDatePane, + milestoneIconPane, + milestoneInfoPane, + schedulePane + }; + } + + @Override + public void populateBean(CustomGanttColumnFieldCollection dataConf) { + populateField(projectNamePane, dataConf.getProjectName()); + populateField(seriesNamePane, dataConf.getSeriesName()); + populateField(seriesValuePane, dataConf.getSeriesValue()); + populateField(beginDatePane, dataConf.getBeginDate()); + populateField(endDatePane, dataConf.getEndDate()); + populateField(milestoneDatePane, dataConf.getMilestoneDate()); + populateField(milestoneIconPane, dataConf.getMilestoneIcon()); + populateField(milestoneInfoPane, dataConf.getMilestoneInfo()); + populateField(schedulePane, dataConf.getSchedule()); + } + + @Override + public CustomGanttColumnFieldCollection updateBean() { + CustomGanttColumnFieldCollection dataConf = new CustomGanttColumnFieldCollection(); + updateField(projectNamePane, dataConf.getProjectName()); + updateField(seriesNamePane, dataConf.getSeriesName()); + updateField(seriesValuePane, dataConf.getSeriesValue()); + updateField(beginDatePane, dataConf.getBeginDate()); + updateField(endDatePane, dataConf.getEndDate()); + updateField(milestoneDatePane, dataConf.getMilestoneDate()); + updateField(milestoneIconPane, dataConf.getMilestoneIcon()); + updateField(milestoneInfoPane, dataConf.getMilestoneInfo()); + updateField(schedulePane, dataConf.getSchedule()); + return dataConf; + } +} diff --git a/src/main/java/com/fr/plugin/third/party/jsdibjj/data/CustomGanttDataSetFieldsPane.java b/src/main/java/com/fr/plugin/third/party/jsdibjj/data/CustomGanttDataSetFieldsPane.java new file mode 100644 index 0000000..a7078fa --- /dev/null +++ b/src/main/java/com/fr/plugin/third/party/jsdibjj/data/CustomGanttDataSetFieldsPane.java @@ -0,0 +1,99 @@ +package com.fr.plugin.third.party.jsdibjj.data; + +import com.fanruan.api.design.chart.field.BaseDataSetFieldsPane; +import com.fanruan.api.design.ui.component.UIComboBox; +import com.fr.plugin.third.party.jsdibjj.UIComboBoxWithNone; +import com.fr.plugin.third.party.jsdibjj.data.CustomGanttColumnFieldCollection; + +import java.awt.*; + + +public class CustomGanttDataSetFieldsPane extends BaseDataSetFieldsPane { + private UIComboBoxWithNone projectNamePane; + private UIComboBoxWithNone seriesNamePane; + private UIComboBoxWithNone seriesValuePane; + private UIComboBoxWithNone beginDatePane; + private UIComboBoxWithNone endDatePane; + private UIComboBoxWithNone milestoneDatePane; + private UIComboBoxWithNone milestoneIconPane; + private UIComboBoxWithNone milestoneInfoPane; + private UIComboBoxWithNone schedulePane; + + public void initComponents() { + projectNamePane = new UIComboBoxWithNone(); + seriesNamePane = new UIComboBoxWithNone(); + seriesValuePane = new UIComboBoxWithNone(); + beginDatePane = new UIComboBoxWithNone(); + endDatePane = new UIComboBoxWithNone(); + milestoneDatePane = new UIComboBoxWithNone(); + milestoneIconPane = new UIComboBoxWithNone(); + milestoneInfoPane = new UIComboBoxWithNone(); + schedulePane = new UIComboBoxWithNone(); + super.initComponents(); + } + + @Override + protected String[] fieldLabels() { + return new String[]{ + "项目名称", "系列名称", "系列值", "开始时间", "结束时间", "里程碑时间", "里程碑图标", "里程碑信息", "进度" + }; + } + + @Override + protected Component[] fieldComponents() { + return new Component[]{ + projectNamePane, + seriesNamePane, + seriesValuePane, + beginDatePane, + endDatePane, + milestoneDatePane, + milestoneIconPane, + milestoneInfoPane, + schedulePane + }; + } + + @Override + protected UIComboBox[] filedComboBoxes() { + return new UIComboBox[]{ + projectNamePane, + seriesNamePane, + seriesValuePane, + beginDatePane, + endDatePane, + milestoneDatePane, + milestoneIconPane, + milestoneInfoPane, + schedulePane + }; + } + + @Override + public void populateBean(CustomGanttColumnFieldCollection dataConf) { + populateField(projectNamePane, dataConf.getProjectName()); + populateField(seriesNamePane, dataConf.getSeriesName()); + populateField(seriesValuePane, dataConf.getSeriesValue()); + populateField(beginDatePane, dataConf.getBeginDate()); + populateField(endDatePane, dataConf.getEndDate()); + populateField(milestoneDatePane, dataConf.getMilestoneDate()); + populateField(milestoneIconPane, dataConf.getMilestoneIcon()); + populateField(milestoneInfoPane, dataConf.getMilestoneInfo()); + populateField(schedulePane, dataConf.getSchedule()); + } + + @Override + public CustomGanttColumnFieldCollection updateBean() { + CustomGanttColumnFieldCollection dataConf = new CustomGanttColumnFieldCollection(); + updateField(projectNamePane, dataConf.getProjectName()); + updateField(seriesNamePane, dataConf.getSeriesName()); + updateField(seriesValuePane, dataConf.getSeriesValue()); + updateField(beginDatePane, dataConf.getBeginDate()); + updateField(endDatePane, dataConf.getEndDate()); + updateField(milestoneDatePane, dataConf.getMilestoneDate()); + updateField(milestoneIconPane, dataConf.getMilestoneIcon()); + updateField(milestoneInfoPane, dataConf.getMilestoneInfo()); + updateField(schedulePane, dataConf.getSchedule()); + return dataConf; + } +} diff --git a/src/main/java/com/fr/plugin/third/party/jsdibjj/sort/DataSort.java b/src/main/java/com/fr/plugin/third/party/jsdibjj/sort/DataSort.java new file mode 100644 index 0000000..725fd62 --- /dev/null +++ b/src/main/java/com/fr/plugin/third/party/jsdibjj/sort/DataSort.java @@ -0,0 +1,52 @@ +package com.fr.plugin.third.party.jsdibjj.sort; + +public class DataSort { + /** + * 原序号 + */ + private int index = 0; + /** + * 脱节天数 + */ + private int disconnectDays = 0; + /** + * 新序号 + */ + private int newIndex = 0; + + + private String projectName; + + + public int getIndex() { + return index; + } + + public void setIndex(int index) { + this.index = index; + } + + public int getDisconnectDays() { + return disconnectDays; + } + + public void setDisconnectDays(int days) { + this.disconnectDays = days; + } + + public int getNewIndex() { + return newIndex; + } + + public void setNewIndex(int newIndex) { + this.newIndex = newIndex; + } + + public String getProjectName() { + return projectName; + } + + public void setProjectName(String projectName) { + this.projectName = projectName; + } +} diff --git a/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/ColorAnimationConfPane.java b/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/ColorAnimationConfPane.java new file mode 100644 index 0000000..b0ed0a6 --- /dev/null +++ b/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/ColorAnimationConfPane.java @@ -0,0 +1,81 @@ +package com.fr.plugin.third.party.jsdibjj.ui; + +import com.fanruan.api.design.ui.component.UILabel; +import com.fanruan.api.design.ui.layout.TableLayoutKit; +import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.itextfield.UINumberField; +import com.fr.plugin.third.party.jsdibjj.CustomGanttChart; + +import javax.swing.*; +import java.awt.*; + + +/** + * 动画 + */ +public class ColorAnimationConfPane extends BasicPane { + private static String[] SYMBOL_TYPES = {"rect", "circle", "roundRect", "triangle", "diamond", "pin", "arrow"}; + private static String[] SYMBOL_TYPE_NAMES = {"矩形", "圆形", "圆角矩形", "三角形", "菱形", "弹头", "箭头"}; + private UICheckBox enableCheckBox; + private UIComboBox symbolTypesComboBox; + private UINumberField widthNumberField; + + + public ColorAnimationConfPane() { + this.initComponents(); + } + + protected void initComponents() { + this.setLayout(new BorderLayout()); + enableCheckBox = new UICheckBox("启用"); + + symbolTypesComboBox = new UIComboBox(SYMBOL_TYPE_NAMES); + symbolTypesComboBox.setSelectedIndex(0); + + widthNumberField = new UINumberField(5); + widthNumberField.setInteger(true); + widthNumberField.setValue(2); + + Component[][] components = new Component[][]{ + {enableCheckBox, null}, + {new UILabel("形状:"), symbolTypesComboBox}, + {new UILabel("宽度:"), widthNumberField} + }; + double p = TableLayoutKit.PREFERRED; + double[] rowSize = new double[]{p, p, p}; + double[] columnSize = new double[]{p, 100}; + JPanel settingsUI = TableLayoutKit.createTableLayoutPane(components, rowSize, columnSize); + this.add(settingsUI, BorderLayout.CENTER); + } + + protected String title4PopupWindow() { + return "color"; + } + + + public void populate(CustomGanttChart conf) { + enableCheckBox.setSelected(conf.isAnimationOption()); + widthNumberField.setValue(conf.getSymbolWidth()); + int index = getSymbolTypeIndex(conf.getSymbolType()); + symbolTypesComboBox.setSelectedIndex(index); + } + + public CustomGanttChart update() { + CustomGanttChart conf = new CustomGanttChart(); + conf.setAnimationOption(enableCheckBox.isSelected()); + conf.setSymbolType(SYMBOL_TYPES[symbolTypesComboBox.getSelectedIndex()]); + conf.setSymbolWidth((int) widthNumberField.getValue()); + return conf; + } + + private int getSymbolTypeIndex(String type) { + for (int i = 0, max = SYMBOL_TYPES.length - 1; i <= max; i++) { + if (SYMBOL_TYPES[i].equalsIgnoreCase(type)) { + return i; + } + } + return 0; + } +} diff --git a/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/ColorDateLineConfPane.java b/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/ColorDateLineConfPane.java new file mode 100644 index 0000000..e1ea5ac --- /dev/null +++ b/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/ColorDateLineConfPane.java @@ -0,0 +1,80 @@ +package com.fr.plugin.third.party.jsdibjj.ui; + +import com.fanruan.api.design.ui.component.UILabel; +import com.fanruan.api.design.ui.layout.TableLayoutKit; +import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.itextfield.UINumberField; +import com.fr.design.style.color.ColorSelectBox; +import com.fr.plugin.third.party.jsdibjj.CustomGanttChart; + +import javax.swing.*; +import java.awt.*; + + +/** + * 时间线配置 + */ +public class ColorDateLineConfPane extends BasicPane { + private UICheckBox enableCheckBox; + private ColorSelectBox colorSelectBox; + private UINumberField widthNumberField; + + + public ColorDateLineConfPane() { + this.initComponents(); + } + + protected void initComponents() { + this.setLayout(new BorderLayout()); + JPanel panel0 = new JPanel(); + panel0.setLayout(new FlowLayout(0, 0, 0)); + enableCheckBox = new UICheckBox("启用"); + colorSelectBox = new ColorSelectBox(100); + + panel0.add(enableCheckBox); + panel0.add(colorSelectBox); + + //JPanel panel1= new JPanel(); + //panel1.setLayout( new FlowLayout(0, 0, 0)); + + widthNumberField = new UINumberField(5); + widthNumberField.setInteger(true); + //panel1.add(new JLabel("宽度")); + //panel1.add(widthNumberField); + + //Box vBox = Box.createVerticalBox(); + //vBox.add(panel0); + //vBox.add(panel1); + Component[][] components = new Component[][]{ + {enableCheckBox, null}, + {new UILabel("颜色:"), colorSelectBox}, + {new UILabel("宽度:"), widthNumberField} + }; + double p = TableLayoutKit.PREFERRED; + double[] rowSize = new double[]{p, p, p}; + double[] columnSize = new double[]{p, 100}; + JPanel settingsUI = TableLayoutKit.createTableLayoutPane(components, rowSize, columnSize); + this.add(settingsUI, BorderLayout.CENTER); + } + + protected String title4PopupWindow() { + return "color"; + } + + public void populate(CustomGanttChart conf) { + enableCheckBox.setSelected(conf.isCurrentTimeLineOption()); + colorSelectBox.setSelectObject(new Color(conf.getCurrentTimeLineColor())); + widthNumberField.setValue(conf.getCurrentTimeLineWidth()); + } + + public CustomGanttChart update() { + CustomGanttChart conf = new CustomGanttChart(); + conf.setCurrentTimeLineOption(enableCheckBox.isSelected()); + conf.setCurrentTimeLineColor(colorSelectBox.getSelectObject().getRGB()); + conf.setCurrentTimeLineWidth((int) widthNumberField.getValue()); + return conf; + } + + +} diff --git a/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/ColorEmphasisConfPane.java b/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/ColorEmphasisConfPane.java new file mode 100644 index 0000000..264eb8b --- /dev/null +++ b/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/ColorEmphasisConfPane.java @@ -0,0 +1,81 @@ +package com.fr.plugin.third.party.jsdibjj.ui; + +import com.fanruan.api.design.ui.component.UILabel; +import com.fanruan.api.design.ui.layout.TableLayoutKit; +import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.itextfield.UINumberField; +import com.fr.design.style.color.ColorSelectBox; +import com.fr.plugin.third.party.jsdibjj.CustomGanttChart; + +import javax.swing.*; +import java.awt.*; + + +/** + * 时间线配置 + */ +public class ColorEmphasisConfPane extends BasicPane { + private UICheckBox enableCheckBox; + private ColorSelectBox colorSelectBox; + private UINumberField widthNumberField; + + + public ColorEmphasisConfPane() { + this.initComponents(); + } + + protected void initComponents() { + this.setLayout(new BorderLayout()); + JPanel panel0 = new JPanel(); + panel0.setLayout(new FlowLayout(0, 0, 0)); + enableCheckBox = new UICheckBox("启用"); + colorSelectBox = new ColorSelectBox(100); + + panel0.add(enableCheckBox); + panel0.add(colorSelectBox); + + //JPanel panel1= new JPanel(); + //panel1.setLayout( new FlowLayout(0, 0, 0)); + + widthNumberField = new UINumberField(5); + widthNumberField.setInteger(true); + //panel1.add(new JLabel("宽度")); + //panel1.add(widthNumberField); + + //Box vBox = Box.createVerticalBox(); + //vBox.add(panel0); + //vBox.add(panel1); + Component[][] components = new Component[][]{ + {enableCheckBox, null}, + {new UILabel("颜色:"), colorSelectBox}, + {new UILabel("宽度:"), widthNumberField} + }; + double p = TableLayoutKit.PREFERRED; + double[] rowSize = new double[]{p, p, p}; + double[] columnSize = new double[]{p, 100}; + JPanel settingsUI = TableLayoutKit.createTableLayoutPane(components, rowSize, columnSize); + this.add(settingsUI, BorderLayout.CENTER); + } + + protected String title4PopupWindow() { + return "color"; + } + + + public void populate(CustomGanttChart conf) { + enableCheckBox.setSelected(conf.isEmphasisOption()); + colorSelectBox.setSelectObject(new Color(conf.getEmphasisBorderColor())); + widthNumberField.setValue(conf.getEmphasisBorderWidth()); + } + + public CustomGanttChart update() { + CustomGanttChart conf = new CustomGanttChart(); + conf.setEmphasisOption(enableCheckBox.isSelected()); + conf.setEmphasisBorderColor(colorSelectBox.getSelectObject().getRGB()); + conf.setEmphasisBorderWidth((int) widthNumberField.getValue()); + return conf; + } + + +} diff --git a/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/ColorGapConfPane.java b/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/ColorGapConfPane.java new file mode 100644 index 0000000..75973d7 --- /dev/null +++ b/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/ColorGapConfPane.java @@ -0,0 +1,45 @@ +package com.fr.plugin.third.party.jsdibjj.ui; + +import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.style.color.ColorSelectBox; +import com.fr.plugin.third.party.jsdibjj.CustomGanttChart; + +import java.awt.*; + + //import com.fr.van.chart.designer.component.border.VanChartBorderPane; +public class ColorGapConfPane extends BasicPane { + private UICheckBox enableCheckBox; + private ColorSelectBox colorSelectBox; + + public ColorGapConfPane() { + this.initComponents(); + } + + protected void initComponents() { + this.setLayout(new FlowLayout(0, 0, 0)); + enableCheckBox = new UICheckBox("启用"); + colorSelectBox = new ColorSelectBox(100); + this.add(enableCheckBox); + this.add(colorSelectBox); + + } + + protected String title4PopupWindow() { + return "color"; + } + + public void populate(CustomGanttChart conf) { + enableCheckBox.setSelected(conf.isFillGapOption()); + colorSelectBox.setSelectObject(new Color(conf.getFillGapColor())); + } + + public CustomGanttChart update() { + CustomGanttChart conf = new CustomGanttChart(); + conf.setFillGapOption(enableCheckBox.isSelected()); + conf.setFillGapColor(colorSelectBox.getSelectObject().getRGB()); + return conf; + } + + +} diff --git a/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/ColorSeriesConfPane.java b/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/ColorSeriesConfPane.java new file mode 100644 index 0000000..e24ee5e --- /dev/null +++ b/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/ColorSeriesConfPane.java @@ -0,0 +1,298 @@ +package com.fr.plugin.third.party.jsdibjj.ui; + +import com.fr.base.BaseUtils; +import com.fr.design.constants.LayoutConstants; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.BasicPane; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.style.color.ColorSelectBox; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.plugin.third.party.jsdibjj.CustomGanttChart; + +import javax.swing.*; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.List; + + +/** + * 系列渐变颜色设置 + */ +public class ColorSeriesConfPane extends BasicPane { + private UICheckBox enableCheckBox; + private UICheckBox dataSortCheckBox; + private ColorSelectBox oddColorSelectBox; + private ColorSelectBox evenColorSelectBox; + private JList colorList; + private UIButton addButton; + private UIButton editButton; + private UIButton removeButton; + private UIButton moveUpButton; + private UIButton moveDownButton; + ActionListener addActionListener = new ActionListener() { + public void actionPerformed(ActionEvent var1) { + final ColorSettingPane var2 = new ColorSettingPane(); + BasicDialog var3 = var2.showSmallWindow(SwingUtilities.getWindowAncestor(ColorSeriesConfPane.this), new DialogActionAdapter() { + public void doOk() { + Color var1 = var2.update(); + if (var1 != null) { + DefaultListModel var2x = (DefaultListModel) ColorSeriesConfPane.this.colorList.getModel(); + var2x.addElement(var1); + int index = var2x.size() - 1; + ColorSeriesConfPane.this.colorList.setSelectedIndex(index); + } + } + }); + var3.setTitle("增加颜色..."); + var3.setVisible(true); + } + }; + ActionListener editActionListener = new ActionListener() { + public void actionPerformed(ActionEvent var1) { + ColorSeriesConfPane.this.editPrinterList(); + } + }; + ActionListener removeActionListener = new ActionListener() { + public void actionPerformed(ActionEvent var1) { + int var2 = ColorSeriesConfPane.this.colorList.getSelectedIndex(); + if (var2 != -1) { + int var3 = FineJOptionPane.showConfirmDialog(ColorSeriesConfPane.this, "你确实想删除选中的颜色吗?", Toolkit.i18nText("Fine-Design_Basic_Remove"), 2, 3); + if (var3 == 0) { + ((DefaultListModel) ColorSeriesConfPane.this.colorList.getModel()).remove(var2); + if (ColorSeriesConfPane.this.colorList.getModel().getSize() > 0) { + if (var2 < ColorSeriesConfPane.this.colorList.getModel().getSize()) { + ColorSeriesConfPane.this.colorList.setSelectedIndex(var2); + } else { + ColorSeriesConfPane.this.colorList.setSelectedIndex(ColorSeriesConfPane.this.colorList.getModel().getSize() - 1); + } + } + + ColorSeriesConfPane.this.checkButtonEnabled(); + } + + } + } + }; + ActionListener moveUpActionListener = new ActionListener() { + public void actionPerformed(ActionEvent var1) { + int var2 = ColorSeriesConfPane.this.colorList.getSelectedIndex(); + if (var2 > 0) { + DefaultListModel var3 = (DefaultListModel) ColorSeriesConfPane.this.colorList.getModel(); + Object var4 = var3.get(var2 - 1); + var3.set(var2 - 1, var3.get(var2)); + var3.set(var2, var4); + ColorSeriesConfPane.this.colorList.setSelectedIndex(var2 - 1); + ColorSeriesConfPane.this.checkButtonEnabled(); + } + + } + }; + ActionListener moveDownActionListener = new ActionListener() { + public void actionPerformed(ActionEvent var1) { + int var2 = ColorSeriesConfPane.this.colorList.getSelectedIndex(); + if (var2 != -1) { + if (var2 < ColorSeriesConfPane.this.colorList.getModel().getSize() - 1) { + DefaultListModel var3 = (DefaultListModel) ColorSeriesConfPane.this.colorList.getModel(); + Object var4 = var3.get(var2 + 1); + var3.set(var2 + 1, var3.get(var2)); + var3.set(var2, var4); + ColorSeriesConfPane.this.colorList.setSelectedIndex(var2 + 1); + ColorSeriesConfPane.this.checkButtonEnabled(); + } + + } + } + }; + ListSelectionListener printerSelectionListener = new ListSelectionListener() { + public void valueChanged(ListSelectionEvent var1) { + ColorSeriesConfPane.this.checkButtonEnabled(); + } + }; + MouseAdapter mouseClickedListener = new MouseAdapter() { + public void mouseClicked(MouseEvent var1) { + int var2 = var1.getClickCount(); + if (var2 >= 2) { + ColorSeriesConfPane.this.editPrinterList(); + } + + } + }; + + public class ColorRenderer extends JLabel implements ListCellRenderer { + @Override + public Component getListCellRendererComponent(JList list, + Object value, + int index, + boolean isSelected, + boolean cellHasFocus) { + if ((value != null) && (value instanceof Color)) { + Color color = (Color) value; + this.setOpaque(true); //此句是重点,设置背景颜色必须先将它设置为不透明的,因为默认是透明的。。。 + this.setText(" "); + this.setBackground(color); + } + return this; + } + } + + public ColorSeriesConfPane() { + this.initComponents(); + } + + protected void initComponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + this.setBorder(BorderFactory.createEmptyBorder(6, 2, 4, 2)); + JToolBar var1 = new JToolBar(); + this.add(var1, BorderLayout.NORTH); + Dimension var2 = new Dimension(24, 24); + this.addButton = new UIButton(BaseUtils.readIcon("/com/fr/base/images/cell/control/add.png")); + this.addButton.addActionListener(this.addActionListener); + this.addButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Add")); + this.addButton.setPreferredSize(var2); + this.editButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/control/edit.png")); + this.editButton.addActionListener(this.editActionListener); + this.editButton.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Edit")); + this.editButton.setPreferredSize(var2); + this.removeButton = new UIButton(BaseUtils.readIcon("/com/fr/base/images/cell/control/remove.png")); + this.removeButton.addActionListener(this.removeActionListener); + this.removeButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Remove")); + this.removeButton.setPreferredSize(var2); + this.moveUpButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/control/up.png")); + this.moveUpButton.addActionListener(this.moveUpActionListener); + this.moveUpButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Up")); + this.moveUpButton.setPreferredSize(var2); + this.moveDownButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/control/down.png")); + this.moveDownButton.addActionListener(this.moveDownActionListener); + this.moveDownButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Down")); + this.moveDownButton.setPreferredSize(var2); + var1.add(this.addButton); + var1.add(this.editButton); + var1.add(this.removeButton); + var1.add(this.moveUpButton); + var1.add(this.moveDownButton); + this.colorList = new JList(new DefaultListModel()); + this.colorList.addListSelectionListener(this.printerSelectionListener); + this.colorList.addMouseListener(this.mouseClickedListener); + this.colorList.setCellRenderer(new ColorRenderer()); + this.add(new JScrollPane(this.colorList), "Center"); + + enableCheckBox = new UICheckBox("按项目循环颜色"); + this.add(enableCheckBox, BorderLayout.SOUTH); + + //dataSortCheckBox = new UICheckBox("脱节天数排序"); + dataSortCheckBox = new UICheckBox("奇偶背景颜色"); + oddColorSelectBox = new ColorSelectBox(40); + evenColorSelectBox = new ColorSelectBox(40); + Component[] components_font = new Component[]{ + dataSortCheckBox, oddColorSelectBox, evenColorSelectBox + }; + //this.add(GUICoreUtils.createFlowPane(components_font, FlowLayout.LEFT, LayoutConstants.HGAP_SMALL), BorderLayout.SOUTH); + this.checkButtonEnabled(); + } + + protected String title4PopupWindow() { + return "printer"; + } + + private void checkButtonEnabled() { + this.editButton.setEnabled(false); + this.removeButton.setEnabled(false); + this.moveUpButton.setEnabled(false); + this.moveDownButton.setEnabled(false); + int var1 = this.colorList.getSelectedIndex(); + if (var1 >= 0) { + this.editButton.setEnabled(true); + this.removeButton.setEnabled(true); + if (var1 > 0) { + this.moveUpButton.setEnabled(true); + } + + if (var1 < this.colorList.getModel().getSize() - 1) { + this.moveDownButton.setEnabled(true); + } + } + + } + + public void editPrinterList() { + final int var1 = this.colorList.getSelectedIndex(); + final ColorSettingPane var2 = new ColorSettingPane(); + BasicDialog var3 = var2.showSmallWindow(SwingUtilities.getWindowAncestor(this), new DialogActionAdapter() { + public void doOk() { + Color var1x = var2.update(); + if (var1x != null) { + DefaultListModel var2x = (DefaultListModel) ColorSeriesConfPane.this.colorList.getModel(); + if (var1 < 0) { + var2x.addElement(var1x); + int index = var2x.size() - 1; + ColorSeriesConfPane.this.colorList.setSelectedIndex(index); + return; + } + var2x.remove(var1); + var2x.add(var1, var1x); + ColorSeriesConfPane.this.colorList.setSelectedIndex(var1); + } + + } + }); + var2.populate((Color) this.colorList.getSelectedValue()); + var3.setTitle("编辑颜色..."); + var3.setVisible(true); + } + + + public void populate(CustomGanttChart ob) { + populate(ob.getColors()); + enableCheckBox.setSelected(ob.isProjectCycleColor()); + dataSortCheckBox.setSelected(ob.isDataSort()); + oddColorSelectBox.setSelectObject(new Color(ob.getOddBackgroundColor())); + evenColorSelectBox.setSelectObject(new Color(ob.getEvenBackgroundColor())); + } + + private void populate(List colors) { + DefaultListModel var3 = (DefaultListModel) this.colorList.getModel(); + var3.removeAllElements(); + if ((colors == null) || (colors.size() <= 0)) { + return; + } + int size = colors.size(); + for (int i = 0, max = size - 1; i <= max; i++) { + var3.addElement(new Color(colors.get(i))); + } + if (size >= 1) { + this.colorList.setSelectedIndex(0); + } + } + + public void update(CustomGanttChart ob) { + ob.setColors(update()); + ob.setProjectCycleColor(enableCheckBox.isSelected()); + ob.setDataSort(dataSortCheckBox.isSelected()); + ob.setOddBackgroundColor(oddColorSelectBox.getSelectObject().getRGB()); + ob.setEvenBackgroundColor(evenColorSelectBox.getSelectObject().getRGB()); + } + + private List update() { + List var2 = new ArrayList(); + DefaultListModel var3 = (DefaultListModel) this.colorList.getModel(); + Color color; + for (int i = 0, max = var3.size() - 1; i <= max; i++) { + color = (Color) var3.get(i); + var2.add(color.getRGB()); + } + return var2; + } + + +} diff --git a/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/ColorSettingPane.java b/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/ColorSettingPane.java new file mode 100644 index 0000000..aab8663 --- /dev/null +++ b/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/ColorSettingPane.java @@ -0,0 +1,47 @@ +package com.fr.plugin.third.party.jsdibjj.ui; + +import com.fanruan.api.design.ui.component.UILabel; +import com.fr.design.dialog.BasicPane; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane; +import com.fr.design.style.color.NewColorSelectBox; + +import java.awt.*; + +public class ColorSettingPane extends BasicPane { + //private ColorBackgroundQuickPane colorBackgroundQuickPane; + private NewColorSelectBox colorBackgroundQuickPane; + + public ColorSettingPane() { + this.initComponents(); + } + + protected void initComponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + colorBackgroundQuickPane = new NewColorSelectBox(100); + this.add(new UILabel("设置颜色"), BorderLayout.NORTH); + this.add(colorBackgroundQuickPane, BorderLayout.CENTER); + } + + public void checkValid() throws Exception { + + } + + protected boolean isShowHelpButton() { + return false; + } + + protected String title4PopupWindow() { + return "设置颜色"; + } + + public void populate(Color var1) { + //this.colorBackgroundQuickPane.populateColor(var1); + this.colorBackgroundQuickPane.setSelectObject(var1); + } + + public Color update() { + //return this.colorBackgroundQuickPane.updateColor(); + return this.colorBackgroundQuickPane.getSelectObject(); + } +} \ No newline at end of file diff --git a/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/CustomGanttShowSettingsPane.java b/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/CustomGanttShowSettingsPane.java new file mode 100644 index 0000000..198983f --- /dev/null +++ b/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/CustomGanttShowSettingsPane.java @@ -0,0 +1,118 @@ +package com.fr.plugin.third.party.jsdibjj.ui; + +import com.fanruan.api.design.chart.BaseOtherPane; +import com.fanruan.api.design.ui.component.UITitledBorder; +import com.fr.plugin.third.party.jsdibjj.CustomGanttChart; +import com.fr.van.chart.designer.component.VanChartFillStylePane; +import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane; +import com.fr.design.style.color.ColorAdjustPane; + +import javax.swing.*; +import java.awt.*; + +public class CustomGanttShowSettingsPane extends BaseOtherPane { + private DisplayScaleConfPane displayScaleConfPane; + private ColorGapConfPane colorGapConfPane; + private ColorDateLineConfPane colorDateLineConfPane; + private ColorSeriesConfPane colorListPane; + private ColorAnimationConfPane colorAnimationConfPane; + private ColorEmphasisConfPane colorEmphasisConfPane; + private YFontConfPane yFontConfPane; + + + @Override + public void populate(CustomGanttChart ob) { + colorGapConfPane.populate(ob); + colorListPane.populate(ob); + colorDateLineConfPane.populate(ob); + displayScaleConfPane.populate(ob); + colorAnimationConfPane.populate(ob); + colorEmphasisConfPane.populate(ob); + yFontConfPane.populate(ob); + } + + @Override + public void update(CustomGanttChart ob) { + CustomGanttChart conf = colorGapConfPane.update(); + ob.setFillGapOption(conf.isFillGapOption()); + ob.setFillGapColor(conf.getFillGapColor()); + + colorListPane.update(ob); + //ob.setColors(colorListPane.update()); + + CustomGanttChart conf1 = colorDateLineConfPane.update(); + ob.setCurrentTimeLineOption(conf1.isCurrentTimeLineOption()); + ob.setCurrentTimeLineColor(conf1.getCurrentTimeLineColor()); + ob.setCurrentTimeLineWidth(conf1.getCurrentTimeLineWidth()); + + //ob.setDisplayScale(displayScaleConfPane.update()); + displayScaleConfPane.update(ob); + + CustomGanttChart conf2 = colorAnimationConfPane.update(); + ob.setAnimationOption(conf2.isAnimationOption()); + ob.setSymbolType(conf2.getSymbolType()); + ob.setSymbolWidth(conf2.getSymbolWidth()); + + CustomGanttChart conf3 = colorEmphasisConfPane.update(); + ob.setEmphasisOption(conf3.isEmphasisOption()); + ob.setEmphasisBorderColor(conf3.getEmphasisBorderColor()); + ob.setEmphasisBorderWidth(conf3.getEmphasisBorderWidth()); + + CustomGanttChart conf4 = yFontConfPane.update(); + ob.setyAxisAxisLabelColor(conf4.getyAxisAxisLabelColor()); + ob.setyAxisAxisLabelFontStyle(conf4.getyAxisAxisLabelFontStyle()); + ob.setyAxisAxisLabelFontWeight(conf4.getyAxisAxisLabelFontWeight()); + ob.setyAxisAxisLabelFontFamily(conf4.getyAxisAxisLabelFontFamily()); + ob.setyAxisAxisLabelFontSize(conf4.getyAxisAxisLabelFontSize()); + } + + @Override + protected JPanel createContentPane() { + JPanel panel = new JPanel(new BorderLayout(0, 6)); + displayScaleConfPane = new DisplayScaleConfPane(); + displayScaleConfPane.setBorder(UITitledBorder.createBorderWithTitle("显示比例")); + + colorGapConfPane = new ColorGapConfPane(); + colorGapConfPane.setBorder(UITitledBorder.createBorderWithTitle("填充空白颜色设置")); + + colorDateLineConfPane = new ColorDateLineConfPane(); + colorDateLineConfPane.setBorder(UITitledBorder.createBorderWithTitle("日期线设置")); + + colorAnimationConfPane = new ColorAnimationConfPane(); + colorAnimationConfPane.setBorder(UITitledBorder.createBorderWithTitle("动画设置")); + + colorEmphasisConfPane = new ColorEmphasisConfPane(); + colorEmphasisConfPane.setBorder(UITitledBorder.createBorderWithTitle("选中设置")); + + yFontConfPane = new YFontConfPane(); + yFontConfPane.setBorder(UITitledBorder.createBorderWithTitle("Y轴字体设置")); + + colorListPane = new ColorSeriesConfPane(); + colorListPane.setBorder(UITitledBorder.createBorderWithTitle("系列渐变颜色设置")); + JPanel gapPanel = new JPanel(); + gapPanel.setBorder(UITitledBorder.createBorderWithTitle("")); + + + JPanel settingsUI1 = new JPanel(new BorderLayout()); + settingsUI1.add(displayScaleConfPane, BorderLayout.NORTH); + //settingsUI1.add(colorGapConfPane, BorderLayout.CENTER); + + JPanel settingsUI2 = new JPanel(new BorderLayout()); + //settingsUI2.add(colorAnimationConfPane, BorderLayout.NORTH); + settingsUI2.add(colorEmphasisConfPane, BorderLayout.CENTER); + settingsUI2.add(yFontConfPane, BorderLayout.SOUTH); + + JPanel settingsUI = new JPanel(new BorderLayout()); + settingsUI.add(settingsUI1, BorderLayout.NORTH); + settingsUI.add(colorDateLineConfPane, BorderLayout.CENTER); + settingsUI.add(settingsUI2, BorderLayout.SOUTH); + panel.add(settingsUI, BorderLayout.NORTH); + //panel.add(colorListPane, BorderLayout.CENTER); + return panel; + } + + @Override + public String title4PopupWindow() { + return "显示"; + } +} diff --git a/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/CustomGanttTitlePane.java b/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/CustomGanttTitlePane.java new file mode 100644 index 0000000..59f7846 --- /dev/null +++ b/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/CustomGanttTitlePane.java @@ -0,0 +1,162 @@ +package com.fr.plugin.third.party.jsdibjj.ui; + +import com.fanruan.api.design.chart.BaseOtherPane; +import com.fanruan.api.design.ui.component.UICheckBox; +import com.fanruan.api.design.ui.component.UILabel; +import com.fanruan.api.design.ui.component.UITitledBorder; +import com.fanruan.api.design.ui.component.formula.UIFormulaTextField; +import com.fanruan.api.design.ui.layout.TableLayoutKit; +import com.fr.base.Utils; +import com.fr.design.gui.ibutton.UIColorButton; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.plugin.third.party.jsdibjj.CustomGanttChart; + +import javax.swing.*; +import java.awt.*; +import java.util.Vector; + +public class CustomGanttTitlePane extends BaseOtherPane { + private UIFormulaTextField titleFormulaTextField; + private UIColorButton colorSelectPane; + private UICheckBox fontStyleCheckBox; + private UICheckBox fontWeightCheckBox; + private UIComboBox fontNameComboBox; + private UIComboBox fontSizeComboBox; + private UIComboBox leftComboBox; + + private UIComboBox fontNameSeriesNameComboBox; + private UIComboBox fontSizeSeriesNameComboBox; + private UIColorButton colorSelectSeriesNamePane; + + @Override + public void populate(CustomGanttChart ob) { + titleFormulaTextField.populateBean(ob.getTitleFormula().toString()); + + colorSelectPane.setColor(new Color(ob.getTitleTextStyleColor())); + colorSelectPane.repaint(); + if ("normal".equalsIgnoreCase(ob.getTitleTextStyleFontStyle())) { + fontStyleCheckBox.setSelected(false); + } else { + fontStyleCheckBox.setSelected(true); + } + if ("normal".equalsIgnoreCase(ob.getTitleTextStyleFontWeight())) { + fontWeightCheckBox.setSelected(false); + } else { + fontWeightCheckBox.setSelected(true); + } + fontNameComboBox.setSelectedItem(ob.getTitleTextStyleFontFamily()); + fontSizeComboBox.setSelectedItem(ob.getTitleTextStyleFontSize()); + + if ("left".equalsIgnoreCase(ob.getTitleLeft())) { + leftComboBox.setSelectedIndex(0); + } else if ("center".equalsIgnoreCase(ob.getTitleLeft())) { + leftComboBox.setSelectedIndex(1); + } else if ("right".equalsIgnoreCase(ob.getTitleLeft())) { + leftComboBox.setSelectedIndex(2); + } else { + leftComboBox.setSelectedIndex(1); + } + + + fontNameSeriesNameComboBox.setSelectedItem(ob.getSeriesNameTextStyleFontFamily()); + fontSizeSeriesNameComboBox.setSelectedItem(ob.getSeriesNameTextStyleFontSize()); + colorSelectSeriesNamePane.setColor(new Color(ob.getSeriesNameTextStyleColor())); + colorSelectSeriesNamePane.repaint(); + } + + @Override + public void update(CustomGanttChart ob) { + ob.getTitleFormula().setContent(titleFormulaTextField.updateBean()); + ob.setTitleTextStyleColor(colorSelectPane.getColor().getRGB()); + if (fontStyleCheckBox.isSelected()) { + ob.setTitleTextStyleFontStyle("italic"); + } else { + ob.setTitleTextStyleFontStyle("normal"); + } + + if (fontWeightCheckBox.isSelected()) { + ob.setTitleTextStyleFontWeight("bold"); + } else { + ob.setTitleTextStyleFontWeight("normal"); + } + ob.setTitleTextStyleFontFamily(String.valueOf(fontNameComboBox.getSelectedItem())); + ob.setTitleTextStyleFontSize((Integer) fontSizeComboBox.getSelectedItem()); + String leftValue = "center"; + String[] leftValues = {"left", "center", "right"}; + int index = leftComboBox.getSelectedIndex(); + if (index < 0) { + index = 1; + } + leftValue = leftValues[index]; + ob.setTitleLeft(leftValue); + + ob.setSeriesNameTextStyleFontFamily(String.valueOf(fontNameSeriesNameComboBox.getSelectedItem())); + ob.setSeriesNameTextStyleFontSize((Integer) fontSizeSeriesNameComboBox.getSelectedItem()); + ob.setSeriesNameTextStyleColor(colorSelectSeriesNamePane.getColor().getRGB()); + } + + @Override + protected JPanel createContentPane() { + JPanel panel = new JPanel(new BorderLayout(0, 6)); + titleFormulaTextField = new UIFormulaTextField(); + colorSelectPane = new UIColorButton(); + fontStyleCheckBox = new UICheckBox(); + fontWeightCheckBox = new UICheckBox(); + this.fontNameComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); + this.fontNameComboBox.setPreferredSize(new Dimension(144, 20)); + this.fontSizeComboBox = new UIComboBox(getFontSizes()); + this.fontSizeComboBox.setEditable(true); + leftComboBox = new UIComboBox(new String[]{"居左", "居中", "居右"}); + + Component[][] components = new Component[][]{ + {new UILabel(" 内容:"), titleFormulaTextField}, + {new UILabel(" 颜色:"), colorSelectPane}, + {new UILabel(" 斜体:"), fontStyleCheckBox}, + {new UILabel(" 加粗:"), fontWeightCheckBox}, + {new UILabel(" 字体:"), fontNameComboBox}, + {new UILabel(" 字体大小:"), fontSizeComboBox}, + {new UILabel(" 显示位置:"), leftComboBox} + }; + double p = TableLayoutKit.PREFERRED; + double[] rowSize = new double[]{p, p, p, p, p, p, p}; + double[] columnSize = new double[]{p, 120}; + JPanel settingsUI = TableLayoutKit.createTableLayoutPane(components, rowSize, columnSize); + settingsUI.setBorder(UITitledBorder.createBorderWithTitle("标题")); + + + this.fontNameSeriesNameComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); + this.fontNameSeriesNameComboBox.setPreferredSize(new Dimension(144, 20)); + this.fontSizeSeriesNameComboBox = new UIComboBox(getFontSizes()); + this.fontSizeSeriesNameComboBox.setEditable(true); + this.colorSelectSeriesNamePane = new UIColorButton(); + + Component[][] components1 = new Component[][]{ + //{new UILabel(" 字体:"), fontNameSeriesNameComboBox}, + {new UILabel(" 字体大小:"), fontSizeSeriesNameComboBox}, + //{new UILabel(" 颜色:"), colorSelectSeriesNamePane}, + }; + rowSize = new double[]{p, }; + JPanel settingsUI1 = TableLayoutKit.createTableLayoutPane(components1, rowSize, columnSize); + settingsUI1.setBorder(UITitledBorder.createBorderWithTitle("系列名称")); + panel.add(settingsUI, BorderLayout.NORTH); + panel.add(settingsUI1, BorderLayout.CENTER); + return panel; + } + + @Override + public String title4PopupWindow() { + return "字体"; + } + + + public static Vector getFontSizes() { + Vector var0 = new Vector(); + + for (int var1 = 1; var1 < 100; ++var1) { + var0.add(var1); + } + + return var0; + } + +} diff --git a/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/CustomGanttTypePane.java b/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/CustomGanttTypePane.java new file mode 100644 index 0000000..6a53a6d --- /dev/null +++ b/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/CustomGanttTypePane.java @@ -0,0 +1,49 @@ +package com.fr.plugin.third.party.jsdibjj.ui; + +import com.fanruan.api.design.chart.DefaultTypePane; +import com.fr.plugin.third.party.jsdibjj.CustomGanttChart; + +import javax.swing.*; +import java.awt.*; + + +public class CustomGanttTypePane extends DefaultTypePane { + //private UIButtonGroup buttonGroup = new UIButtonGroup(new String[]{DesignKit.i18nText("Fine-Plugin_Legend_Right"), DesignKit.i18nText("Fine-Plugin_Legend_Left")}); + + @Override + protected String[] getTypeIconPath() { + return new String[]{ + "com/fr/plugin/third/party/jsdibjj/images/chart_type.png" + }; + } + + @Override + protected int getSelectIndexInChart(CustomGanttChart chart) { + return 0; + } + + @Override + protected void setSelectIndexInChart(CustomGanttChart chart, int index) { + //chart.setPieType(PieType.parseInt(index)); + } + + @Override + protected Component[][] getPaneComponents(JPanel typePane) { + return new Component[][]{ + new Component[]{typePane}, + //new Component[]{buttonGroup} + }; + } + + @Override + public void populateBean(CustomGanttChart ob) { + super.populateBean(ob); + // buttonGroup.setSelectedIndex(StringKit.equals("left", ob.getLegendPosition()) ? 0 : 1); + } + + @Override + public void updateBean(CustomGanttChart ob) { + super.updateBean(ob); + // ob.setLegendPosition(buttonGroup.getSelectedIndex() == 0 ? "left" : "right"); + } +} diff --git a/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/DisplayScaleConfPane.java b/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/DisplayScaleConfPane.java new file mode 100644 index 0000000..cef1bf3 --- /dev/null +++ b/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/DisplayScaleConfPane.java @@ -0,0 +1,72 @@ +package com.fr.plugin.third.party.jsdibjj.ui; + +import com.fanruan.api.design.ui.component.UILabel; +import com.fanruan.api.design.ui.layout.TableLayoutKit; +import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.ispinner.UISpinner; +import com.fr.plugin.third.party.jsdibjj.CustomGanttChart; + +import javax.swing.*; +import java.awt.*; + +public class DisplayScaleConfPane extends BasicPane { + + private UISpinner scaleSpinner; + private UISpinner scaleXSpinner; + + public DisplayScaleConfPane() { + this.initComponents(); + } + + protected void initComponents() { + this.setLayout(new BorderLayout()); + scaleSpinner = new UISpinner(0, 100, 1, 100); + scaleXSpinner = new UISpinner(0, 100, 1, 100); + //this.add(new UILabel("Y轴比例:")); + //this.add(scaleSpinner); + Component[][] components = new Component[][]{ + {new UILabel("竖轴比例:"), scaleSpinner}, + {new UILabel("横轴比例:"), scaleXSpinner} + }; + double p = TableLayoutKit.PREFERRED; + double[] rowSize = new double[]{p, p}; + double[] columnSize = new double[]{p, 100}; + JPanel settingsUI = TableLayoutKit.createTableLayoutPane(components, rowSize, columnSize); + this.add(settingsUI, BorderLayout.CENTER); + } + + public void populate(CustomGanttChart ob) { + int yValue = ob.getDisplayScale(); + yValue = getValue(yValue); + int xValue = ob.getDisplayXScale(); + xValue = getValue(xValue); + scaleSpinner.setValue(yValue, true); + scaleXSpinner.setValue(xValue, true); + } + + private int getValue(int value) { + if (value <= 0) { + value = 0; + } + if (value >= 100) { + value = 100; + } + return value; + } + + + public void update(CustomGanttChart ob) { + int yValue = (int) scaleSpinner.getValue(); + yValue = getValue(yValue); + int xValue = (int) scaleXSpinner.getValue(); + xValue = getValue(xValue); + ob.setDisplayScale(yValue); + ob.setDisplayXScale(xValue); + } + + + @Override + protected String title4PopupWindow() { + return "显示比例"; + } +} diff --git a/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/YFontConfPane.java b/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/YFontConfPane.java new file mode 100644 index 0000000..9432f02 --- /dev/null +++ b/src/main/java/com/fr/plugin/third/party/jsdibjj/ui/YFontConfPane.java @@ -0,0 +1,116 @@ +package com.fr.plugin.third.party.jsdibjj.ui; + +import com.fanruan.api.design.ui.component.UILabel; +import com.fanruan.api.design.ui.layout.TableLayoutKit; +import com.fr.base.Utils; +import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.ibutton.UIColorButton; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.plugin.third.party.jsdibjj.CustomGanttChart; + +import javax.swing.*; +import java.awt.*; +import java.util.Vector; + + +/** + * 动画 + */ +public class YFontConfPane extends BasicPane { + private static String[] SYMBOL_TYPES = {"rect", "circle", "roundRect", "triangle", "diamond", "pin", "arrow"}; + private static String[] SYMBOL_TYPE_NAMES = {"矩形", "圆形", "圆角矩形", "三角形", "菱形", "弹头", "箭头"}; + private UIColorButton colorSelectPane; + private UICheckBox fontStyleCheckBox; + private UICheckBox fontWeightCheckBox; + private UIComboBox fontNameComboBox; + private UIComboBox fontSizeComboBox; + + + public YFontConfPane() { + this.initComponents(); + } + + protected void initComponents() { + this.setLayout(new BorderLayout()); + colorSelectPane = new UIColorButton(); + fontStyleCheckBox = new UICheckBox(); + fontWeightCheckBox = new UICheckBox(); + this.fontNameComboBox = new UIComboBox(Utils.getAvailableFontFamilyNames4Report()); + this.fontNameComboBox.setPreferredSize(new Dimension(144, 20)); + this.fontSizeComboBox = new UIComboBox(getFontSizes()); + this.fontSizeComboBox.setEditable(true); + Component[][] components = new Component[][]{ + {new UILabel(" 颜色:"), colorSelectPane}, + {new UILabel(" 斜体:"), fontStyleCheckBox}, + {new UILabel(" 加粗:"), fontWeightCheckBox}, + {new UILabel(" 字体:"), fontNameComboBox}, + {new UILabel(" 字体大小:"), fontSizeComboBox} + }; + double p = TableLayoutKit.PREFERRED; + double[] rowSize = new double[]{p, p, p, p, p}; + double[] columnSize = new double[]{p, 120}; + JPanel settingsUI = TableLayoutKit.createTableLayoutPane(components, rowSize, columnSize); + this.add(settingsUI, BorderLayout.CENTER); + } + + protected String title4PopupWindow() { + return "color"; + } + + + public void populate(CustomGanttChart ob) { + colorSelectPane.setColor(new Color(ob.getyAxisAxisLabelColor())); + colorSelectPane.repaint(); + if ("normal".equalsIgnoreCase(ob.getyAxisAxisLabelFontStyle())) { + fontStyleCheckBox.setSelected(false); + } else { + fontStyleCheckBox.setSelected(true); + } + if ("normal".equalsIgnoreCase(ob.getyAxisAxisLabelFontWeight())) { + fontWeightCheckBox.setSelected(false); + } else { + fontWeightCheckBox.setSelected(true); + } + fontNameComboBox.setSelectedItem(ob.getyAxisAxisLabelFontFamily()); + fontSizeComboBox.setSelectedItem(ob.getyAxisAxisLabelFontSize()); + } + + public CustomGanttChart update() { + CustomGanttChart ob = new CustomGanttChart(); + ob.setyAxisAxisLabelColor(colorSelectPane.getColor().getRGB()); + if (fontStyleCheckBox.isSelected()) { + ob.setyAxisAxisLabelFontStyle("italic"); + } else { + ob.setyAxisAxisLabelFontStyle("normal"); + } + + if (fontWeightCheckBox.isSelected()) { + ob.setyAxisAxisLabelFontWeight("bold"); + } else { + ob.setyAxisAxisLabelFontWeight("normal"); + } + ob.setyAxisAxisLabelFontFamily((String) fontNameComboBox.getSelectedItem()); + ob.setyAxisAxisLabelFontSize((Integer) fontSizeComboBox.getSelectedItem()); + return ob; + } + + private int getSymbolTypeIndex(String type) { + for (int i = 0, max = SYMBOL_TYPES.length - 1; i <= max; i++) { + if (SYMBOL_TYPES[i].equalsIgnoreCase(type)) { + return i; + } + } + return 0; + } + + public static Vector getFontSizes() { + Vector var0 = new Vector(); + + for (int var1 = 1; var1 < 100; ++var1) { + var0.add(var1); + } + + return var0; + } +} diff --git a/src/main/resources/com/fr/plugin/third/party/jsdibjj/images/chart_icon.png b/src/main/resources/com/fr/plugin/third/party/jsdibjj/images/chart_icon.png new file mode 100644 index 0000000..76e9410 Binary files /dev/null and b/src/main/resources/com/fr/plugin/third/party/jsdibjj/images/chart_icon.png differ diff --git a/src/main/resources/com/fr/plugin/third/party/jsdibjj/images/chart_type.png b/src/main/resources/com/fr/plugin/third/party/jsdibjj/images/chart_type.png new file mode 100644 index 0000000..3466650 Binary files /dev/null and b/src/main/resources/com/fr/plugin/third/party/jsdibjj/images/chart_type.png differ diff --git a/src/main/resources/com/fr/plugin/third/party/jsdibjj/images/chart_type_demo.png b/src/main/resources/com/fr/plugin/third/party/jsdibjj/images/chart_type_demo.png new file mode 100644 index 0000000..c1aed21 Binary files /dev/null and b/src/main/resources/com/fr/plugin/third/party/jsdibjj/images/chart_type_demo.png differ diff --git a/src/main/resources/com/fr/plugin/third/party/jsdibjj/images/gantt_type.png b/src/main/resources/com/fr/plugin/third/party/jsdibjj/images/gantt_type.png new file mode 100644 index 0000000..e82adaf Binary files /dev/null and b/src/main/resources/com/fr/plugin/third/party/jsdibjj/images/gantt_type.png differ diff --git a/src/main/resources/com/fr/plugin/third/party/jsdibjj/web/customGanttPlus.css b/src/main/resources/com/fr/plugin/third/party/jsdibjj/web/customGanttPlus.css new file mode 100644 index 0000000..0f8e7a8 --- /dev/null +++ b/src/main/resources/com/fr/plugin/third/party/jsdibjj/web/customGanttPlus.css @@ -0,0 +1,42 @@ +.echarts-custom-gantt-progress-bar-div { + position: absolute; + background-color: #1a1a1a; + border-radius: 5px; + box-shadow: 0 1px 5px #d8cfcf inset, 0 1px 0 #444; + z-index: 9999; +} + +.echarts-custom-gantt-progress-bar-div span { + /*background-color: #34c2e3;*/ + background-image: -webkit-gradient(linear, 0 0, 100% 100%, color-stop(.25, rgba(255, 255, 255, .2)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255, 255, 255, .2)), color-stop(.75, rgba(255, 255, 255, .2)), color-stop(.75, transparent), to(transparent)); + background-image: linear-gradient(135deg, rgba(255, 255, 255, .15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%, transparent 75%, transparent); + -webkit-animation: animate-stripes 2s linear infinite; + -moz-animation: animate-stripes 2s linear infinite; + animation: animate-stripes 2s linear infinite; + background-size: 20px 20px; + height: 100%; + display: inline-block; +} + + +@-webkit-keyframes animate-stripes { + + 0% { + background-position: 0 0; + } + + 100% { + background-position: 60px 0; + } + +} + +@-moz-keyframes animate-stripes { + + 0% { + background-position: 0 0; + } + 100% { + background-position: 60px 0; + } +} \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/third/party/jsdibjj/web/customGanttPlusWrapper.js b/src/main/resources/com/fr/plugin/third/party/jsdibjj/web/customGanttPlusWrapper.js new file mode 100644 index 0000000..027056c --- /dev/null +++ b/src/main/resources/com/fr/plugin/third/party/jsdibjj/web/customGanttPlusWrapper.js @@ -0,0 +1,876 @@ +!(function () { + Van.FRChartBridge.customGanttPlusWrapper = Van.FRChartBridge.AbstractChart.extend({ + + _init: function (dom, option) { + debugger; + if (!(option.dataStatus === true)) { + return; + } + + var textFontSize = option.seriesNameFont.seriesNameTextStyleFontSize; + + + var graphDatasConf = option.graphDatasConf; + var graphDatas = []; + + for (var i = 0, max = graphDatasConf.length - 1; i <= max; i++) { + var conf = graphDatasConf[i]; + var symbolValue = 'circle'; + var iconPath = ""; + if (conf.type == 'image') { + iconPath = FR.fineServletURL + '/resources?path=' + conf.path; + symbolValue = 'image://' + iconPath; + } + var graphData = {}; + graphData.value = [conf.x, conf.y]; + graphData.symbol = symbolValue; + //graphData.symbolSize = 20; + graphData.itemStyle = {color: 'red'}; + graphDatas.push(graphData); + } + + var fineServletURLResourcesValue = FR.fineServletURL + '/resources?path='; + + /* + * 颜色取反色 + * */ + function reverseColor(OldColorValue) { + var OldColorValue = "0x" + OldColorValue.replace(/#/g, ""); + var str = "000000" + (0xFFFFFF - OldColorValue).toString(16); + return "#" + str.substring(str.length - 6, str.length); + } + + function isStringEmpty(value) { + if ((value == undefined) || (value == null) || (value.length <= 0)) { + return true; + } + return false; + } + + function subStringByLength(str, index, length) { + if (isStringEmpty(str)) { + return ""; + } + return str.substr(index, length); + } + + function getRealValue(value) { + //针对echarts的bug处理,若系列名称有数字,有中文,会默认按数字处理,有中文会显示NaN,故在前面加"甘特图"处理 + if ((value == undefined) || (value == null)) { + return ""; + } + if (typeof (value) != 'string') { + return value; + } + if (value.length <= 3) { + return value; + } + if (value.substr(0, 3) != "甘特图") { + return value; + } + var tempValue = value.substring(3); + return tempValue; + } + + var tempRate = 0.1; + + var rectHeight = 0; + var linesEnable = option.ganttData.animationOption; + var projectCycleColorOption = option.projectCycleColor; + var flashingDataMap = new Map(); + + function renderItem(params, api) { + //debugger; + var categoryIndex = api.value(0); + var start = api.coord([api.value(1), categoryIndex]); + var end = api.coord([api.value(2), categoryIndex]); + var width = end[0] - start[0]; + var height = api.size([0, 1])[1] * 0.6; + rectHeight = height; + + var rectShape = echarts.graphic.clipRectByRect({ + x: start[0], + y: start[1] - height / 2, + width: width, + height: height + }, { + x: params.coordSys.x, + y: params.coordSys.y, + width: params.coordSys.width, + height: params.coordSys.height + }); + + var schedule = api.value(5); + var rectShape1 = echarts.graphic.clipRectByRect({ + x: start[0] + width * schedule, + //x: start[0], + y: start[1] - height / 2, + //width: width * schedule, + width: width * (1 - schedule), + height: height + }, { + x: params.coordSys.x, + y: params.coordSys.y, + width: params.coordSys.width, + height: params.coordSys.height + }); + + var rectShape2 = echarts.graphic.clipRectByRect({ + //x: start[0] + width * schedule, + x: start[0], + y: start[1] - height / 2, + width: width * schedule, + //width: width * (1 - schedule), + height: height + }, { + x: params.coordSys.x, + y: params.coordSys.y, + width: params.coordSys.width, + height: params.coordSys.height + }); + + var textValue = api.value(3); + textValue = getRealValue(textValue); + + var completedColorHex = api.value(6); + //var incompleteColorHex = api.value(7); + var incompleteColorHex = completedColorHex + "33"; + //completedColorHex="rgb(255,0,0)"; + //incompleteColorHex="rgb(255,0,0)"; + incompleteColorHex = completedColorHex; + + var showType = api.value(9); + + + if (showType == "IMAGE") { + debugger; + var rectShapeFill = echarts.graphic.clipRectByRect({ + x: start[0], + y: start[1] - height / 2, + width: width, + height: height + }, { + x: params.coordSys.x, + y: params.coordSys.y, + width: params.coordSys.width, + height: params.coordSys.height + }); + + var imagePath = fineServletURLResourcesValue + api.value(11); + + return { + type: 'image', + //x: start[0], + //y: start[1] - height / 2, + style: { + image: imagePath, + width: 40, + height: height + }, + position: [start[0], start[1] - height / 2] + }; + } + + if (projectCycleColorOption == true) { + + //debugger; + var rectShapeFill = echarts.graphic.clipRectByRect({ + x: start[0], + y: start[1] - height / 2, + width: width, + height: height + }, { + x: params.coordSys.x, + y: params.coordSys.y, + width: params.coordSys.width, + height: params.coordSys.height + }); + + var textColor = reverseColor(completedColorHex); + /*return rectShape && { + type: 'rect', + ignore: !rectShapeFill, + shape: rectShapeFill, + style: api.style({ + fill: completedColorHex, + stroke: completedColorHex, + text: textValue, + //textFill: '#000000', + fontSize: textFontSize, + textFill: textColor, + borderColor: textColor, + lineWidth: 1 + }) + };*/ + + return { + type: 'group', + children: [ + { + type: 'rect', + ignore: !rectShapeFill, + shape: rectShapeFill, + style: api.style({ + fill: completedColorHex, + stroke: completedColorHex, + text: textValue, + //textFill: '#000000', + fontSize: textFontSize, + textFill: textColor, + borderColor: textColor, + lineWidth: 1 + }) + }, + { + type: 'rect', + ignore: !rectShape1, + shape: rectShape1, + //style: api.style({fill: '#ef2000'}) + style: api.style({ + fill: 'rgba(255, 255, 255, 0.5)', + stroke: 'rgba(255, 255, 255, 0.5)', + borderColor: 'transparent', + lineWidth: 0 + }) + }, + { + type: 'rect', + ignore: !rectShapeFill, + shape: rectShapeFill, + style: api.style({ + fill: 'transparent', + stroke: 'transparent', + text: textValue, + fontSize: textFontSize, + textFill: textColor, + borderColor: 'transparent', + lineWidth: 0 + }) + } + + ] + }; + + + } + + + if (showType == "BACKGROUND") { + var rectShapeFill = echarts.graphic.clipRectByRect({ + x: start[0], + y: start[1] - height / 2, + width: width, + height: height + }, { + x: params.coordSys.x, + y: params.coordSys.y, + width: params.coordSys.width, + height: params.coordSys.height + }); + + return rectShape && { + type: 'rect', + ignore: !rectShapeFill, + shape: rectShapeFill, + style: api.style({ + fill: completedColorHex, + stroke: completedColorHex, + lineWidth: 1 + }) + }; + } + + + if (showType == "FILL") { + //debugger; + var flashingId = api.value(0) + "f" + api.value(10); + var size = [width, height]; + flashingDataMap.set(flashingId, size); + + var rectShapeFill = echarts.graphic.clipRectByRect({ + x: start[0], + y: start[1] - height / 2, + width: width, + height: height + }, { + x: params.coordSys.x, + y: params.coordSys.y, + width: params.coordSys.width, + height: params.coordSys.height + }); + + return rectShape && { + type: 'rect', + ignore: !rectShapeFill, + shape: rectShapeFill, + style: api.style({ + fill: completedColorHex, + stroke: completedColorHex, + lineWidth: 1 + }) + }; + } + + var linesEnable_1 = true; + if (linesEnable_1 == true) { + return { + type: 'group', + children: [ + { + type: 'rect', + ignore: !rectShape1, + shape: rectShape1, + //style: api.style({fill: '#ef2000'}) + style: api.style({ + fill: incompleteColorHex, + //fill: "#eae1e1", + stroke: incompleteColorHex, + lineWidth: 1 + }) + }, + { + type: 'rect', + ignore: !rectShape2, + shape: rectShape2, + //style: api.style({fill: '#ef2000'}) + style: api.style({ + //fill: incompleteColorHex, + fill: "transparent", + stroke: incompleteColorHex, + lineWidth: 1 + }) + }, + { + type: 'rect', + ignore: !rectShape, + shape: rectShape, + style: api.style({ + fill: 'transparent', + stroke: 'transparent', + text: textValue, + fontSize: textFontSize, + textFill: '#000000' + }), + styleEmphasis: api.styleEmphasis() + }] + }; + } + + + return { + type: 'group', + children: [ + { + type: 'rect', + ignore: !rectShape, + shape: rectShape, + //style: api.style({fill: '#ddb30b'}) + style: api.style({ + fill: completedColorHex, + stroke: incompleteColorHex, + lineWidth: 1 + }) + }, + { + type: 'rect', + ignore: !rectShape2, + shape: rectShape2, + //style: api.style({fill: '#ef2000'}) + style: api.style({ + fill: incompleteColorHex, + //fill: "#eae1e1", + stroke: incompleteColorHex, + lineWidth: 1 + }) + }, + { + type: 'rect', + ignore: !rectShape, + shape: rectShape, + style: api.style({ + fill: 'transparent', + stroke: 'transparent', + text: textValue, + fontSize: textFontSize, + textFill: '#000000' + }), + styleEmphasis: api.styleEmphasis() + }] + }; + }; + + //var currentTimestamp = (new Date()).getTime(); + + var dateLineWidth = option.ganttData.dateLine.width; + if (dateLineWidth <= 0) { + dateLineWidth = 2; + } + + var dateLineWidthConf = {}; + if (option.ganttData.dateLine.enable) { + dateLineWidthConf = { + tooltip: {show: false}, + symbol: "none", + data: [ + { + silent: true, + lineStyle: { + type: "solid", + color: option.ganttData.dateLine.color, + width: dateLineWidth + }, + label: { + position: 'start', + formatter: "当前时间\n" + option.ganttData.dateLine.currentDateShow + }, + xAxis: option.ganttData.dateLine.currentDate + } + ] + }; + } + + function getDateValueFormatter(value, index) { + var tempDate = new Date(value); + var tempYear = tempDate.getFullYear(); + var tempMonth = tempDate.getMonth() + 1; + if (tempMonth <= 9) { + tempMonth = '0'.concat(tempMonth); + } + var tempDay = tempDate.getDate(); + if (tempDay <= 9) { + tempDay = '0'.concat(tempDay); + } + var content = tempYear + "-" + tempMonth + "-" + tempDay; + return content; + } + + + var ganttOption = { + tooltip: { + formatter: function (params) { + if (isStringEmpty(params.showType) && isStringEmpty(params.data.showType)) { + return ""; + } + + if (params.data.showType == "BACKGROUND") { + return ""; + } + + if (params.data.showType == "FILL") { + return "接替脱节" + params.data.days + "天"; + } + var seriesName = params.name; + seriesName = getRealValue(seriesName); + var schedule = params.value[8]; + return seriesName + ': 进度' + schedule + "
" + subStringByLength(params.data.beginDateShow, 0, 10) + "至" + subStringByLength(params.data.endDateShow, 0, 10); + } + }, + title: { + //text: option.ganttTitle, + //left: 'center' + text: option.ganttTitle.titleText, + left: option.ganttTitle.titleLeft, + //textAlign: 'center' + textStyle: { + color: option.ganttTitle.titleTextStyleColor, + fontStyle: option.ganttTitle.titleTextStyleFontStyle, + fontWeight: option.ganttTitle.titleTextStyleFontWeight, + fontFamily: option.ganttTitle.titleTextStyleFontFamily, + fontSize: option.ganttTitle.titleTextStyleFontSize + } + }, + dataZoom: [ + { + type: 'slider', + filterMode: 'weakFilter', + showDataShadow: false, + bottom: 0, + height: 10, + borderColor: 'transparent', + backgroundColor: '#e2e2e2', +// backgroundColor: '#ff0000', + handleIcon: 'M10.7,11.9H9.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z', // jshint ignore:line + handleSize: 20, + handleStyle: { + shadowBlur: 6, + shadowOffsetX: 1, + shadowOffsetY: 2, + shadowColor: '#aaa' + }, + labelFormatter: '' + }, { + type: 'inside', + filterMode: 'weakFilter' + }, { + type: 'slider', + yAxisIndex: 0, + zoomLock: true, + width: 10, + right: 10, + top: 0, + bottom: 20, + //start: 20, + start: option.ganttData.displayScale, + end: 100, + handleSize: 0, + showDetail: false, + }, { + type: 'inside', + id: 'insideY', + yAxisIndex: 0, + // start: 20, + start: option.ganttData.displayScale, + end: 100, + zoomOnMouseWheel: false, + moveOnMouseMove: true, + moveOnMouseWheel: true + }], + grid: { + //height: 300 + top: 5, + containLabel: true + }, + xAxis: { + min: option.ganttData.minDate, + max: option.ganttData.maxDate, + scale: true, + type: 'time', + position: 'top', + splitLine: { + lineStyle: { + color: ['#E9EDFF'] + } + }, + axisLine: { + show: false + }, + axisTick: { + lineStyle: { + color: '#929ABA' + } + }, + axisLabel: { + color: '#929ABA', + inside: false, + align: 'center', + formatter: getDateValueFormatter + } + }, + yAxis: { + data: option.ganttData.categories, + axisLabel: { + color: option.yAxisAxisLabelFont.yAxisAxisLabelColor, + fontStyle: option.yAxisAxisLabelFont.yAxisAxisLabelFontStyle, + fontWeight: option.yAxisAxisLabelFont.yAxisAxisLabelFontWeight, + fontFamily: option.yAxisAxisLabelFont.yAxisAxisLabelFontFamily, + fontSize: option.yAxisAxisLabelFont.yAxisAxisLabelFontSize + } + }, + series: [ + { + type: 'custom', + zlevel: 5, + markLine: dateLineWidthConf + }, + /*{ + type: 'lines', + polyline: true, + coordinateSystem: 'cartesian2d', + lineStyle: { + type: 'dashed', + width: 0, + //color: '#175064', + curveness: 0.3 + + }, + effect: { + show: true, + trailLength: 0.1, + symbol: 'rect', + //color: 'orange', + symbolSize: 2, + period: 2 + }, + data: option.ganttData.linesData, + zlevel: 10 + },*/ + { + type: 'custom', + renderItem: renderItem, + itemStyle: { + opacity: 0.8 + }, + encode: { + x: [1, 2], + y: 0 + }, + data: option.ganttData.seriesData, + zlevel: 20 + // markLine: dateLineWidthConf + } + ] + }; + + var chart = echarts.init(dom); + + //绑定点击触发超链函数 + chart.on('click', this.getLinkFun()); + chart.setOption(ganttOption, true); + //var tempOption = chart.getOption(); + //var symbolSizeValue = chart._api.size([0, 1])[1] * 0.6; + //var symbolSizeValue = chart._api.getHeight(); + + // rectHeight = rectHeight*0.5; + var periodValue = 2; + if (linesEnable == true) { + periodValue = 2; + } else { + periodValue = 0; + } + var ganttOption1 = { + tooltip: { + formatter: function (params) { + if (isStringEmpty(params.showType) && isStringEmpty(params.data.showType)) { + return ""; + } + var seriesName = params.name; + seriesName = getRealValue(seriesName); + var schedule = params.value[8]; + + if (params.data.showType == "BACKGROUND") { + return ""; + } + if (params.data.showType == "FILL") { + return ""; + } + if (params.data.showType == "IMAGE") { + return schedule + "
时间:" + subStringByLength(params.data.beginDateShow, 0, 10) + } + + return seriesName + "
" + '进度' + schedule + "
" + subStringByLength(params.data.beginDateShow, 0, 10) + "至" + subStringByLength(params.data.endDateShow, 0, 10); + } + }, + title: { + text: option.ganttTitle.titleText, + left: option.ganttTitle.titleLeft, + //textAlign: 'center' + textStyle: { + color: option.ganttTitle.titleTextStyleColor, + fontStyle: option.ganttTitle.titleTextStyleFontStyle, + fontWeight: option.ganttTitle.titleTextStyleFontWeight, + fontFamily: option.ganttTitle.titleTextStyleFontFamily, + fontSize: option.ganttTitle.titleTextStyleFontSize + } + }, + dataZoom: [ + { + type: 'slider', + filterMode: 'weakFilter', + showDataShadow: false, + bottom: 0, + height: 10, + borderColor: 'transparent', + backgroundColor: '#e2e2e2', +// backgroundColor: '#ff0000', + handleIcon: 'M10.7,11.9H9.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z', // jshint ignore:line + handleSize: 20, + handleStyle: { + shadowBlur: 6, + shadowOffsetX: 1, + shadowOffsetY: 2, + shadowColor: '#aaa' + }, + labelFormatter: '', + //start: 0, + //end: option.ganttData.displayXScale + start: option.ganttData.displayXScale, + end: 100 + }, { + type: 'inside', + filterMode: 'weakFilter' + }, { + type: 'slider', + yAxisIndex: 0, + zoomLock: true, + width: 10, + right: 10, + top: 70, + bottom: 20, + //start: 20, + start: option.ganttData.displayScale, + end: 100, + handleSize: 0, + showDetail: false, + }, { + type: 'inside', + id: 'insideY', + yAxisIndex: 0, + // start: 20, + start: option.ganttData.displayScale, + end: 100, + zoomOnMouseWheel: false, + moveOnMouseMove: true, + moveOnMouseWheel: true + }], + grid: { + //height: 300 + top: 5, + left: 5, + right: 30, + //bottom:5, + containLabel: true + }, + xAxis: { + min: option.ganttData.minDate, + max: option.ganttData.maxDate, + scale: true, + type: 'time', + position: 'top', + splitLine: { + lineStyle: { + color: ['#E9EDFF'] + } + }, + axisLine: { + show: false + }, + axisTick: { + lineStyle: { + color: '#929ABA' + } + }, + axisLabel: { + color: '#929ABA', + inside: false, + align: 'center', + formatter: getDateValueFormatter + } + }, + yAxis: { + data: option.ganttData.categories, + axisLabel: { + //backgroundColor:'red', + //height:2, + color: option.yAxisAxisLabelFont.yAxisAxisLabelColor, + fontStyle: option.yAxisAxisLabelFont.yAxisAxisLabelFontStyle, + fontWeight: option.yAxisAxisLabelFont.yAxisAxisLabelFontWeight, + fontFamily: option.yAxisAxisLabelFont.yAxisAxisLabelFontFamily, + fontSize: option.yAxisAxisLabelFont.yAxisAxisLabelFontSize, + formatter: function (value, index) { + //debugger; + var index = value.lastIndexOf("\n"); + if (index <= 0) { + return value; + } + var name = value.substring(0, index); + var name1 = value.substring(index + 1); + name1 = name1 || ''; + if (name1.length <= 0) { + return name; + } + if (option.fillGap.enable && (option.fillGap.enable == true)) { + return name + "\n" + "{suspendStyle|" + name1 + "}"; + } + return name; + }, + rich: { + suspendStyle: { + color: option.fillGap.color + } + } + } + }, + series: [ + { + type: 'custom', + zlevel: 0, + markLine: dateLineWidthConf + }, + { + type: 'lines', + polyline: true, + coordinateSystem: 'cartesian2d', + lineStyle: { + type: 'dashed', + //width: rectHeight, + width: 0, + //color: '#175064', + opacity: 0.3, + curveness: 0.3 + + }, + effect: { + show: true, + trailLength: 0.1, + //symbol: 'diamond', + //color: 'orange', + //symbolSize: [rectHeight,10], + symbol: option.ganttData.symbolType, + symbolSize: [rectHeight, option.ganttData.symbolWidth], + period: periodValue + //period: 0 + //constantSpeed: 20 + }, + data: option.ganttData.linesData, + zlevel: 10 + }, + { + type: 'custom', + renderItem: renderItem, + itemStyle: { + opacity: 0.8 + }, + encode: { + x: [1, 2], + y: 0 + }, + data: option.ganttData.seriesData, + zlevel: 20 + // markLine: dateLineWidthConf + }, { + type: 'graph', + layout: 'none', + coordinateSystem: 'cartesian2d', + symbolSize: 50, + label: { + show: false + }, + lineStyle: { + width: 0, + opacity: 1 + }, + data: graphDatas, + zlevel: 30 + + } + ] + }; + if (linesEnable) { + // chart.setOption(ganttOption1, true); + } + + chart.setOption(ganttOption1, true); + + chart.on('mouseover', function (params) { + //console.log(params); + }); + chart.on('click', function (params) { + console.log(params); + }); + + return chart; + }, + + _refresh: function (chart, option) { + chart.setOption(option); + }, + + _resize: function (chart) { + chart.resize(); + }, + + _emptyData: function (options) { + return options.series.data.length === 0; + } + }) +})(); \ No newline at end of file diff --git a/src/main/resources/com/fr/plugin/third/party/jsdibjj/web/echarts-adapter.js b/src/main/resources/com/fr/plugin/third/party/jsdibjj/web/echarts-adapter.js new file mode 100644 index 0000000..2aa0f20 --- /dev/null +++ b/src/main/resources/com/fr/plugin/third/party/jsdibjj/web/echarts-adapter.js @@ -0,0 +1,7 @@ +var document = { + createElement: function(element) { + if (element == 'canvas') { + return new Canvas(); + } + }, +}; diff --git a/src/main/resources/com/fr/plugin/third/party/jsdibjj/web/echarts.min.js b/src/main/resources/com/fr/plugin/third/party/jsdibjj/web/echarts.min.js new file mode 100644 index 0000000..4b25b97 --- /dev/null +++ b/src/main/resources/com/fr/plugin/third/party/jsdibjj/web/echarts.min.js @@ -0,0 +1,22 @@ + +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + + +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.echarts={})}(this,function(t){"use strict";var e=2311,n=function(){return e++},v="object"==typeof wx&&"function"==typeof wx.getSystemInfoSync?{browser:{},os:{},node:!1,wxa:!0,canvasSupported:!0,svgSupported:!1,touchEventsSupported:!0,domSupported:!1}:"undefined"==typeof document&&"undefined"!=typeof self?{browser:{},os:{},node:!1,worker:!0,canvasSupported:!0,domSupported:!1}:"undefined"==typeof navigator?{browser:{},os:{},node:!0,worker:!1,canvasSupported:!0,svgSupported:!0,domSupported:!1}:function(t){var e={},i=t.match(/Firefox\/([\d.]+)/),n=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),o=t.match(/Edge\/([\d.]+)/),a=/micromessenger/i.test(t);i&&(e.firefox=!0,e.version=i[1]);n&&(e.ie=!0,e.version=n[1]);o&&(e.edge=!0,e.version=o[1]);a&&(e.weChat=!0);return{browser:e,os:{},node:!1,canvasSupported:!!document.createElement("canvas").getContext,svgSupported:"undefined"!=typeof SVGRect,touchEventsSupported:"ontouchstart"in window&&!e.ie&&!e.edge,pointerEventsSupported:"onpointerdown"in window&&(e.edge||e.ie&&11<=e.version),domSupported:"undefined"!=typeof document}}(navigator.userAgent);var s={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},l={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},u=Object.prototype.toString,i=Array.prototype,r=i.forEach,h=i.filter,o=i.slice,c=i.map,d=i.reduce,a={};function f(t,e){"createCanvas"===t&&(g=null),a[t]=e}function k(t){if(null==t||"object"!=typeof t)return t;var e=t,i=u.call(t);if("[object Array]"===i){if(!$(t)){e=[];for(var n=0,o=t.length;n>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[l]+":0",o[u]+":0",n[1-l]+":auto",o[1-u]+":auto",""].join("!important;"),t.appendChild(r),i.push(r)}return i}(e,a),a,o);if(r)return r(t,i,n),!0}return!1}function zt(t){return"CANVAS"===t.nodeName.toUpperCase()}var Bt="undefined"!=typeof window&&!!window.addEventListener,Vt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Gt=[];function Ft(t,e,i,n){return i=i||{},n||!v.canvasSupported?Wt(t,e,i):v.browser.firefox&&null!=e.layerX&&e.layerX!==e.offsetX?(i.zrX=e.layerX,i.zrY=e.layerY):null!=e.offsetX?(i.zrX=e.offsetX,i.zrY=e.offsetY):Wt(t,e,i),i}function Wt(t,e,i){if(v.domSupported&&t.getBoundingClientRect){var n=e.clientX,o=e.clientY;if(zt(t)){var a=t.getBoundingClientRect();return i.zrX=n-a.left,void(i.zrY=o-a.top)}if(Et(Gt,t,n,o))return i.zrX=Gt[0],void(i.zrY=Gt[1])}i.zrX=i.zrY=0}function Ht(t){return t||window.event}function Zt(t,e,i){if(null!=(e=Ht(e)).zrX)return e;var n=e.type;if(n&&0<=n.indexOf("touch")){var o="touchend"!==n?e.targetTouches[0]:e.changedTouches[0];o&&Ft(t,o,e,i)}else Ft(t,e,e,i),e.zrDelta=e.wheelDelta?e.wheelDelta/120:-(e.detail||0)/3;var a=e.button;return null==e.which&&void 0!==a&&Vt.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function Ut(t,e,i,n){Bt?t.addEventListener(e,i,n):t.attachEvent("on"+e,i)}var Xt=Bt?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0};function Yt(t){return 2===t.which||3===t.which}function jt(){this._track=[]}function qt(t){var e=t[1][0]-t[0][0],i=t[1][1]-t[0][1];return Math.sqrt(e*e+i*i)}jt.prototype={constructor:jt,recognize:function(t,e,i){return this._doTrack(t,e,i),this._recognize(t)},clear:function(){return this._track.length=0,this},_doTrack:function(t,e,i){var n=t.touches;if(n){for(var o={points:[],touches:[],target:e,event:t},a=0,r=n.length;an.getWidth()||i<0||i>n.getHeight()}te.prototype={constructor:te,setHandlerProxy:function(e){this.proxy&&this.proxy.dispose(),e&&(R(ee,function(t){e.on&&e.on(t,this[t],this)},this),e.handler=this),this.proxy=e},mousemove:function(t){var e=t.zrX,i=t.zrY,n=ne(this,e,i),o=this._hovered,a=o.target;a&&!a.__zr&&(a=(o=this.findHover(o.x,o.y)).target);var r=this._hovered=n?{x:e,y:i}:this.findHover(e,i),s=r.target,l=this.proxy;l.setCursor&&l.setCursor(s?s.cursor:"default"),a&&s!==a&&this.dispatchToElement(o,"mouseout",t),this.dispatchToElement(r,"mousemove",t),s&&s!==a&&this.dispatchToElement(r,"mouseover",t)},mouseout:function(t){var e=t.zrEventControl,i=t.zrIsToLocalDOM;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&(i||this.trigger("globalout",{type:"globalout",event:t}))},resize:function(t){this._hovered={}},dispatch:function(t,e){var i=this[t];i&&i.call(this,e)},dispose:function(){this.proxy.dispose(),this.storage=this.proxy=this.painter=null},setCursorStyle:function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},dispatchToElement:function(t,e,i){var n=(t=t||{}).target;if(!n||!n.silent){for(var o="on"+e,a=function(t,e,i){return{type:t,event:i,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:i.zrX,offsetY:i.zrY,gestureEvent:i.gestureEvent,pinchX:i.pinchX,pinchY:i.pinchY,pinchScale:i.pinchScale,wheelDelta:i.zrDelta,zrByTouch:i.zrByTouch,which:i.which,stop:Jt}}(e,t,i);n&&(n[o]&&(a.cancelBubble=n[o].call(n,a)),n.trigger(e,a),n=n.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(e,a),this.painter&&this.painter.eachOtherLayer(function(t){"function"==typeof t[o]&&t[o].call(t,a),t.trigger&&t.trigger(e,a)}))}},findHover:function(t,e,i){for(var n=this.storage.getDisplayList(),o={x:t,y:e},a=n.length-1;0<=a;a--){var r;if(n[a]!==i&&!n[a].ignore&&(r=ie(n[a],t,e))&&(o.topTarget||(o.topTarget=n[a]),r!==$t)){o.target=n[a];break}}return o},processGesture:function(t,e){this._gestureMgr||(this._gestureMgr=new jt);var i=this._gestureMgr;"start"===e&&i.clear();var n=i.recognize(t,this.findHover(t.zrX,t.zrY,null).target,this.proxy.dom);if("end"===e&&i.clear(),n){var o=n.type;t.gestureEvent=o,this.dispatchToElement({target:n.target},o,n.event)}}},R(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(r){te.prototype[r]=function(t){var e,i,n=t.zrX,o=t.zrY,a=ne(this,n,o);if("mouseup"===r&&a||(i=(e=this.findHover(n,o)).target),"mousedown"===r)this._downEl=i,this._downPoint=[t.zrX,t.zrY],this._upEl=i;else if("mouseup"===r)this._upEl=i;else if("click"===r){if(this._downEl!==this._upEl||!this._downPoint||4=this._maxSize&&0>4|(3840&n)>>8,240&n|(240&n)>>4,15&n|(15&n)<<4,1),Ge(t,e),e):void Ee(e,0,0,0,1):7===o.length?0<=(n=parseInt(o.substr(1),16))&&n<=16777215?(Ee(e,(16711680&n)>>16,(65280&n)>>8,255&n,1),Ge(t,e),e):void Ee(e,0,0,0,1):void 0;var a=o.indexOf("("),r=o.indexOf(")");if(-1!==a&&r+1===o.length){var s=o.substr(0,a),l=o.substr(a+1,r-(a+1)).split(","),u=1;switch(s){case"rgba":if(4!==l.length)return void Ee(e,0,0,0,1);u=Ne(l.pop());case"rgb":return 3!==l.length?void Ee(e,0,0,0,1):(Ee(e,Pe(l[0]),Pe(l[1]),Pe(l[2]),u),Ge(t,e),e);case"hsla":return 4!==l.length?void Ee(e,0,0,0,1):(l[3]=Ne(l[3]),We(l,e),Ge(t,e),e);case"hsl":return 3!==l.length?void Ee(e,0,0,0,1):(We(l,e),Ge(t,e),e);default:return}}Ee(e,0,0,0,1)}}function We(t,e){var i=(parseFloat(t[0])%360+360)%360/360,n=Ne(t[1]),o=Ne(t[2]),a=o<=.5?o*(n+1):o+n-o*n,r=2*o-a;return Ee(e=e||[],Le(255*Oe(r,a,i+1/3)),Le(255*Oe(r,a,i)),Le(255*Oe(r,a,i-1/3)),1),4===t.length&&(e[3]=t[3]),e}function He(t,e){var i=Fe(t);if(i){for(var n=0;n<3;n++)i[n]=e<0?i[n]*(1-e)|0:(255-i[n])*e+i[n]|0,255e);i++);i=Math.min(i-1,u-2)}C=e;var n=g[(D=i)+1]-g[i];if(0!=n)if(S=(e-g[i])/n,l)if(I=m[i],M=m[0===i?i:i-1],T=m[u-2=i.x&&t<=i.x+i.width&&e>=i.y&&e<=i.y+i.height},clone:function(){return new Di(this.x,this.y,this.width,this.height)},copy:function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},Di.create=function(t){return new Di(t.x,t.y,t.width,t.height)};var Ci=function(t){for(var e in t=t||{},_i.call(this,t),t)t.hasOwnProperty(e)&&(this[e]=t[e]);this._children=[],this.__storage=null,this.__dirty=!0};Ci.prototype={constructor:Ci,isGroup:!0,type:"group",silent:!1,children:function(){return this._children.slice()},childAt:function(t){return this._children[t]},childOfName:function(t){for(var e=this._children,i=0;i>>1])<0?l=a:s=1+a;var u=n-s;switch(u){case 3:t[s+3]=t[s+2];case 2:t[s+2]=t[s+1];case 1:t[s+1]=t[s];break;default:for(;0>>1);0>>1);a(t,e[i+h])<0?l=h:r=h+1}return l}function Ei(p,g){var r,s,m=ki,l=0,v=[];function e(t){var e=r[t],i=s[t],n=r[t+1],o=s[t+1];s[t]=i+o,t===l-3&&(r[t+1]=r[t+2],s[t+1]=s[t+2]),l--;var a=Ri(p[n],p,e,i,0,g);e+=a,0!==(i-=a)&&0!==(o=Oi(p[e+i-1],p,n,o,o-1,g))&&(i<=o?function(t,e,i,n){var o=0;for(o=0;os[t+1])break;e(t)}},this.forceMergeRuns=function(){for(;1>=1;return t+e}(o);do{if((a=Pi(t,i,n,e))=e.maxIterations){t+=e.ellipsis;break}var s=0===r?bn(t,o,e.ascCharWidth,e.cnCharWidth):0f)return{lines:[],width:0,height:0};C.textWidth=pn(C.text,w);var S=x.textWidth,M=null==S||"auto"===S;if("string"==typeof S&&"%"===S.charAt(S.length-1))C.percentWidth=S,u.push(C),S=0;else{if(M){S=C.textWidth;var I=x.textBackgroundColor,T=I&&I.image;T&&sn(T=on(T))&&(S=Math.max(S,T.width*b/T.height))}var A=_?_[1]+_[3]:0;S+=A;var D=null!=d?d-v:null;null!=D&&Dn[0]){for(r=0;rt);r++);a=i[n[r]]}if(n.splice(r+1,0,t),!(i[t]=e).virtual)if(a){var l=a.dom;l.nextSibling?s.insertBefore(e.dom,l.nextSibling):s.appendChild(e.dom)}else s.firstChild?s.insertBefore(e.dom,s.firstChild):s.appendChild(e.dom)}else vi("Layer of zlevel "+t+" is not valid")},eachLayer:function(t,e){var i,n,o=this._zlevelList;for(n=0;n=a.length&&a.push({option:t})}}),a}function Zo(t){var r=Q();Ro(t,function(t,e){var i=t.exist;i&&r.set(i.id,t)}),Ro(t,function(t,e){var i=t.option;Y(!i||null==i.id||!r.get(i.id)||r.get(i.id)===t,"id duplicates: "+(i&&i.id)),i&&null!=i.id&&r.set(i.id,t),t.keyInfo||(t.keyInfo={})}),Ro(t,function(t,e){var i=t.exist,n=t.option,o=t.keyInfo;if(Eo(n)){if(o.name=null!=n.name?n.name+"":i?i.name:Bo+e,i)o.id=i.id;else if(null!=n.id)o.id=n.id+"";else for(var a=0;o.id="\0"+o.name+"\0"+a++,r.get(o.id););r.set(o.id,t)}})}function Uo(t){var e=t.name;return!(!e||!e.indexOf(Bo))}function Xo(t){return Eo(t)&&t.id&&0===(t.id+"").indexOf("\0_ec_\0")}function Yo(e,t){return null!=t.dataIndexInside?t.dataIndexInside:null!=t.dataIndex?L(t.dataIndex)?O(t.dataIndex,function(t){return e.indexOfRawIndex(t)}):e.indexOfRawIndex(t.dataIndex):null!=t.name?L(t.name)?O(t.name,function(t){return e.indexOfName(t)}):e.indexOfName(t.name):void 0}function jo(){var e="__\0ec_inner_"+qo+++"_"+Math.random().toFixed(5);return function(t){return t[e]||(t[e]={})}}var qo=0;function Ko(s,l,u){if(E(l)){var t={};t[l+"Index"]=0,l=t}var e=u&&u.defaultMainType;!e||$o(l,e+"Index")||$o(l,e+"Id")||$o(l,e+"Name")||(l[e+"Index"]=0);var h={};return Ro(l,function(t,e){t=l[e];if("dataIndex"!==e&&"dataIndexInside"!==e){var i=e.match(/^(\w+)(Index|Id|Name)$/)||[],n=i[1],o=(i[2]||"").toLowerCase();if(!(!n||!o||null==t||"index"===o&&"none"===t||u&&u.includeMainTypes&&_(u.includeMainTypes,n)<0)){var a={mainType:n};"index"===o&&"all"===t||(a[o]=t);var r=s.queryComponents(a);h[n+"Models"]=r,h[n+"Model"]=r[0]}}else h[e]=t}),h}function $o(t,e){return t&&t.hasOwnProperty(e)}function Jo(t,e,i){t.setAttribute?t.setAttribute(e,i):t[e]=i}function Qo(t){return"auto"===t?v.domSupported?"html":"richText":t||"html"}function ta(t,i){var n=Q(),o=[];return R(t,function(t){var e=i(t);(n.get(e)||(o.push(e),n.set(e,[]))).push(t)}),{keys:o,buckets:n}}var ea=".",ia="___EC__COMPONENT__CONTAINER___";function na(t){var e={main:"",sub:""};return t&&(t=t.split(ea),e.main=t[0]||"",e.sub=t[1]||""),e}function oa(t){(t.$constructor=t).extend=function(t){function e(){t.$constructor?t.$constructor.apply(this,arguments):i.apply(this,arguments)}var i=this;return P(e.prototype,t),e.extend=this.extend,e.superCall=sa,e.superApply=la,w(e,this),e.superClass=i,e}}var aa=0;function ra(t){var e=["__\0is_clz",aa++,Math.random().toFixed(3)].join("_");t.prototype[e]=!0,t.isInstance=function(t){return!(!t||!t[e])}}function sa(t,e){var i=U(arguments,2);return this.superClass.prototype[e].apply(t,i)}function la(t,e,i){return this.superClass.prototype[e].apply(t,i)}function ua(i,t){t=t||{};var o={};if(i.registerClass=function(t,e){if(e)if(function(t){Y(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}(e),(e=na(e)).sub){if(e.sub!==ia){(function(t){var e=o[t.main];e&&e[ia]||((e=o[t.main]={})[ia]=!0);return e})(e)[e.sub]=t}}else o[e.main]=t;return t},i.getClass=function(t,e,i){var n=o[t];if(n&&n[ia]&&(n=e?n[e]:null),i&&!n)throw new Error(e?"Component "+t+"."+(e||"")+" not exists. Load it first.":t+".type should be specified.");return n},i.getClassesByMainType=function(t){t=na(t);var i=[],e=o[t.main];return e&&e[ia]?R(e,function(t,e){e!==ia&&i.push(t)}):i.push(e),i},i.hasClass=function(t){return t=na(t),!!o[t.main]},i.getAllClassMainTypes=function(){var i=[];return R(o,function(t,e){i.push(e)}),i},i.hasSubTypes=function(t){t=na(t);var e=o[t.main];return e&&e[ia]},i.parseClassType=na,t.registerWhenExtend){var n=i.extend;n&&(i.extend=function(t){var e=n.call(this,t);return i.registerClass(e,t.type)})}return i}function ha(s){for(var t=0;tthis._ux||or(e-this._yi)>this._uy||this._len<5;return this.addData(ja.L,t,e),this._ctx&&i&&(this._needsDash()?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),i&&(this._xi=t,this._yi=e),this},bezierCurveTo:function(t,e,i,n,o,a){return this.addData(ja.C,t,e,i,n,o,a),this._ctx&&(this._needsDash()?this._dashedBezierTo(t,e,i,n,o,a):this._ctx.bezierCurveTo(t,e,i,n,o,a)),this._xi=o,this._yi=a,this},quadraticCurveTo:function(t,e,i,n){return this.addData(ja.Q,t,e,i,n),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(t,e,i,n):this._ctx.quadraticCurveTo(t,e,i,n)),this._xi=i,this._yi=n,this},arc:function(t,e,i,n,o,a){return this.addData(ja.A,t,e,i,i,n,o-n,0,a?0:1),this._ctx&&this._ctx.arc(t,e,i,n,o,a),this._xi=er(o)*i+t,this._yi=ir(o)*i+e,this},arcTo:function(t,e,i,n,o){return this._ctx&&this._ctx.arcTo(t,e,i,n,o),this},rect:function(t,e,i,n){return this._ctx&&this._ctx.rect(t,e,i,n),this.addData(ja.R,t,e,i,n),this},closePath:function(){this.addData(ja.Z);var t=this._ctx,e=this._x0,i=this._y0;return t&&(this._needsDash()&&this._dashedLineTo(e,i),t.closePath()),this._xi=e,this._yi=i,this},fill:function(t){t&&t.fill(),this.toStatic()},stroke:function(t){t&&t.stroke(),this.toStatic()},setLineDash:function(t){if(t instanceof Array){this._lineDash=t;for(var e=this._dashIdx=0,i=0;ie.length&&(this._expandData(),e=this.data);for(var i=0;il||or(r-o)>u||c===h-1)&&(t.lineTo(a,r),n=a,o=r);break;case ja.C:t.bezierCurveTo(s[c++],s[c++],s[c++],s[c++],s[c++],s[c++]),n=s[c-2],o=s[c-1];break;case ja.Q:t.quadraticCurveTo(s[c++],s[c++],s[c++],s[c++]),n=s[c-2],o=s[c-1];break;case ja.A:var f=s[c++],p=s[c++],g=s[c++],m=s[c++],v=s[c++],y=s[c++],x=s[c++],_=s[c++],w=m=yr[n=0]+t&&r<=yr[1]+t?h:0}if(a){l=n;n=cr(o),o=cr(l)}else n=cr(n),o=cr(o);oMath.PI/2&&p<1.5*Math.PI&&(h=-h),c+=h)}}return c}function Sr(t,e,i,n,o){for(var a=0,r=0,s=0,l=0,u=0,h=0;hMath.abs(a[1])?0=e[1])return i[1]}else{if(t>=e[0])return i[0];if(t<=e[1])return i[1]}else{if(t===e[0])return i[0];if(t===e[1])return i[1]}return(t-e[0])/o*a+i[0]}function El(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return"string"==typeof t?function(t){return t.replace(/^\s+|\s+$/g,"")}(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t}function zl(t,e,i){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),i?t:+t}function Bl(t){return t.sort(function(t,e){return t-e}),t}function Vl(t){if(t=+t,isNaN(t))return 0;for(var e=1,i=0;Math.round(t*e)/e!==t;)e*=10,i++;return i}function Gl(t){var e=t.toString(),i=e.indexOf("e");if(0h&&(h=u[d],c=d);++s[c],u[c]=0,++l}return s[e]/o}var Hl=9007199254740991;function Zl(t){var e=2*Math.PI;return(t%e+e)%e}function Ul(t){return-Ol"'])/g,ou={"&":"&","<":"<",">":">",'"':""","'":"'"};function au(t){return null==t?"":(t+"").replace(nu,function(t,e){return ou[e]})}function ru(t,e){return"{"+t+(null==e?"":e)+"}"}var su=["a","b","c","d","e","f","g"];function lu(t,e,i){L(e)||(e=[e]);var n=e.length;if(!n)return"";for(var o=e[0].$vars||[],a=0;a':'':{renderMode:o,content:"{marker"+a+"|} ",style:{color:i}}:""}function cu(t,e){return"0000".substr(0,e-(t+="").length)+t}function du(t,e,i){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var n=Yl(e),o=i?"UTC":"",a=n["get"+o+"FullYear"](),r=n["get"+o+"Month"]()+1,s=n["get"+o+"Date"](),l=n["get"+o+"Hours"](),u=n["get"+o+"Minutes"](),h=n["get"+o+"Seconds"](),c=n["get"+o+"Milliseconds"]();return t=t.replace("MM",cu(r,2)).replace("M",r).replace("yyyy",a).replace("yy",a%100).replace("dd",cu(s,2)).replace("d",s).replace("hh",cu(l,2)).replace("h",l).replace("mm",cu(u,2)).replace("m",u).replace("ss",cu(h,2)).replace("s",h).replace("SSS",cu(c,3))}function fu(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t}var pu=xn;function gu(t,e){if("_blank"===e||"blank"===e){var i=window.open();i.opener=null,i.location=t}else window.open(t,e)}var mu=(Object.freeze||Object)({addCommas:tu,toCamelCase:eu,normalizeCssArray:iu,encodeHTML:au,formatTpl:lu,formatTplSimple:uu,getTooltipMarker:hu,formatTime:du,capitalFirst:fu,truncateText:pu,getTextBoundingRect:function(t){return gn(t.text,t.font,t.textAlign,t.textVerticalAlign,t.textPadding,t.textLineHeight,t.rich,t.truncate)},getTextRect:function(t,e,i,n,o,a,r,s){return gn(t,e,i,n,o,s,a,r)},windowOpen:gu}),vu=R,yu=["left","right","top","bottom","width","height"],xu=[["width","left","right"],["height","top","bottom"]];function _u(h,c,d,f,p){var g=0,m=0;null==f&&(f=1/0),null==p&&(p=1/0);var v=0;c.eachChild(function(t,e){var i,n,o=t.position,a=t.getBoundingRect(),r=c.childAt(e+1),s=r&&r.getBoundingRect();if("horizontal"===h){var l=a.width+(s?-s.x+a.x:0);v=f<(i=g+l)||t.newline?(g=0,i=l,m+=v+d,a.height):Math.max(v,a.height)}else{var u=a.height+(s?-s.y+a.y:0);v=p<(n=m+u)||t.newline?(g+=v+d,m=0,n=u,a.width):Math.max(v,a.width)}t.newline||(o[0]=g,o[1]=m,"horizontal"===h?g=i+d:m=n+d)})}var wu=_u;T(_u,"vertical"),T(_u,"horizontal");function bu(t,e,i){i=iu(i||0);var n=e.width,o=e.height,a=El(t.left,n),r=El(t.top,o),s=El(t.right,n),l=El(t.bottom,o),u=El(t.width,n),h=El(t.height,o),c=i[2]+i[0],d=i[1]+i[3],f=t.aspect;switch(isNaN(u)&&(u=n-s-d-a),isNaN(h)&&(h=o-l-c-r),null!=f&&(isNaN(u)&&isNaN(h)&&(n/oe)return t[n];return t[i-1]}(s,i):r;if((l=l||r)&&l.length){var u=l[o];return t&&(a[t]=u),n.colorIdx=(o+1)%l.length,u}}},zu="original",Bu="arrayRows",Vu="objectRows",Gu="keyedColumns",Fu="unknown",Wu="typedArray",Hu="column",Zu="row";function Uu(t){this.fromDataset=t.fromDataset,this.data=t.data||(t.sourceFormat===Gu?{}:[]),this.sourceFormat=t.sourceFormat||Fu,this.seriesLayoutBy=t.seriesLayoutBy||Hu,this.dimensionsDefine=t.dimensionsDefine,this.encodeDefine=t.encodeDefine&&Q(t.encodeDefine),this.startIndex=t.startIndex||0,this.dimensionsDetectCount=t.dimensionsDetectCount}Uu.seriesDataToSource=function(t){return new Uu({data:t,sourceFormat:V(t)?Wu:zu,fromDataset:!1})},ra(Uu);var Xu={Must:1,Might:2,Not:3},Yu=jo();function ju(t){var e=t.option,i=e.data,n=V(i)?Wu:zu,o=!1,a=e.seriesLayoutBy,r=e.sourceHeader,s=e.dimensions,l=Qu(t);if(l){var u=l.option;i=u.source,n=Yu(l).sourceFormat,o=!0,a=a||u.seriesLayoutBy,null==r&&(r=u.sourceHeader),s=s||u.dimensions}var h=function(t,e,i,n,o){if(!t)return{dimensionsDefine:qu(o)};var a,r;if(e===Bu)"auto"===n||null==n?Ku(function(t){null!=t&&"-"!==t&&(E(t)?null==r&&(r=1):r=0)},i,t,10):r=n?1:0,o||1!==r||(o=[],Ku(function(t,e){o[e]=null!=t?t:""},i,t)),a=o?o.length:i===Zu?t.length:t[0]?t[0].length:null;else if(e===Vu)o=o||function(t){var e,i=0;for(;i":"\n",f="richText"===c,p={},g=0;function i(t){return{renderMode:c,content:au(tu(t)),style:p}}var m=this.getData(),a=m.mapDimension("defaultedTooltip",!0),n=a.length,r=this.getRawValue(o),s=L(r),v=m.getItemVisual(o,"color");z(v)&&v.colorStops&&(v=(v.colorStops[0]||{}).color),v=v||"transparent";var l=(1":"",n=i+u.join(i||", ");return{renderMode:c,content:n,style:p}}(r):i(n?Hh(m,o,a[0]):s?r[0]:r)).content,u=d.seriesIndex+"at"+g,y=hu({color:v,type:"item",renderMode:c,markerId:u});p[u]=v,++g;var x=m.getName(o),_=this.name;Uo(this)||(_=""),_=_?au(_)+(h?": ":e):"";var w="string"==typeof y?y:y.content;return{html:h?w+_+l:_+w+(x?au(x)+": "+l:l),markers:p}},isAnimationEnabled:function(){if(v.node)return!1;var t=this.getShallow("animation");return t&&this.getData().count()>this.getShallow("animationThreshold")&&(t=!1),t},restoreData:function(){this.dataTask.dirty()},getColorFromPalette:function(t,e,i){var n=this.ecModel,o=Eu.getColorFromPalette.call(this,t,e,i);return o=o||n.getColorFromPalette(t,e,i)},coordDimToDataDim:function(t){return this.getRawData().mapDimension(t,!0)},getProgressive:function(){return this.get("progressive")},getProgressiveThreshold:function(){return this.get("progressiveThreshold")},getAxisTooltipData:null,getTooltipPosition:null,pipeTask:null,preventIncremental:null,pipelineContext:null});function lc(t){var e=t.name;Uo(t)||(t.name=function(t){var i=t.getRawData(),e=i.mapDimension("seriesName",!0),n=[];return R(e,function(t){var e=i.getDimensionInfo(t);e.displayName&&n.push(e.displayName)}),n.join(" ")}(t)||e)}function uc(t){return t.model.getRawData().count()}function hc(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),cc}function cc(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function dc(e,i){R(e.CHANGABLE_METHODS,function(t){e.wrapMethod(t,T(fc,i))})}function fc(t){var e=pc(t);e&&e.setOutputEnd(this.count())}function pc(t){var e=(t.ecModel||{}).scheduler,i=e&&e.getPipeline(t.uid);if(i){var n=i.currentTask;if(n){var o=n.agentStubMap;o&&(n=o.get(t.uid))}return n}}b(sc,Xh),b(sc,Eu);var gc=function(){this.group=new Ci,this.uid=Nl("viewComponent")};gc.prototype={constructor:gc,init:function(t,e){},render:function(t,e,i,n){},dispose:function(){},filterForExposedEvent:null};var mc=gc.prototype;mc.updateView=mc.updateLayout=mc.updateVisual=function(t,e,i,n){},oa(gc),ua(gc,{registerWhenExtend:!0});function vc(){var s=jo();return function(t){var e=s(t),i=t.pipelineContext,n=e.large,o=e.progressiveRender,a=e.large=i&&i.large,r=e.progressiveRender=i&&i.progressiveRender;return!!(n^a||o^r)&&"reset"}}var yc=jo(),xc=vc();function _c(){this.group=new Ci,this.uid=Nl("viewChart"),this.renderTask=Yh({plan:Mc,reset:Ic}),this.renderTask.context={view:this}}var wc=_c.prototype={type:"chart",init:function(t,e){},render:function(t,e,i,n){},highlight:function(t,e,i,n){Sc(t.getData(),n,"emphasis")},downplay:function(t,e,i,n){Sc(t.getData(),n,"normal")},remove:function(t,e){this.group.removeAll()},dispose:function(){},incrementalPrepareRender:null,incrementalRender:null,updateTransform:null,filterForExposedEvent:null};function bc(t,e,i){if(t&&(t.trigger(e,i),t.isGroup&&!Qs(t)))for(var n=0,o=t.childCount();nc?i+=p(g("data.partialData"),{displayCnt:c}):i+=g("data.allData");for(var r=[],s=0;si.blockIndex?i.step:null,a=n&&n.modDataCount;return{step:o,modBy:null!=a?Math.ceil(a/o):null,modDataCount:a}}},Bc.getPipeline=function(t){return this._pipelineMap.get(t)},Bc.updateStreamModes=function(t,e){var i=this._pipelineMap.get(t.uid),n=t.getData().count(),o=i.progressiveEnabled&&e.incrementalPrepareRender&&n>=i.threshold,a=t.get("large")&&n>=t.get("largeThreshold"),r="mod"===t.get("progressiveChunkMode")?n:null;t.pipelineContext=i.context={progressiveRender:o,modDataCount:r,large:a}},Bc.restorePipelines=function(t){var n=this,o=n._pipelineMap=Q();t.eachSeries(function(t){var e=t.getProgressive(),i=t.uid;o.set(i,{id:i,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:e&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(e||700),count:0}),Kc(n,t,t.dataTask)})},Bc.prepareStageTasks=function(){var i=this._stageTaskMap,n=this.ecInstance.getModel(),o=this.api;R(this._allHandlers,function(t){var e=i.get(t.uid)||i.set(t.uid,[]);t.reset&&function(n,o,t,a,r){var s=t.seriesTaskMap||(t.seriesTaskMap=Q()),e=o.seriesType,i=o.getTargetSeries;o.createOnAllSeries?a.eachRawSeries(l):e?a.eachRawSeriesByType(e,l):i&&i(a,r).each(l);function l(t){var e=t.uid,i=s.get(e)||s.set(e,Yh({plan:Uc,reset:Xc,count:qc}));i.context={model:t,ecModel:a,api:r,useClearVisual:o.isVisual&&!o.isLayout,plan:o.plan,reset:o.reset,scheduler:n},Kc(n,t,i)}var u=n._pipelineMap;s.each(function(t,e){u.get(e)||(t.dispose(),s.removeKey(e))})}(this,t,e,n,o),t.overallReset&&function(n,t,e,i,o){var a=e.overallTask=e.overallTask||Yh({reset:Fc});a.context={ecModel:i,api:o,overallReset:t.overallReset,scheduler:n};var r=a.agentStubMap=a.agentStubMap||Q(),s=t.seriesType,l=t.getTargetSeries,u=!0,h=t.modifyOutputEnd;s?i.eachRawSeriesByType(s,c):l?l(i,o).each(c):(u=!1,R(i.getSeries(),c));function c(t){var e=t.uid,i=r.get(e);i||(i=r.set(e,Yh({reset:Wc,onDirty:Zc})),a.dirty()),i.context={model:t,overallProgress:u,modifyOutputEnd:h},i.agent=a,i.__block=u,Kc(n,t,i)}var d=n._pipelineMap;r.each(function(t,e){d.get(e)||(t.dispose(),a.dirty(),r.removeKey(e))})}(this,t,e,n,o)},this)},Bc.prepareView=function(t,e,i,n){var o=t.renderTask,a=o.context;a.model=e,a.ecModel=i,a.api=n,o.__block=!t.incrementalPrepareRender,Kc(this,e,o)},Bc.performDataProcessorTasks=function(t,e){Vc(this,this._dataProcessorHandlers,t,e,{block:!0})},Bc.performVisualTasks=function(t,e,i){Vc(this,this._visualHandlers,t,e,i)},Bc.performSeriesTasks=function(t){var e;t.eachSeries(function(t){e|=t.dataTask.perform()}),this.unfinished|=e},Bc.plan=function(){this._pipelineMap.each(function(t){var e=t.tail;do{if(e.__block){t.blockIndex=e.__idxInPipeline;break}e=e.getUpstream()}while(e)})};var Gc=Bc.updatePayload=function(t,e){"remain"!==e&&(t.context.payload=e)};function Fc(t){t.overallReset(t.ecModel,t.api,t.payload)}function Wc(t,e){return t.overallProgress&&Hc}function Hc(){this.agent.dirty(),this.getDownstream().dirty()}function Zc(){this.agent&&this.agent.dirty()}function Uc(t){return t.plan&&t.plan(t.model,t.ecModel,t.api,t.payload)}function Xc(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=Vo(t.reset(t.model,t.ecModel,t.api,t.payload));return 1'+t.dom+""}),p.painter.getSvgRoot().innerHTML=g,o.connectedBackgroundColor&&p.painter.setBackgroundColor(o.connectedBackgroundColor),p.refreshImmediately(),p.painter.toDataURL()}return o.connectedBackgroundColor&&p.add(new rs({shape:{x:0,y:0,width:t,height:e},style:{fill:o.connectedBackgroundColor}})),Td(f,function(t){var e=new Qn({style:{x:t.left*i-u,y:t.top*i-h,image:t.dom}});p.add(e)}),p.refreshImmediately(),n.toDataURL("image/"+(o&&o.type||"png"))}return this.getDataURL(o)}},zd.convertToPixel=T(Bd,"convertToPixel"),zd.convertFromPixel=T(Bd,"convertFromPixel"),zd.containPixel=function(t,o){var a;if(!this._disposed)return R(t=Ko(this._model,t),function(t,n){0<=n.indexOf("Models")&&R(t,function(t){var e=t.coordinateSystem;if(e&&e.containPoint)a|=!!e.containPoint(o);else if("seriesModels"===n){var i=this._chartsMap[t.__viewId];i&&i.containPoint&&(a|=i.containPoint(o,t))}},this)},this),!!a},zd.getVisual=function(t,e){var i=(t=Ko(this._model,t,{defaultMainType:"series"})).seriesModel.getData(),n=t.hasOwnProperty("dataIndexInside")?t.dataIndexInside:t.hasOwnProperty("dataIndex")?i.indexOfRawIndex(t.dataIndex):null;return null!=n?i.getItemVisual(n,e):i.getVisual(e)},zd.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},zd.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]};var Vd={prepareAndUpdate:function(t){Gd(this),Vd.update.call(this,t)},update:function(t){var e=this._model,i=this._api,n=this._zr,o=this._coordSysMgr,a=this._scheduler;if(e){a.restoreData(e,t),a.performSeriesTasks(e),o.create(e,i),a.performDataProcessorTasks(e,t),Wd(this,e),o.update(e,i),Yd(e),a.performVisualTasks(e,t),jd(this,e,i,t);var r=e.get("backgroundColor")||"transparent";if(v.canvasSupported)n.setBackgroundColor(r);else{var s=Fe(r);r=$e(s,"rgb"),0===s[3]&&(r="transparent")}Kd(e,i)}},updateTransform:function(o){var a=this._model,r=this,s=this._api;if(a){var l=[];a.eachComponent(function(t,e){var i=r.getViewOfComponentModel(e);if(i&&i.__alive)if(i.updateTransform){var n=i.updateTransform(e,a,s,o);n&&n.update&&l.push(i)}else l.push(i)});var n=Q();a.eachSeries(function(t){var e=r._chartsMap[t.__viewId];if(e.updateTransform){var i=e.updateTransform(t,a,s,o);i&&i.update&&n.set(t.uid,1)}else n.set(t.uid,1)}),Yd(a),this._scheduler.performVisualTasks(a,o,{setDirty:!0,dirtyMap:n}),qd(r,a,s,o,n),Kd(a,this._api)}},updateView:function(t){var e=this._model;e&&(_c.markUpdateMethod(t,"updateView"),Yd(e),this._scheduler.performVisualTasks(e,t,{setDirty:!0}),jd(this,this._model,this._api,t),Kd(e,this._api))},updateVisual:function(t){Vd.update.call(this,t)},updateLayout:function(t){Vd.update.call(this,t)}};function Gd(t){var e=t._model,i=t._scheduler;i.restorePipelines(e),i.prepareStageTasks(),Xd(t,"component",e,i),Xd(t,"chart",e,i),i.plan()}function Fd(e,i,n,o,t){var a=e._model;if(o){var r={};r[o+"Id"]=n[o+"Id"],r[o+"Index"]=n[o+"Index"],r[o+"Name"]=n[o+"Name"];var s={mainType:o,query:r};t&&(s.subType=t);var l=n.excludeSeriesId;null!=l&&(l=Q(Vo(l))),a&&a.eachComponent(s,function(t){l&&null!=l.get(t.id)||u(e["series"===o?"_chartsMap":"_componentsMap"][t.__viewId])},e)}else Td(e._componentsViews.concat(e._chartsViews),u);function u(t){t&&t.__alive&&t[i]&&t[i](t.__model,a,e._api,n)}}function Wd(t,e){var i=t._chartsMap,n=t._scheduler;e.eachSeries(function(t){n.updateStreamModes(t,i[t.__viewId])})}function Hd(e,t){var i=e.type,n=e.escapeConnect,o=tf[i],a=o.actionInfo,r=(a.update||"update").split(":"),s=r.pop();r=null!=r[0]&&Cd(r[0]),this[kd]=!0;var l=[e],u=!1;e.batch&&(u=!0,l=O(e.batch,function(t){return(t=D(P({},t),e)).batch=null,t}));var h,c=[],d="highlight"===i||"downplay"===i;Td(l,function(t){(h=(h=o.action(t,this._model,this._api))||P({},t)).type=a.event||h.type,c.push(h),d?Fd(this,s,t,"series"):r&&Fd(this,s,t,r.main,r.sub)},this),"none"===s||d||r||(this[Pd]?(Gd(this),Vd.update.call(this,e),this[Pd]=!1):Vd[s].call(this,e)),h=u?{type:a.event||i,escapeConnect:n,batch:c}:c[0],this[kd]=!1,t||this._messageCenter.trigger(h.type,h)}function Zd(t){for(var e=this._pendingActions;e.length;){var i=e.shift();Hd.call(this,i,t)}}function Ud(t){t||this.trigger("updated")}function Xd(t,e,o,a){for(var r="component"===e,s=r?t._componentsViews:t._chartsViews,l=r?t._componentsMap:t._chartsMap,u=t._zr,h=t._api,i=0;it.get("hoverLayerThreshold")&&!v.node&&t.eachSeries(function(t){if(!t.preventUsingHoverLayer){var e=i._chartsMap[t.__viewId];e.__alive&&e.group.traverse(function(t){t.useHoverLayer=!0})}})}(n,t),Rc(n._zr.dom,t)}function Kd(e,i){Td(af,function(t){t(e,i)})}zd.resize=function(t){if(!this._disposed){this._zr.resize(t);var e=this._model;if(this._loadingFX&&this._loadingFX.resize(),e){var i=e.resetOption("media"),n=t&&t.silent;this[kd]=!0,i&&Gd(this),Vd.update.call(this),this[kd]=!1,Zd.call(this,n),Ud.call(this,n)}}},zd.showLoading=function(t,e){if(!this._disposed&&(Dd(t)&&(e=t,t=""),t=t||"default",this.hideLoading(),lf[t])){var i=lf[t](this._api,e),n=this._zr;this._loadingFX=i,n.add(i)}},zd.hideLoading=function(){this._disposed||(this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null)},zd.makeActionFromEvent=function(t){var e=P({},t);return e.type=ef[t.type],e},zd.dispatchAction=function(t,e){this._disposed||(Dd(e)||(e={silent:!!e}),tf[t.type]&&this._model&&(this[kd]?this._pendingActions.push(t):(Hd.call(this,t,e.silent),e.flush?this._zr.flush(!0):!1!==e.flush&&v.browser.weChat&&this._throttledZrFlush(),Zd.call(this,e.silent),Ud.call(this,e.silent))))},zd.appendData=function(t){if(!this._disposed){var e=t.seriesIndex;this.getModel().getSeriesByIndex(e).appendData(t),this._scheduler.unfinished=!0}},zd.on=Od("on",!1),zd.off=Od("off",!1),zd.one=Od("one",!1);var $d=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function Jd(t,e){var i=t.get("z"),n=t.get("zlevel");e.group.traverse(function(t){"group"!==t.type&&(null!=i&&(t.z=i),null!=n&&(t.zlevel=n))})}function Qd(){this.eventInfo}zd._initEvents=function(){Td($d,function(u){function t(t){var e,i=this.getModel(),n=t.target;if("globalout"===u)e={};else if(n&&null!=n.dataIndex){var o=n.dataModel||i.getSeriesByIndex(n.seriesIndex);e=o&&o.getDataParams(n.dataIndex,n.dataType,n)||{}}else n&&n.eventData&&(e=P({},n.eventData));if(e){var a=e.componentType,r=e.componentIndex;"markLine"!==a&&"markPoint"!==a&&"markArea"!==a||(a="series",r=e.seriesIndex);var s=a&&null!=r&&i.getComponent(a,r),l=s&&this["series"===s.mainType?"_chartsMap":"_componentsMap"][s.__viewId];e.event=t,e.type=u,this._ecEventProcessor.eventInfo={targetEl:n,packedEvent:e,model:s,view:l},this.trigger(u,e)}}t.zrEventfulCallAtLast=!0,this._zr.on(u,t,this)},this),Td(ef,function(t,e){this._messageCenter.on(e,function(t){this.trigger(e,t)},this)},this)},zd.isDisposed=function(){return this._disposed},zd.clear=function(){this._disposed||this.setOption({series:[]},!0)},zd.dispose=function(){if(!this._disposed){this._disposed=!0,Jo(this.getDom(),ff,"");var e=this._api,i=this._model;Td(this._componentsViews,function(t){t.dispose(i,e)}),Td(this._chartsViews,function(t){t.dispose(i,e)}),this._zr.dispose(),delete uf[this.id]}},b(Ed,Ct),Qd.prototype={constructor:Qd,normalizeQuery:function(t){var s={},l={},u={};if(E(t)){var e=Cd(t);s.mainType=e.main||null,s.subType=e.sub||null}else{var h=["Index","Name","Id"],c={name:1,dataIndex:1,dataType:1};R(t,function(t,e){for(var i=!1,n=0;nx[1]&&(x[1]=y)}e&&(this._nameList[d]=e[f])}this._rawCount=this._count=l,this._extent={},Kf(this)},jf._initDataFromProvider=function(t,e){if(!(e<=t)){for(var i,n=this._chunkSize,o=this._rawData,a=this._storage,r=this.dimensions,s=r.length,l=this._dimensionInfos,u=this._nameList,h=this._idList,c=this._rawExtent,d=this._nameRepeatCount={},f=this._chunkCount,p=0;pM[1]&&(M[1]=S)}if(!o.pure){var I=u[v];if(m&&null==I)if(null!=m.name)u[v]=I=m.name;else if(null!=i){var T=r[i],A=a[T][y];if(A){I=A[x];var D=l[T].ordinalMeta;D&&D.categories.length&&(I=D.categories[I])}}var C=null==m?null:m.id;null==C&&null!=I&&(d[I]=d[I]||0,0=this._rawCount||t<0)return-1;if(!this._indices)return t;var e=this._indices,i=e[t];if(null!=i&&it))return a;o=a-1}}return-1},jf.indicesOfNearest=function(t,e,i){var n=[];if(!this._storage[t])return n;null==i&&(i=1/0);for(var o=1/0,a=-1,r=0,s=0,l=this.count();st[I][1])&&(M=!1)}M&&(a[r++]=this.getRawIndex(m))}return rw[1]&&(w[1]=_)}}}return o},jf.downSample=function(t,e,i,n){for(var o=ip(this,[t]),a=o._storage,r=[],s=Math.floor(1/e),l=a[t],u=this.count(),h=this._chunkSize,c=o._rawExtent[t],d=new(Hf(this))(u),f=0,p=0;pc[1]&&(c[1]=x),d[f++]=_}return o._count=f,o._indices=d,o.getRawIndex=Qf,o},jf.getItemModel=function(t){var e=this.hostModel;return new Cl(this.getRawDataItem(t),e,e&&e.ecModel)},jf.diff=function(e){var i=this;return new kf(e?e.getIndices():[],this.getIndices(),function(t){return tp(e,t)},function(t){return tp(i,t)})},jf.getVisual=function(t){var e=this._visual;return e&&e[t]},jf.setVisual=function(t,e){if(zf(t))for(var i in t)t.hasOwnProperty(i)&&this.setVisual(i,t[i]);else this._visual=this._visual||{},this._visual[t]=e},jf.setLayout=function(t,e){if(zf(t))for(var i in t)t.hasOwnProperty(i)&&this.setLayout(i,t[i]);else this._layout[t]=e},jf.getLayout=function(t){return this._layout[t]},jf.getItemLayout=function(t){return this._itemLayouts[t]},jf.setItemLayout=function(t,e,i){this._itemLayouts[t]=i?P(this._itemLayouts[t]||{},e):e},jf.clearItemLayouts=function(){this._itemLayouts.length=0},jf.getItemVisual=function(t,e,i){var n=this._itemVisuals[t],o=n&&n[e];return null!=o||i?o:this.getVisual(e)},jf.setItemVisual=function(t,e,i){var n=this._itemVisuals[t]||{},o=this.hasItemVisual;if(this._itemVisuals[t]=n,zf(e))for(var a in e)e.hasOwnProperty(a)&&(n[a]=e[a],o[a]=!0);else n[e]=i,o[e]=!0},jf.clearAllVisual=function(){this._visual={},this._itemVisuals=[],this.hasItemVisual={}};function ap(t){t.seriesIndex=this.seriesIndex,t.dataIndex=this.dataIndex,t.dataType=this.dataType}function rp(t,e,i){Uu.isInstance(e)||(e=Uu.seriesDataToSource(e)),i=i||{},t=(t||[]).slice();for(var n=(i.dimsDef||[]).slice(),o=Q(),a=Q(),l=[],r=function(t,e,i,n){var o=Math.max(t.dimensionsDetectCount||1,e.length,i.length,n||0);return R(e,function(t){var e=t.dimsDef;e&&(o=Math.max(o,e.length))}),o}(e,t,n,i.dimCount),s=0;s=e[0]&&t<=e[1]},mp.prototype.normalize=function(t){var e=this._extent;return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])},mp.prototype.scale=function(t){var e=this._extent;return t*(e[1]-e[0])+e[0]},mp.prototype.unionExtent=function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1])},mp.prototype.unionExtentFromData=function(t,e){this.unionExtent(t.getApproximateExtent(e))},mp.prototype.getExtent=function(){return this._extent.slice()},mp.prototype.setExtent=function(t,e){var i=this._extent;isNaN(t)||(i[0]=t),isNaN(e)||(i[1]=e)},mp.prototype.isBlank=function(){return this._isBlank},mp.prototype.setBlank=function(t){this._isBlank=t},mp.prototype.getLabel=null,oa(mp),ua(mp,{registerWhenExtend:!0}),vp.createByAxisModel=function(t){var e=t.option,i=e.data,n=i&&O(i,_p);return new vp({categories:n,needCollect:!n,deduplication:!1!==e.dedplication})};var yp=vp.prototype;function xp(t){return t._map||(t._map=Q(t.categories))}function _p(t){return z(t)&&null!=t.value?t.value:t+""}yp.getOrdinal=function(t){return xp(this).get(t)},yp.parseAndCollect=function(t){var e,i=this._needCollect;if("string"!=typeof t&&!i)return t;if(i&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var n=xp(this);return null==(e=n.get(t))&&(i?(e=this.categories.length,this.categories[e]=t,n.set(t,e)):e=NaN),e};var wp=mp.prototype,bp=mp.extend({type:"ordinal",init:function(t,e){t&&!L(t)||(t=new vp({categories:t})),this._ordinalMeta=t,this._extent=e||[0,t.categories.length-1]},parse:function(t){return"string"==typeof t?this._ordinalMeta.getOrdinal(t):Math.round(t)},contain:function(t){return t=this.parse(t),wp.contain.call(this,t)&&null!=this._ordinalMeta.categories[t]},normalize:function(t){return wp.normalize.call(this,this.parse(t))},scale:function(t){return Math.round(wp.scale.call(this,t))},getTicks:function(){for(var t=[],e=this._extent,i=e[0];i<=e[1];)t.push(i),i++;return t},getLabel:function(t){if(!this.isBlank())return this._ordinalMeta.categories[t]},count:function(){return this._extent[1]-this._extent[0]+1},unionExtentFromData:function(t,e){this.unionExtent(t.getApproximateExtent(e))},getOrdinalMeta:function(){return this._ordinalMeta},niceTicks:et,niceExtent:et});bp.create=function(){return new bp};var Sp=zl;function Mp(t){return Gl(t)+2}function Ip(t,e,i){t[e]=Math.max(Math.min(t[e],i[1]),i[0])}function Tp(t,e){isFinite(t[0])||(t[0]=e[0]),isFinite(t[1])||(t[1]=e[1]),Ip(t,0,e),Ip(t,1,e),t[0]>t[1]&&(t[0]=t[1])}var Ap=zl,Dp=mp.extend({type:"interval",_interval:0,_intervalPrecision:2,setExtent:function(t,e){var i=this._extent;isNaN(t)||(i[0]=parseFloat(t)),isNaN(e)||(i[1]=parseFloat(e))},unionExtent:function(t){var e=this._extent;t[0]e[1]&&(e[1]=t[1]),Dp.prototype.setExtent.call(this,e[0],e[1])},getInterval:function(){return this._interval},setInterval:function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=Mp(t)},getTicks:function(t){var e=this._interval,i=this._extent,n=this._niceExtent,o=this._intervalPrecision,a=[];if(!e)return a;i[0]s&&(t?a.push(Ap(s+e,o)):a.push(i[1])),a},getMinorTicks:function(t){for(var e=this.getTicks(!0),i=[],n=this.getExtent(),o=1;on[0]&&h>>1;t[o][1]>1^-(1&s),l=l>>1^-(1&l),o=s+=o,a=l+=a,n.push([s/i,l/i])}return n}Ag.prototype={constructor:Ag,properties:null,getBoundingRect:function(){var t=this._rect;if(t)return t;for(var e=Number.MAX_VALUE,i=[e,e],n=[-e,-e],o=[],a=[],r=this.geometries,s=0;ss[1];d(e[0].coord,s[0])&&(n?e[0].coord=s[0]:e.shift());n&&d(s[0],e[0].coord)&&e.unshift({coord:s[0]});d(s[1],a.coord)&&(n?a.coord=s[1]:e.pop());n&&d(a.coord,s[1])&&e.push({coord:s[1]});function d(t,e){return t=zl(t),e=zl(e),c?en[0]&&(n[0]=a[0]),a[1]>n[1]&&(n[1]=a[1])}return{min:e?i:n,max:e?n:i}}var xm=Ar.extend({type:"ec-polyline",shape:{points:[],smooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},style:{fill:null,stroke:"#000"},brush:Xr(Ar.prototype.brush),buildPath:function(t,e){var i=e.points,n=0,o=i.length,a=ym(i,e.smoothConstraint);if(e.connectNulls){for(;0n)return!1;return!0}(a,e))){var r=e.mapDimension(a.dim),s={};return R(a.getViewLabels(),function(t){s[t.tickValue]=1}),function(t){return!s.hasOwnProperty(e.get(r,t))}}}}function Cm(t,e,i){if("cartesian2d"!==t.type)return bm(t,e,i);var n=t.getBaseAxis().isHorizontal(),o=wm(t,e,i);if(!i.get("clip",!0)){var a=o.shape,r=Math.max(a.width,a.height);n?(a.y-=r,a.height+=2*r):(a.x-=r,a.width+=2*r)}return o}_c.extend({type:"line",init:function(){var t=new Ci,e=new im;this.group.add(e.group),this._symbolDraw=e,this._lineGroup=t},render:function(t,e,i){var n=t.coordinateSystem,o=this.group,a=t.getData(),r=t.getModel("lineStyle"),s=t.getModel("areaStyle"),l=a.mapArray(a.getItemLayout),u="polar"===n.type,h=this._coordSys,c=this._symbolDraw,d=this._polyline,f=this._polygon,p=this._lineGroup,g=t.get("animation"),m=!s.isEmpty(),v=s.get("origin"),y=function(t,e,i){if(!i.valueDim)return[];for(var n=[],o=0,a=e.count();oh[c-1].coord&&(h.reverse(),d.reverse());var f=h[0].coord-10,p=h[c-1].coord+10,g=p-f;if(g<.001)return"transparent";R(h,function(t){t.offset=(t.coord-f)/g}),h.push({offset:c?h[c-1].offset:.5,color:d[1]||"transparent"}),h.unshift({offset:c?h[0].offset:.5,color:d[0]||"transparent"});var m=new gs(0,0,0,0,h,!0);return m[n]=f,m[n+"2"]=p,m}}}(a,n)||a.getVisual("color");d.useStyle(D(r.getLineStyle(),{fill:"none",stroke:M,lineJoin:"bevel"}));var I=t.get("smooth");if(I=Tm(t.get("smooth")),d.setShape({smooth:I,smoothMonotone:t.get("smoothMonotone"),connectNulls:t.get("connectNulls")}),f){var T=a.getCalculationInfo("stackedOnSeries"),A=0;f.useStyle(D(s.getAreaStyle(),{fill:M,opacity:.7,lineJoin:"bevel"})),T&&(A=Tm(T.get("smooth"))),f.setShape({smooth:I,stackedOnSmooth:A,smoothMonotone:t.get("smoothMonotone"),connectNulls:t.get("connectNulls")})}this._data=a,this._coordSys=n,this._stackedOnPoints=y,this._points=l,this._step=S,this._valueOrigin=v},dispose:function(){},highlight:function(t,e,i,n){var o=t.getData(),a=Yo(o,n);if(!(a instanceof Array)&&null!=a&&0<=a){var r=o.getItemGraphicEl(a);if(!r){var s=o.getItemLayout(a);if(!s)return;if(this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(s[0],s[1]))return;(r=new Xg(o,a)).position=s,r.setZ(t.get("zlevel"),t.get("z")),r.ignore=isNaN(s[0])||isNaN(s[1]),r.__temp=!0,o.setItemGraphicEl(a,r),r.stopSymbolAnimation(!0),this.group.add(r)}r.highlight()}else _c.prototype.highlight.call(this,t,e,i,n)},downplay:function(t,e,i,n){var o=t.getData(),a=Yo(o,n);if(null!=a&&0<=a){var r=o.getItemGraphicEl(a);r&&(r.__temp?(o.setItemGraphicEl(a,null),this.group.remove(r)):r.downplay())}else _c.prototype.downplay.call(this,t,e,i,n)},_newPolyline:function(t){var e=this._polyline;return e&&this._lineGroup.remove(e),e=new xm({shape:{points:t},silent:!0,z2:10}),this._lineGroup.add(e),this._polyline=e},_newPolygon:function(t,e){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new _m({shape:{points:t,stackedOnPoints:e},silent:!0}),this._lineGroup.add(i),this._polygon=i},_updateAnimation:function(t,e,i,n,o,a){var r=this._polyline,s=this._polygon,l=t.hostModel,u=function(t,e,i,n,o,a,r,s){for(var l=function(t,e){var i=[];return e.diff(t).add(function(t){i.push({cmd:"+",idx:t})}).update(function(t,e){i.push({cmd:"=",idx:e,idx1:t})}).remove(function(t){i.push({cmd:"-",idx:t})}).execute(),i}(t,e),u=[],h=[],c=[],d=[],f=[],p=[],g=[],m=sm(o,e,r),v=sm(a,t,s),y=0;ye&&(e=t[i]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,i=0;ie[1]&&e.reverse(),e},getOtherAxis:function(){this.grid.getOtherAxis()},pointToData:function(t,e){return this.coordToData(this.toLocalCoord(t["x"===this.dim?0:1]),e)},toLocalCoord:null,toGlobalCoord:null},w(zm,Gg);var Bm={show:!0,zlevel:0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#333",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},Vm={};Vm.categoryAxis=m({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},Bm),Vm.valueAxis=m({boundaryGap:[0,0],splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#eee",width:1}}},Bm),Vm.timeAxis=D({scale:!0,min:"dataMin",max:"dataMax"},Vm.valueAxis),Vm.logAxis=D({scale:!0,logBase:10},Vm.valueAxis);function Gm(a,t,r,e){R(Fm,function(o){t.extend({type:a+"Axis."+o,mergeDefaultAndTheme:function(t,e){var i=this.layoutMode,n=i?Iu(t):{};m(t,e.getTheme().get(o+"Axis")),m(t,this.getDefaultOption()),t.type=r(a,t),i&&Mu(t,n,i)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=vp.createByAxisModel(this))},getCategories:function(t){var e=this.option;if("category"===e.type)return t?e.data:this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:p([{},Vm[o+"Axis"],e],!0)})}),ku.registerSubTypeDefaulter(a+"Axis",T(r,a))}var Fm=["value","category","time","log"],Wm=ku.extend({type:"cartesian2dAxis",axis:null,init:function(){Wm.superApply(this,"init",arguments),this.resetRange()},mergeOption:function(){Wm.superApply(this,"mergeOption",arguments),this.resetRange()},restoreData:function(){Wm.superApply(this,"restoreData",arguments),this.resetRange()},getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid",index:this.option.gridIndex,id:this.option.gridId})[0]}});function Hm(t,e){return e.type||(e.data?"category":"value")}m(Wm.prototype,dg);var Zm={offset:0};function Um(t,e){return t.getCoordSysModel()===e}function Xm(t,e,i){this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this._initCartesian(t,e,i),this.model=t}Gm("x",Wm,Hm,Zm),Gm("y",Wm,Hm,Zm),ku.extend({type:"grid",dependencies:["xAxis","yAxis"],layoutMode:"box",coordinateSystem:null,defaultOption:{show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:60,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"}});var Ym=Xm.prototype;function jm(t,e,i,n){i.getAxesOnZeroOf=function(){return o?[o]:[]};var o,a=t[e],r=i.model,s=r.get("axisLine.onZero"),l=r.get("axisLine.onZeroAxisIndex");if(s){if(null!=l)qm(a[l])&&(o=a[l]);else for(var u in a)if(a.hasOwnProperty(u)&&qm(a[u])&&!n[h(a[u])]){o=a[u];break}o&&(n[h(o)]=!0)}function h(t){return t.dim+"_"+t.index}}function qm(t){return t&&"category"!==t.type&&"time"!==t.type&&function(t){var e=t.scale.getExtent(),i=e[0],n=e[1];return!(0u[1]?-1:1,c=["start"===a?u[0]-h*l:"end"===a?u[1]+h*l:(u[0]+u[1])/2,sv(a)?t.labelOffset+r*l:0],d=e.get("nameRotate");null!=d&&(d=d*tv/180),sv(a)?n=nv(t.rotation,null!=d?d:t.rotation,r):(n=function(t,e,i,n){var o,a,r=Zl(i-t.rotation),s=n[0]>n[1],l="start"===e&&!s||"start"!==e&&s;o=Ul(r-tv/2)?(a=l?"bottom":"top","center"):Ul(r-1.5*tv)?(a=l?"top":"bottom","center"):(a="middle",r<1.5*tv&&tv/2l[1]&&l.reverse(),(null==r||r>l[1])&&(r=l[1]),r=i.r0}}});var ny=Math.PI/180;function oy(o,t,e,i,n,a,r,s,l,u){function h(t,e,i){for(var n=t;nl+r);n++)if(o[n].y+=i,to[n].y+o[n].height)return void c(n,i/2);c(e-1,i/2)}function c(t,e){for(var i=t;0<=i&&!(o[i].y-eo[i-1].y+o[i-1].height));i--);}function d(t,e,i,n,o,a){for(var r=e?Number.MAX_VALUE:0,s=0,l=t.length;s=e?v.push(o[y]):m.push(o[y]);d(m,!1,t,e,i,n),d(v,!0,t,e,i,n)}function ay(t){return"center"===t.position}function ry(L,k,P,t,N,e){var O,R,E=L.getData(),z=[],B=!1,V=(L.get("minShowLabelAngle")||0)*ny;E.each(function(t){var e=E.getItemLayout(t),i=E.getItemModel(t),n=i.getModel("label"),o=n.get("position")||i.get("emphasis.label.position"),a=n.get("distanceToLabelLine"),r=n.get("alignTo"),s=El(n.get("margin"),P),l=n.get("bleedMargin"),u=n.getFont(),h=i.getModel("labelLine"),c=h.get("length");c=El(c,P);var d=h.get("length2");if(d=El(d,P),!(e.anglei[0]&&isFinite(h)&&isFinite(i[0]););else{var l=o.getTicks().length-1;c":"\n";return au(""===r?this.name:r)+s+O(a,function(t,e){var i=o.get(o.mapDimension(t.dim),n);return au(t.name+" : "+i)}).join(s)},getTooltipPosition:function(t){if(null!=t)for(var e=this.getData(),i=this.coordinateSystem,n=e.getValues(O(i.dimensions,function(t){return e.mapDimension(t)}),t,!0),o=0,a=n.length;o":"\n";return l.join(", ")+d+au(r+" : "+a)},getTooltipPosition:function(t){if(null!=t){var e=this.getData().getName(t),i=this.coordinateSystem,n=i.getRegion(e);return n&&i.dataToPoint(n.center)}},setZoom:function(t){this.option.zoom=t},setCenter:function(t){this.option.center=t},defaultOption:{zlevel:0,z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:.75,showLegendSymbol:!0,dataRangeHoverLink:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},nameProperty:"name"}}),jv);var Ey="\0_ec_interaction_mutex";function zy(t,e){return!!By(t)[e]}function By(t){return t[Ey]||(t[Ey]={})}function Vy(i){this.pointerChecker,this._zr=i,this._opt={};var t=A,n=t(Gy,this),o=t(Fy,this),a=t(Wy,this),r=t(Hy,this),s=t(Zy,this);Ct.call(this),this.setPointerChecker=function(t){this.pointerChecker=t},this.enable=function(t,e){this.disable(),this._opt=D(k(e)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),null==t&&(t=!0),!0!==t&&"move"!==t&&"pan"!==t||(i.on("mousedown",n),i.on("mousemove",o),i.on("mouseup",a)),!0!==t&&"scale"!==t&&"zoom"!==t||(i.on("mousewheel",r),i.on("pinch",s))},this.disable=function(){i.off("mousedown",n),i.off("mousemove",o),i.off("mouseup",a),i.off("mousewheel",r),i.off("pinch",s)},this.dispose=this.disable,this.isDragging=function(){return this._dragging},this.isPinching=function(){return this._pinching}}function Gy(t){if(!(Yt(t)||t.target&&t.target.draggable)){var e=t.offsetX,i=t.offsetY;this.pointerChecker&&this.pointerChecker(t,e,i)&&(this._x=e,this._y=i,this._dragging=!0)}}function Fy(t){if(this._dragging&&Yy("moveOnMouseMove",t,this._opt)&&"pinch"!==t.gestureEvent&&!zy(this._zr,"globalPan")){var e=t.offsetX,i=t.offsetY,n=this._x,o=this._y,a=e-n,r=i-o;this._x=e,this._y=i,this._opt.preventDefaultMouseMove&&Xt(t.event),Xy(this,"pan","moveOnMouseMove",t,{dx:a,dy:r,oldX:n,oldY:o,newX:e,newY:i})}}function Wy(t){Yt(t)||(this._dragging=!1)}function Hy(t){var e=Yy("zoomOnMouseWheel",t,this._opt),i=Yy("moveOnMouseWheel",t,this._opt),n=t.wheelDelta,o=Math.abs(n),a=t.offsetX,r=t.offsetY;if(0!==n&&(e||i)){if(e){var s=3e&&(e=n.height)}this.height=e+1},getNodeById:function(t){if(this.getId()===t)return this;for(var e=0,i=this.children,n=i.length;ei&&(i=t.depth)});var a=t.expandAndCollapse&&0<=t.initialTreeDepth?t.initialTreeDepth:i;return o.root.eachNode("preorder",function(t){var e=t.hostTree.data.getRawDataItem(t.dataIndex);t.isExpand=e&&null!=e.collapsed?!e.collapsed:t.depth<=a}),o.data},getOrient:function(){var t=this.get("orient");return"horizontal"===t?t="LR":"vertical"===t&&(t="TB"),t},setZoom:function(t){this.option.zoom=t},setCenter:function(t){this.option.center=t},formatTooltip:function(t){for(var e=this.getData().tree,i=e.root.children[0],n=e.getNodeByDataIndex(t),o=n.getValue(),a=n.name;n&&n!==i;)a=n.parentNode.name+"."+a,n=n.parentNode;return au(a+(isNaN(o)||null==o?"":" : "+o))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderColor:"#c23531",borderWidth:1.5},label:{show:!0,color:"#555"},leaves:{label:{show:!0}},animationEasing:"linear",animationDuration:700,animationDurationUpdate:1e3}});var zx=Cs({shape:{parentPoint:[],childPoints:[],orient:"",forkPosition:""},style:{stroke:"#000",fill:null},buildPath:function(t,e){var i=e.childPoints,n=i.length,o=e.parentPoint,a=i[0],r=i[n-1];if(1===n)return t.moveTo(o[0],o[1]),void t.lineTo(a[0],a[1]);var s=e.orient,l="TB"===s||"BT"===s?0:1,u=1-l,h=El(e.forkPosition,1),c=[];c[l]=o[l],c[u]=o[u]+(r[u]-o[u])*h,t.moveTo(o[0],o[1]),t.lineTo(c[0],c[1]),t.moveTo(a[0],a[1]),c[l]=a[l],t.lineTo(c[0],c[1]),c[l]=r[l],t.lineTo(c[0],c[1]),t.lineTo(r[0],r[1]);for(var d=1;dx.x)||(m-=Math.PI);var b=v?"left":"right",S=a.labelModel.get("rotate"),M=S*(Math.PI/180);g.setStyle({textPosition:a.labelModel.get("position")||b,textRotation:null==S?-m:M,textOrigin:"center",verticalAlign:"middle"})}!function(t,e,i,n,o,a,r,s,l){var u=l.edgeShape,h=n.__edge;if("curve"===u)e.parentNode&&e.parentNode!==i&&cl(h=h||(n.__edge=new ds({shape:Wx(l,o,o),style:D({opacity:0,strokeNoScale:!0},l.lineStyle)})),{shape:Wx(l,a,r),style:D({opacity:1},l.lineStyle)},t);else if("polyline"===u&&"orthogonal"===l.layout&&e!==i&&e.children&&0!==e.children.length&&!0===e.isExpand){for(var c=e.children,d=[],f=0;fh.getLayout().x&&(h=t),t.depth>c.depth&&(c=t)});var d=u===h?1:r(u,h)/2,f=d-u.getLayout().x,p=0,g=0,m=0,v=0;if("radial"===n)p=o/(h.getLayout().x+d+f),g=a/(c.depth-1||1),Hx(l,function(t){m=(t.getLayout().x+f)*p,v=(t.depth-1)*g;var e=Px(m,v);t.setLayout({x:e.x,y:e.y,rawX:m,rawY:v},!0)});else{var y=t.getOrient();"RL"===y||"LR"===y?(g=a/(h.getLayout().x+d+f),p=o/(c.depth-1||1),Hx(l,function(t){v=(t.getLayout().x+f)*g,m="LR"===y?(t.depth-1)*p:o-(t.depth-1)*p,t.setLayout({x:m,y:v},!0)})):"TB"!==y&&"BT"!==y||(p=o/(h.getLayout().x+d+f),g=a/(c.depth-1||1),Hx(l,function(t){m=(t.getLayout().x+f)*p,v="TB"===y?(t.depth-1)*g:a-(t.depth-1)*g,t.setLayout({x:m,y:v},!0)}))}}}(t,e)})}),sc.extend({type:"series.treemap",layoutMode:"box",dependencies:["grid","polar"],preventUsingHoverLayer:!0,_viewRoot:null,defaultOption:{progressive:0,left:"center",top:"middle",right:null,bottom:null,width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.1024,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",borderColor:"rgba(255,255,255,0.7)",borderWidth:1,shadowColor:"rgba(150,150,150,1)",shadowBlur:3,shadowOffsetX:0,shadowOffsetY:0,textStyle:{color:"#fff"}},emphasis:{textStyle:{}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",ellipsis:!0},upperLabel:{show:!1,position:[0,"50%"],height:20,color:"#fff",ellipsis:!0,verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],color:"#fff",ellipsis:!0,verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},getInitialData:function(t,e){var i={name:t.name,children:t.data};!function i(t){var n=0;R(t.children,function(t){i(t);var e=t.value;L(e)&&(e=e[0]),n+=e});var e=t.value;L(e)&&(e=e[0]);null!=e&&!isNaN(e)||(e=n);e<0&&(e=0);L(t.value)?t.value[0]=e:t.value=e}(i);var n=t.levels||[],o=new Cl({itemStyle:this.designatedVisualItemStyle={}},this,e),a=O((n=t.levels=function(t,e){var n,i=e.get("color");if(!i)return;if(R(t=t||[],function(t){var e=new Cl(t),i=e.get("color");(e.get("itemStyle.color")||i&&"none"!==i)&&(n=!0)}),!n){(t[0]||(t[0]={})).color=i.slice()}return t}(n,e))||[],function(t){return new Cl(t,o,e)},this),r=Ax.createTree(i,this,function(t){t.wrapMethod("getItemModel",function(t,e){var i=r.getNodeByDataIndex(e),n=a[i.depth];return t.parentModel=n||o,t})});return r.data},optionUpdated:function(){this.resetViewRoot()},formatTooltip:function(t){var e=this.getData(),i=this.getRawValue(t),n=L(i)?tu(i[0]):tu(i);return au(e.getName(t)+": "+n)},getDataParams:function(t){var e=sc.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return e.treePathInfo=Yx(i,this),e},setLayoutInfo:function(t){this.layoutInfo=this.layoutInfo||{},P(this.layoutInfo,t)},mapIdToIndex:function(t){var e=this._idIndexMap;e||(e=this._idIndexMap=Q(),this._idIndexMapCount=0);var i=e.get(t);return null==i&&e.set(t,i=this._idIndexMapCount++),i},getViewRoot:function(){return this._viewRoot},resetViewRoot:function(t){t?this._viewRoot=t:t=this._viewRoot;var e=this.getRawData().tree.root;t&&(t===e||e.contains(t))||(this._viewRoot=e)}});var jx=5;function qx(t){this.group=new Ci,t.add(this.group)}function Kx(t,e,i,n,o,a){var r=[[o?t:t-jx,e],[t+i,e],[t+i,e+n],[o?t:t-jx,e+n]];return a||r.splice(2,0,[t+i+jx,e+n/2]),o||r.push([t,e+n/2]),r}qx.prototype={constructor:qx,render:function(t,e,i,n){var o=t.getModel("breadcrumb"),a=this.group;if(a.removeAll(),o.get("show")&&i){var r=o.getModel("itemStyle"),s=r.getModel("textStyle"),l={pos:{left:o.get("left"),right:o.get("right"),top:o.get("top"),bottom:o.get("bottom")},box:{width:e.getWidth(),height:e.getHeight()},emptyItemWidth:o.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(i,l,s),this._renderContent(t,l,r,s,n),Su(a,l.pos,l.box)}},_prepare:function(t,e,i){for(var n=t;n;n=n.parentNode){var o=n.getModel().get("name"),a=i.getTextRect(o),r=Math.max(a.width+16,e.emptyItemWidth);e.totalWidth+=r+8,e.renderList.push({node:n,text:o,width:r})}},_renderContent:function(t,e,i,n,o){for(var a,r,s=0,l=e.emptyItemWidth,u=t.get("breadcrumb.height"),h=function(t,e,i){var n=e.width,o=e.height,a=El(t.x,n),r=El(t.y,o),s=El(t.x2,n),l=El(t.y2,o);return(isNaN(a)||isNaN(parseFloat(t.x)))&&(a=0),(isNaN(s)||isNaN(parseFloat(t.x2)))&&(s=n),(isNaN(r)||isNaN(parseFloat(t.y)))&&(r=0),(isNaN(l)||isNaN(parseFloat(t.y2)))&&(l=o),i=iu(i||0),{width:Math.max(s-a-i[1]-i[3],0),height:Math.max(l-r-i[0]-i[2],0)}}(e.pos,e.box),c=e.totalWidth,d=e.renderList,f=d.length-1;0<=f;f--){var p=d[f],g=p.node,m=p.width,v=p.text;c>h.width&&(c-=m-l,m=l,v=null);var y=new Qr({shape:{points:Kx(s,0,m,u,f===d.length-1,0===f)},style:D(i.getItemStyle(),{lineJoin:"bevel",text:v,textFill:n.getTextColor(),textFont:n.getFont()}),z:10,onclick:T(o,g)});this.group.add(y),a=t,r=g,y.eventData={componentType:"series",componentSubType:"treemap",componentIndex:a.componentIndex,seriesIndex:a.componentIndex,seriesName:a.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:r&&r.dataIndex,name:r&&r.name},treePathInfo:r&&Yx(r,a)},s+=m+8}},remove:function(){this.group.removeAll()}};function $x(t){var e=s_(t);return e.stroke=e.fill=e.lineWidth=null,e}var Jx=A,Qx=Ci,t_=rs,e_=R,i_=["label"],n_=["emphasis","label"],o_=["upperLabel"],a_=["emphasis","upperLabel"],r_=10,s_=ha([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]);function l_(h,r,s,l,u,e,c,t,i,n){if(c){var d=c.getLayout(),o=h.getData();if(o.setItemGraphicEl(c.dataIndex,null),d&&d.isInView){var f=d.width,p=d.height,g=d.borderWidth,m=d.invisible,v=c.getRawIndex(),y=t&&t.getRawIndex(),a=c.viewChildren,x=d.upperHeight,_=a&&a.length,w=c.getModel("itemStyle"),b=c.getModel("emphasis.itemStyle"),S=L("nodeGroup",Qx);if(S){if(i.add(S),S.attr("position",[d.x||0,d.y||0]),S.__tmNodeWidth=f,S.__tmNodeHeight=p,d.isAboveViewRoot)return S;var M=c.getModel(),I=L("background",t_,n,1);if(I&&function(t,e,i){if(e.dataIndex=c.dataIndex,e.seriesIndex=h.seriesIndex,e.setShape({x:0,y:0,width:f,height:p}),m)A(e);else{e.invisible=!1;var n=c.getVisual("borderColor",!0),o=b.get("borderColor"),a=$x(w);a.fill=n;var r=s_(b);if(r.fill=o,i){var s=f-2*g;D(a,r,n,s,x,{x:g,y:0,width:s,height:x})}else a.text=r.text=null;e.setStyle(a),Us(e,r)}t.add(e)}(S,I,_&&d.upperLabelHeight),_)Qs(S)&&Js(S,!1),I&&(Js(I,!0),o.setItemGraphicEl(c.dataIndex,I));else{var T=L("content",t_,n,2);T&&function(t,e){e.dataIndex=c.dataIndex,e.seriesIndex=h.seriesIndex;var i=Math.max(f-2*g,0),n=Math.max(p-2*g,0);if(e.culling=!0,e.setShape({x:g,y:g,width:i,height:n}),m)A(e);else{e.invisible=!1;var o=c.getVisual("color",!0),a=$x(w);a.fill=o;var r=s_(b);D(a,r,o,i,n),e.setStyle(a),Us(e,r)}t.add(e)}(S,T),I&&Qs(I)&&Js(I,!1),Js(S,!0),o.setItemGraphicEl(c.dataIndex,S)}return S}}}function A(t){t.invisible||e.push(t)}function D(t,e,i,n,o,a){var r=M.get("name"),s=M.getModel(a?o_:i_),l=M.getModel(a?a_:n_),u=s.getShallow("show");el(t,e,s,l,{defaultText:u?r:null,autoColor:i,isRectText:!0,labelFetcher:h,labelDataIndex:c.dataIndex,labelProp:a?"upperLabel":"label"}),C(t,a,d),C(e,a,d),a&&(t.textRect=k(a)),t.truncate=u&&s.get("ellipsis")?{outerWidth:n,outerHeight:o,minChar:2}:null}function C(t,e,i){var n=t.text;if(!e&&i.isLeafRoot&&null!=n){var o=h.get("drillDownIcon",!0);t.text=o?o+" "+n:n}}function L(t,e,i,n){var o=null!=y&&s[t][y],a=u[t];return o?(s[t][y]=null,function(t,e,i){(t[v]={}).old="nodeGroup"===i?e.position.slice():P({},e.shape)}(a,o,t)):m||((o=new e({z:function(t,e){var i=t*r_+e;return(i-1)/i}(i,n)})).__tmDepth=i,function(t,e,i){var n=t[v]={},o=c.parentNode;if(o&&(!l||"drillDown"===l.direction)){var a=0,r=0,s=u.background[o.getRawIndex()];!l&&s&&s.old&&(a=s.old.width,r=s.old.height),n.old="nodeGroup"===i?[0,r]:{x:a,y:r,width:0,height:0}}n.fadein="nodeGroup"!==i}(a,0,o.__tmStorageName=t)),r[t][v]=o}}Cf({type:"treemap",init:function(t,e){this._containerGroup,this._storage={nodeGroup:[],background:[],content:[]},this._oldTree,this._breadcrumb,this._controller,this._state="ready"},render:function(t,e,i,n){if(!(_(e.findComponents({mainType:"series",subType:"treemap",query:n}),t)<0)){this.seriesModel=t,this.api=i,this.ecModel=e;var o=Zx(n,["treemapZoomToNode","treemapRootToNode"],t),a=n&&n.type,r=t.layoutInfo,s=!this._oldTree,l=this._storage,u="treemapRootToNode"===a&&o&&l?{rootNodeGroup:l.nodeGroup[o.node.getRawIndex()],direction:n.direction}:null,h=this._giveContainerGroup(r),c=this._doRender(h,t,u);s||a&&"treemapZoomToNode"!==a&&"treemapRootToNode"!==a?c.renderFinally():this._doAnimation(h,c,t,u),this._resetController(i),this._renderBreadcrumb(t,i,o)}},_giveContainerGroup:function(t){var e=this._containerGroup;return e||(e=this._containerGroup=new Qx,this._initEvents(e),this.group.add(e)),e.attr("position",[t.x,t.y]),e},_doRender:function(t,e,i){var n=e.getData().tree,o=this._oldTree,a={nodeGroup:[],background:[],content:[]},r={nodeGroup:[],background:[],content:[]},s=this._storage,l=[],c=T(l_,e,r,s,i,a,l);!function a(r,s,l,u,h){u?e_(s=r,function(t,e){t.isRemoved()||i(e,e)}):new kf(s,r,t,t).add(i).update(i).remove(T(i,null)).execute();function t(t){return t.getId()}function i(t,e){var i=null!=t?r[t]:null,n=null!=e?s[e]:null,o=c(i,n,l,h);o&&a(i&&i.viewChildren||[],n&&n.viewChildren||[],o,u,h+1)}}(n.root?[n.root]:[],o&&o.root?[o.root]:[],t,n===o||!o,0);var u,h,d=(h={nodeGroup:[],background:[],content:[]},(u=s)&&e_(u,function(t,e){var i=h[e];e_(t,function(t){t&&(i.push(t),t.__tmWillDelete=1)})}),h);return this._oldTree=n,this._storage=r,{lastsForAnimation:a,willDeleteEls:d,renderFinally:function(){e_(d,function(t){e_(t,function(t){t.parent&&t.parent.remove(t)})}),e_(l,function(t){t.invisible=!0,t.dirty()})}}},_doAnimation:function(t,a,e,s){if(e.get("animation")){var l=e.get("animationDurationUpdate"),u=e.get("animationEasing"),h=function(){var a,r=[],s={};return{add:function(t,e,i,n,o){return E(n)&&(o=n,n=0),!s[t.id]&&(s[t.id]=1,r.push({el:t,target:e,time:i,delay:n,easing:o}),!0)},done:function(t){return a=t,this},start:function(){for(var t=r.length,e=0,i=r.length;e=o.length||t===o[t.depth]){var i=E_(r,l,t,e,g,a);n(t,i,o,a)}})}else c=P_(l),t.setVisual("color",c)}(o,{},t.getViewRoot().getAncestors(),t)}};function k_(i,n,t){var o=P({},n),a=t.designatedVisualItemStyle;return R(["color","colorAlpha","colorSaturation"],function(t){a[t]=n[t];var e=i.get(t);(a[t]=null)!=e&&(o[t]=e)}),o}function P_(t){var e=N_(t,"color");if(e){var i=N_(t,"colorAlpha"),n=N_(t,"colorSaturation");return n&&(e=qe(e,null,null,n)),i&&(e=Ke(e,i)),e}}function N_(t,e){var i=t[e];if(null!=i&&"none"!==i)return i}function O_(t,e,i,n,o,a){if(a&&a.length){var r=R_(e,"color")||null!=o.color&&"none"!==o.color&&(R_(e,"colorAlpha")||R_(e,"colorSaturation"));if(r){var s=e.get("visualMin"),l=e.get("visualMax"),u=i.dataExtent.slice();null!=s&&su[1]&&(u[1]=l);var h=e.get("colorMappingBy"),c={type:r.name,dataExtent:u,visual:r.range};"color"!==c.type||"index"!==h&&"id"!==h?c.mappingMethod="linear":(c.mappingMethod="category",c.loop=!0);var d=new g_(c);return d.__drColorMappingBy=h,d}}}function R_(t,e){var i=t.get(e);return D_(i)&&i.length?{name:e,range:i}:null}function E_(t,e,i,n,o,a){var r=P({},e);if(o){var s=o.type,l="color"===s&&o.__drColorMappingBy,u="index"===l?n:"id"===l?a.mapIdToIndex(i.getId()):i.getValue(t.get("visualDimension"));r[s]=o.mapValueToVisual(u)}return r}var z_=Math.max,B_=Math.min,V_=W,G_=R,F_=["itemStyle","borderWidth"],W_=["itemStyle","gapWidth"],H_=["upperLabel","show"],Z_=["upperLabel","height"],U_={seriesType:"treemap",reset:function(t,e,i,n){var o=i.getWidth(),a=i.getHeight(),r=t.option,s=bu(t.getBoxLayoutParams(),{width:i.getWidth(),height:i.getHeight()}),l=r.size||[],u=El(V_(s.width,l[0]),o),h=El(V_(s.height,l[1]),a),c=n&&n.type,d=Zx(n,["treemapZoomToNode","treemapRootToNode"],t),f="treemapRender"===c||"treemapMove"===c?n.rootRect:null,p=t.getViewRoot(),g=Ux(p);if("treemapMove"!==c){var m="treemapZoomToNode"===c?function(t,e,i,n,o){var a,r=(e||{}).node,s=[n,o];if(!r||r===i)return s;var l=n*o,u=l*t.option.zoomToNodeRatio;for(;a=r.parentNode;){for(var h=0,c=a.children,d=0,f=c.length;ds[1]&&(s[1]=e)})}else s=[NaN,NaN];return{sum:n,dataExtent:s}}(e,r,s);if(0===u.sum)return t.viewChildren=[];if(u.sum=function(t,e,i,n,o){if(!n)return i;for(var a=t.get("visibleMin"),r=o.length,s=r,l=r-1;0<=l;l--){var u=o["asc"===n?r-l-1:l].getValue();u/i*ei[l[r]])&&(h=i[l[r]]);for(var c=0,d=t.length;c "+d)),u++)}var f,p=i.get("coordinateSystem");if("cartesian2d"===p||"polar"===p)f=gp(t,i);else{var g=lh.get(p),m=g&&"view"!==g.type&&g.dimensions||[];_(m,"value")<0&&m.concat(["value"]);var v=lp(t,{coordDimensions:m});(f=new Yf(v,i)).initData(t)}var y=new Yf(["value"],i);return y.initData(l,s),o&&o(f,y),yx({mainData:f,struct:a,structAttr:"graph",datas:{node:f,edge:y},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var nw="--\x3e",ow=function(t){return t.get("autoCurveness")||null},aw=function(t,e){var i=ow(t),n=20,o=[];if("number"==typeof i)n=i;else if(L(i))return void(t.__curvenessList=i);n ")),o.value&&(l+=" : "+au(o.value)),l},_updateCategoriesData:function(){var t=O(this.option.categories||[],function(t){return null!=t.value?t:P({value:0},t)}),e=new Yf(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray(function(t){return e.getItemModel(t,!0)})},setZoom:function(t){this.option.zoom=t},setCenter:function(t){this.option.center=t},isAnimationEnabled:function(){return dw.superCall(this,"isAnimationEnabled")&&!("force"===this.get("layout")&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",legendHoverLink:!0,hoverAnimation:!0,layout:null,focusNodeAdjacency:!1,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{label:{show:!0}}}}),fw=ls.prototype,pw=ds.prototype;function gw(t){return isNaN(+t.cpx1)||isNaN(+t.cpy1)}var mw=Cs({type:"ec-line",style:{stroke:"#000",fill:null},shape:{x1:0,y1:0,x2:0,y2:0,percent:1,cpx1:null,cpy1:null},buildPath:function(t,e){this[gw(e)?"_buildPathLine":"_buildPathCurve"](t,e)},_buildPathLine:fw.buildPath,_buildPathCurve:pw.buildPath,pointAt:function(t){return this[gw(this.shape)?"_pointAtLine":"_pointAtCurve"](t)},_pointAtLine:fw.pointAt,_pointAtCurve:pw.pointAt,tangentAt:function(t){var e=this.shape,i=gw(e)?[e.x2-e.x1,e.y2-e.y1]:this._tangentAtCurve(t);return mt(i,i)},_tangentAtCurve:pw.tangentAt}),vw=["fromSymbol","toSymbol"];function yw(t){return"_"+t+"Type"}function xw(t,e,i){var n=e.getItemVisual(i,t);if(n&&"none"!==n){var o=e.getItemVisual(i,"color"),a=e.getItemVisual(i,t+"Size"),r=e.getItemVisual(i,t+"Rotate");L(a)||(a=[a,a]);var s=wg(n,-a[0]/2,-a[1]/2,a[0],a[1],o);return s.__specifiedRotation=null==r||isNaN(r)?void 0:+r*Math.PI/180||0,s.name=t,s}}function _w(t,e){t.x1=e[0][0],t.y1=e[0][1],t.x2=e[1][0],t.y2=e[1][1],t.percent=1;var i=e[2];i?(t.cpx1=i[0],t.cpy1=i[1]):(t.cpx1=NaN,t.cpy1=NaN)}function ww(t,e,i){Ci.call(this),this._createLine(t,e,i)}var bw=ww.prototype;function Sw(t){this._ctor=t||ww,this.group=new Ci}bw.beforeUpdate=function(){var t=this.childOfName("fromSymbol"),e=this.childOfName("toSymbol"),i=this.childOfName("label");if(t||e||!i.ignore){for(var n=1,o=this.parent;o;)o.scale&&(n/=o.scale[0]),o=o.parent;var a=this.childOfName("line");if(this.__dirty||a.__dirty){var r=a.shape.percent,s=a.pointAt(0),l=a.pointAt(r),u=ht([],l,s);if(mt(u,u),t){if(t.attr("position",s),null==(c=t.__specifiedRotation)){var h=a.tangentAt(0);t.attr("rotation",Math.PI/2-Math.atan2(h[1],h[0]))}else t.attr("rotation",c);t.attr("scale",[n*r,n*r])}if(e){var c;if(e.attr("position",l),null==(c=e.__specifiedRotation)){h=a.tangentAt(1);e.attr("rotation",-Math.PI/2-Math.atan2(h[1],h[0]))}else e.attr("rotation",c);e.attr("scale",[n*r,n*r])}if(!i.ignore){var d,f,p,g;i.attr("position",l);var m=i.__labelDistance,v=m[0]*n,y=m[1]*n,x=r/2,_=[(h=a.tangentAt(x))[1],-h[0]],w=a.pointAt(x);0<_[1]&&(_[0]=-_[0],_[1]=-_[1]);var b,S=h[0]<0?-1:1;if("start"!==i.__position&&"end"!==i.__position){var M=-Math.atan2(h[1],h[0]);l[0]=t&&(0===e?0:n[e-1][0])a&&(e[1-n]=e[n]+c.sign*a),e}function lb(t,e){var i=t[e]-t[1-e];return{span:Math.abs(i),sign:0o*(1-h[0])?(l="jump",r=s-o*(1-h[2])):0<=(r=s-o*h[1])&&(r=s-o*(1-h[1]))<=0&&(r=0),(r*=e.axisExpandWidth/u)?sb(r,n,a,"all"):l="none";else{o=n[1]-n[0];(n=[db(0,a[1]*s/o-o/2)])[1]=cb(a[1],n[0]+o),n[0]=n[1]-o}return{axisExpandWindow:n,behavior:l}}},lh.register("parallel",{create:function(n,o){var a=[];return n.eachComponent("parallel",function(t,e){var i=new vb(t,n,o);i.name="parallel_"+e,i.resize(t,o),(t.coordinateSystem=i).model=t,a.push(i)}),n.eachSeries(function(t){if("parallel"===t.get("coordinateSystem")){var e=n.queryComponents({mainType:"parallel",index:t.get("parallelIndex"),id:t.get("parallelId")})[0];t.coordinateSystem=e.coordinateSystem}}),a}});var xb=ku.extend({type:"baseParallelAxis",axis:null,activeIntervals:[],getAreaSelectStyle:function(){return ha([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},setActiveIntervals:function(t){var e=this.activeIntervals=k(t);if(e)for(var i=e.length-1;0<=i;i--)Bl(e[i])},getActiveState:function(t){var e=this.activeIntervals;if(!e.length)return"normal";if(null==t||isNaN(t))return"inactive";if(1===e.length){var i=e[0];if(i[0]<=t&&t<=i[1])return"active"}else for(var n=0,o=e.length;nn.getWidth()||i<0||i>n.getHeight()}(t,e)){var n=t._zr,o=t._covers,a=Fb(t,e,i);if(!t._dragging)for(var r=0;rf&&(f=m.depth),g.setLayout({depth:v?m.depth:c},!0),"vertical"===a?g.setLayout({dy:i},!0):g.setLayout({dx:i},!0);for(var y=0;y "))},preventIncremental:function(){return!!this.get("effect.show")},getProgressive:function(){var t=this.option.progressive;return null==t?this.option.large?1e4:this.get("progressive"):t},getProgressiveThreshold:function(){var t=this.option.progressiveThreshold;return null==t?this.option.large?2e4:this.get("progressiveThreshold"):t},defaultOption:{coordinateSystem:"geo",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}}});function bM(t,e,i){Ci.call(this),this.add(this.createLine(t,e,i)),this._updateEffectSymbol(t,e)}var SM=bM.prototype;function MM(t,e,i){Ci.call(this),this._createPolyline(t,e,i)}SM.createLine=function(t,e,i){return new ww(t,e,i)},SM._updateEffectSymbol=function(t,e){var i=t.getItemModel(e).getModel("effect"),n=i.get("symbolSize"),o=i.get("symbol");L(n)||(n=[n,n]);var a=i.get("color")||t.getItemVisual(e,"color"),r=this.childAt(1);this._symbolType!==o&&(this.remove(r),(r=wg(o,-.5,-.5,1,1,a)).z2=100,r.culling=!0,this.add(r)),r&&(r.setStyle("shadowColor",a),r.setStyle(i.getItemStyle(["color"])),r.attr("scale",n),r.setColor(a),r.attr("scale",n),this._symbolType=o,this._symbolScale=n,this._updateEffectAnimation(t,i,e))},SM._updateEffectAnimation=function(e,t,i){var n=this.childAt(1);if(n){var o=this,a=e.getItemLayout(i),r=1e3*t.get("period"),s=t.get("loop"),l=t.get("constantSpeed"),u=W(t.get("delay"),function(t){return t/e.count()*r/3}),h="function"==typeof u;if(n.ignore=!0,this.updateAnimationPoints(n,a),0e);r++);r=Math.min(r-1,o-2)}wt(t.position,i[r],i[r+1],(e-n[r])/(n[r+1]-n[r]));var s=i[r+1][0]-i[r][0],l=i[r+1][1]-i[r][1];t.rotation=-Math.atan2(l,s)-Math.PI/2,this._lastFrame=r,this._lastFramePercent=e,t.ignore=!1}},w(TM,bM);var DM=Cs({shape:{polyline:!1,curveness:0,segs:[]},buildPath:function(t,e){var i=e.segs,n=e.curveness;if(e.polyline)for(var o=0;o=e[0]&&t<=e[1]}}(y,e.option.range):function(e,n,o){var i=e[1]-e[0],a=(n=O(n,function(t){return{interval:[(t.interval[0]-e[0])/i,(t.interval[1]-e[0])/i]}})).length,r=0;return function(t){for(var e=r;e=e.y&&t[1]<=e.y+e.height:i.contain(i.toLocalCoord(t[1]))&&t[0]>=e.y&&t[0]<=e.y+e.height},pointToData:function(t){var e=this.getAxis();return[e.coordToData(e.toLocalCoord(t["horizontal"===e.orient?0:1]))]},dataToPoint:function(t){var e=this.getAxis(),i=this.getRect(),n=[],o="horizontal"===e.orient?0:1;return t instanceof Array&&(t=t[0]),n[o]=e.toGlobalCoord(e.dataToCoord(+t)),n[1-o]=0==o?i.y+i.height/2:i.x+i.width/2,n}}).dimensions});var sI=["axisLine","axisTickLabel","axisName"],lI=["splitArea","splitLine"],uI=mv.extend({type:"singleAxis",axisPointerClass:"SingleAxisPointer",render:function(e,t,i,n){var o=this.group;o.removeAll();var a=this._axisGroup;this._axisGroup=new Ci;var r=rI(e),s=new Qm(e,r);R(sI,s.add,s),o.add(this._axisGroup),o.add(s.getGroup()),R(lI,function(t){e.get(t+".show")&&this["_"+t](e)},this),ml(a,this._axisGroup,e),uI.superCall(this,"render",e,t,i,n)},remove:function(){bv(this)},_splitLine:function(t){var e=t.axis;if(!e.scale.isBlank()){var i=t.getModel("splitLine"),n=i.getModel("lineStyle"),o=n.get("width"),a=n.get("color");a=a instanceof Array?a:[a];for(var r=t.coordinateSystem.getRect(),s=e.isHorizontal(),l=[],u=0,h=e.getTicksCoords({tickModel:i}),c=[],d=[],f=0;fr)return!0;if(a){var s=fv(t).seriesDataCount,l=n.getExtent();return Math.abs(l[0]-l[1])/s>r}return!1},makeElOption:function(t,e,i,n,o){},createPointerEl:function(t,e,i,n){var o=e.pointer;if(o){var a=AI(t).pointerEl=new bl[o.type](DI(e.pointer));t.add(a)}},createLabelEl:function(t,e,i,n){if(e.label){var o=AI(t).labelEl=new rs(DI(e.label));t.add(o),PI(o,n)}},updatePointerEl:function(t,e,i){var n=AI(t).pointerEl;n&&e.pointer&&(n.setStyle(e.pointer.style),i(n,{shape:e.pointer.shape}))},updateLabelEl:function(t,e,i,n){var o=AI(t).labelEl;o&&(o.setStyle(e.label.style),i(o,{shape:e.label.shape,position:e.label.position}),PI(o,n))},_renderHandle:function(t){if(!this._dragging&&this.updateHandleTransform){var e,i=this._axisPointerModel,n=this._api.getZr(),o=this._handle,a=i.getModel("handle"),r=i.get("status");if(!a.get("show")||!r||"hide"===r)return o&&n.remove(o),void(this._handle=null);this._handle||(e=!0,o=this._handle=yl(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(t){Xt(t.event)},onmousedown:CI(this._onHandleDragMove,this,0,0),drift:CI(this._onHandleDragMove,this),ondragend:CI(this._onHandleDragEnd,this)}),n.add(o)),OI(o,i,!1);o.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var s=a.get("size");L(s)||(s=[s,s]),o.attr("scale",[s[0]/2,s[1]/2]),kc(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(t,e)}},_moveHandleToValue:function(t,e){kI(this._axisPointerModel,!e&&this._moveAnimation,this._handle,NI(this.getHandleTransform(t,this._axisModel,this._axisPointerModel)))},_onHandleDragMove:function(t,e){var i=this._handle;if(i){this._dragging=!0;var n=this.updateHandleTransform(NI(i),[t,e],this._axisModel,this._axisPointerModel);this._payloadInfo=n,i.stopAnimation(),i.attr(NI(n)),AI(i).lastProp=null,this._doDispatchAxisPointer()}},_doDispatchAxisPointer:function(){if(this._handle){var t=this._payloadInfo,e=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:e.axis.dim,axisIndex:e.componentIndex}]})}},_onHandleDragEnd:function(t){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get("value");this._moveHandleToValue(e),this._api.dispatchAction({type:"hideTip"})}},getHandleTransform:null,updateHandleTransform:null,clear:function(t){this._lastValue=null,this._lastStatus=null;var e=t.getZr(),i=this._group,n=this._handle;e&&i&&(this._lastGraphicKey=null,i&&e.remove(i),n&&e.remove(n),this._group=null,this._handle=null,this._payloadInfo=null)},doClear:function(){},buildLabel:function(t,e,i){return{x:t[i=i||0],y:t[1-i],width:e[i],height:e[1-i]}}}).constructor=LI);var HI=LI.extend({makeElOption:function(t,e,i,n,o){var a=i.axis,r=a.grid,s=n.get("type"),l=ZI(r,a).getOtherAxis(a).getGlobalExtent(),u=a.toGlobalCoord(a.dataToCoord(e,!0));if(s&&"none"!==s){var h=RI(n),c=UI[s](a,u,l);c.style=h,t.graphicKey=c.type,t.pointer=c}VI(e,t,_v(r.model,i),i,n,o)},getHandleTransform:function(t,e,i){var n=_v(e.axis.grid.model,e,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:BI(e.axis,t,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(t,e,i,n){var o=i.axis,a=o.grid,r=o.getGlobalExtent(!0),s=ZI(a,o).getOtherAxis(o).getGlobalExtent(),l="x"===o.dim?0:1,u=t.position;u[l]+=e[l],u[l]=Math.min(r[1],u[l]),u[l]=Math.max(r[0],u[l]);var h=(s[1]+s[0])/2,c=[h,h];c[l]=u[l];return{position:u,rotation:t.rotation,cursorPoint:c,tooltipOption:[{verticalAlign:"middle"},{align:"center"}][l]}}});function ZI(t,e){var i={};return i[e.dim+"AxisIndex"]=e.index,t.getCartesian(i)}var UI={line:function(t,e,i){return{type:"Line",subPixelOptimize:!0,shape:GI([e,i[0]],[e,i[1]],XI(t))}},shadow:function(t,e,i){var n=Math.max(1,t.getBandWidth()),o=i[1]-i[0];return{type:"Rect",shape:FI([e-n/2,i[0]],[n,o],XI(t))}}};function XI(t){return"x"===t.dim?0:1}mv.registerAxisPointerClass("CartesianAxisPointer",HI),yf(function(t){if(t){t.axisPointer&&0!==t.axisPointer.length||(t.axisPointer={});var e=t.axisPointer.link;e&&!L(e)&&(t.axisPointer.link=[e])}}),xf(Ld.PROCESSOR.STATISTIC,function(t,e){t.getComponent("axisPointer").coordSysAxesInfo=cv(t,e)}),_f({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},function(t,e,i){var n=t.currTrigger,r=[t.x,t.y],o=t,a=t.dispatchAction||A(i.dispatchAction,i),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){xI(r)&&(r=cI({seriesIndex:o.seriesIndex,dataIndex:o.dataIndex},e).point);var l=xI(r),u=o.axesInfo,h=s.axesInfo,c="leave"===n||xI(r),d={},f={},p={list:[],map:{}},g={showPointer:fI(mI,f),showTooltip:fI(vI,p)};dI(s.coordSysMap,function(t,e){var a=l||t.containPoint(r);dI(s.coordSysAxesInfo[e],function(t,e){var i=t.axis,n=function(t,e){for(var i=0;i<(t||[]).length;i++){var n=t[i];if(e.axis.dim===n.axisDim&&e.axis.model.componentIndex===n.axisIndex)return n}}(u,t);if(!c&&a&&(!u||n)){var o=n&&n.value;null!=o||l||(o=i.pointToData(r)),null!=o&&gI(t,o,g,!1,d)}})});var m={};return dI(h,function(o,t){var a=o.linkGroup;a&&!f[t]&&dI(a.axesInfo,function(t,e){var i=f[e];if(t!==o&&i){var n=i.value;a.mapper&&(n=o.axis.scale.parse(a.mapper(n,yI(t),yI(o)))),m[o.key]=n}})}),dI(m,function(t,e){gI(h[e],t,g,!0,d)}),function(o,t,e){var a=e.axesInfo=[];dI(t,function(t,e){var i=t.axisPointerModel.option,n=o[e];n?(t.useHandle||(i.status="show"),i.value=n.value,i.seriesDataIndices=(n.payloadBatch||[]).slice()):t.useHandle||(i.status="hide"),"show"===i.status&&a.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:i.value})})}(f,h,d),function(t,e,i,n){if(xI(e)||!t.list.length)return n({type:"hideTip"});var o=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:i.tooltipOption,position:i.position,dataIndexInside:o.dataIndexInside,dataIndex:o.dataIndex,seriesIndex:o.seriesIndex,dataByCoordSys:t.list})}(p,r,t,a),function(t,e,i){var n=i.getZr(),o="axisPointerLastHighlights",a=pI(n)[o]||{},r=pI(n)[o]={};dI(t,function(t,e){var i=t.axisPointerModel.option;"show"===i.status&&dI(i.seriesDataIndices,function(t){var e=t.seriesIndex+" | "+t.dataIndex;r[e]=t})});var s=[],l=[];R(a,function(t,e){r[e]||l.push(t)}),R(r,function(t,e){a[e]||s.push(t)}),l.length&&i.dispatchAction({type:"downplay",escapeConnect:!0,batch:l}),s.length&&i.dispatchAction({type:"highlight",escapeConnect:!0,batch:s})}(h,0,i),d}});var YI=["x","y"],jI=["width","height"],qI=LI.extend({makeElOption:function(t,e,i,n,o){var a=i.axis,r=a.coordinateSystem,s=JI(r,1-$I(a)),l=r.dataToPoint(e)[0],u=n.get("type");if(u&&"none"!==u){var h=RI(n),c=KI[u](a,l,s);c.style=h,t.graphicKey=c.type,t.pointer=c}VI(e,t,rI(i),i,n,o)},getHandleTransform:function(t,e,i){var n=rI(e,{labelInside:!1});return n.labelMargin=i.get("handle.margin"),{position:BI(e.axis,t,n),rotation:n.rotation+(n.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(t,e,i,n){var o=i.axis,a=o.coordinateSystem,r=$I(o),s=JI(a,r),l=t.position;l[r]+=e[r],l[r]=Math.min(s[1],l[r]),l[r]=Math.max(s[0],l[r]);var u=JI(a,1-r),h=(u[1]+u[0])/2,c=[h,h];return c[r]=l[r],{position:l,rotation:t.rotation,cursorPoint:c,tooltipOption:{verticalAlign:"middle"}}}}),KI={line:function(t,e,i){return{type:"Line",subPixelOptimize:!0,shape:GI([e,i[0]],[e,i[1]],$I(t))}},shadow:function(t,e,i){var n=t.getBandWidth(),o=i[1]-i[0];return{type:"Rect",shape:FI([e-n/2,i[0]],[n,o],$I(t))}}};function $I(t){return t.isHorizontal()?0:1}function JI(t,e){var i=t.getRect();return[i[YI[e]],i[YI[e]]+i[jI[e]]]}mv.registerAxisPointerClass("SingleAxisPointer",qI),Af({type:"single"});var QI=sc.extend({type:"series.themeRiver",dependencies:["singleAxis"],nameMap:null,init:function(t){QI.superApply(this,"init",arguments),this.legendVisualProvider=new qv(A(this.getData,this),A(this.getRawData,this))},fixData:function(t){var e=t.length,i={},n=ta(t,function(t){return i.hasOwnProperty(t[0])||(i[t[0]]=-1),t[2]}),o=[];n.buckets.each(function(t,e){o.push({name:e,dataList:t})});for(var a=o.length,r=0;rMath.PI/2?"right":"left"):x&&"center"!==x?"left"===x?(f=u.r0+y,p>Math.PI/2&&(x="right")):"right"===x&&(f=u.r-y,p>Math.PI/2&&(x="left")):(f=(u.r+u.r0)/2,x="center"),d.attr("style",{text:l,textAlign:x,textVerticalAlign:M("verticalAlign")||"middle",opacity:M("opacity")});var _=f*g+u.cx,w=f*m+u.cy;d.attr("position",[_,w]);var b=M("rotate"),S=0;function M(t){var e=a.get(t);return null==e?o.get(t):e}"radial"===b?(S=-p)<-Math.PI/2&&(S+=Math.PI):"tangential"===b?(S=Math.PI/2-p)>Math.PI/2?S-=Math.PI:S<-Math.PI/2&&(S+=Math.PI):"number"==typeof b&&(S=b*Math.PI/180),d.attr("rotation",S)},sT._initEvents=function(t,e,i,n){t.off("mouseover").off("mouseout").off("emphasis").off("normal");function o(){r.onEmphasis(n)}function a(){r.onNormal()}var r=this;i.isAnimationEnabled()&&t.on("mouseover",o).on("mouseout",a).on("emphasis",o).on("normal",a).on("downplay",function(){r.onDownplay()}).on("highlight",function(){r.onHighlight()})},w(rT,Ci);_c.extend({type:"sunburst",init:function(){},render:function(o,a,t,e){var n=this;this.seriesModel=o,this.api=t,this.ecModel=a;var r=o.getData(),s=r.tree.root,i=o.getViewRoot(),l=this.group,u=o.get("renderLabelForZeroData"),h=[];i.eachNode(function(t){h.push(t)});var c=this._oldChildren||[];if(function(i,n){if(0===i.length&&0===n.length)return;function t(t){return t.getId()}function e(t,e){!function(t,e){u||!t||t.getValue()||(t=null);if(t!==s&&e!==s)if(e&&e.piece)t?(e.piece.updateData(!1,t,"normal",o,a),r.setItemGraphicEl(t.dataIndex,e.piece)):function(t){if(!t)return;t.piece&&(l.remove(t.piece),t.piece=null)}(e);else if(t){var i=new rT(t,o,a);l.add(i),r.setItemGraphicEl(t.dataIndex,i)}}(null==t?null:i[t],null==e?null:n[e])}new kf(n,i,t,t).add(e).update(e).remove(T(e,null)).execute()}(h,c),function(t,e){if(0=i.r0}}});var lT="sunburstRootToNode";_f({type:lT,update:"updateView"},function(o,t){t.eachComponent({mainType:"series",subType:"sunburst",query:o},function(t,e){var i=Zx(o,[lT],t);if(i){var n=t.getViewRoot();n&&(o.direction=Xx(n,i.node)?"rollUp":"drillDown"),t.resetViewRoot(i.node)}})});var uT="sunburstHighlight";_f({type:uT,update:"updateView"},function(n,t){t.eachComponent({mainType:"series",subType:"sunburst",query:n},function(t,e){var i=Zx(n,[uT],t);i&&(n.highlight=i.node)})});_f({type:"sunburstUnhighlight",update:"updateView"},function(i,t){t.eachComponent({mainType:"series",subType:"sunburst",query:i},function(t,e){i.unhighlight=!0})});var hT=Math.PI/180;function cT(t,e){if("function"==typeof e)return t.sort(e);var n="asc"===e;return t.sort(function(t,e){var i=(t.getValue()-e.getValue())*(n?1:-1);return 0==i?(t.dataIndex-e.dataIndex)*(n?-1:1):i})}function dT(a,r){return r=r||[0,0],O(["x","y"],function(t,e){var i=this.getAxis(t),n=r[e],o=a[e]/2;return"category"===i.type?i.getBandWidth():Math.abs(i.dataToCoord(n-o)-i.dataToCoord(n+o))},this)}Sf(T(iy,"sunburst")),bf(T(function(t,e,C,i){e.eachSeriesByType(t,function(t){var e=t.get("center"),i=t.get("radius");L(i)||(i=[0,i]),L(e)||(e=[e,e]);var n=C.getWidth(),o=C.getHeight(),h=Math.min(n,o),c=El(e[0],n),d=El(e[1],o),f=El(i[0],h/2),a=El(i[1],h/2),r=-t.get("startAngle")*hT,p=t.get("minAngle")*hT,g=t.getData().tree.root,s=t.getViewRoot(),m=s.depth,l=t.get("sort");null!=l&&!function e(t,i){var n=t.children||[];t.children=cT(n,i);n.length&&R(t.children,function(t){e(t,i)})}(s,l);var u=0;R(s.children,function(t){isNaN(t.getValue())||u++});var v=s.getValue(),y=Math.PI/(v||u)*2,x=0t[1]&&t.reverse(),{coordSys:{type:"polar",cx:o.cx,cy:o.cy,r:t[1],r0:t[0]},api:{coord:A(function(t){var e=a.dataToRadius(t[0]),i=r.dataToAngle(t[1]),n=o.coordToPoint([e,i]);return n.push(e,i*Math.PI/180),n}),size:A(gT,o)}}},calendar:function(i){var t=i.getRect(),e=i.getRangeInfo();return{coordSys:{type:"calendar",x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:i.getCellWidth(),cellHeight:i.getCellHeight(),rangeInfo:{start:e.start,end:e.end,weeks:e.weeks,dayCount:e.allDay}},api:{coord:function(t,e){return i.dataToPoint(t,e)}}}}};function ST(t,e,i,n,o){null==i[t]||o||(e[t]=i[t],i[t]=n[t])}function MT(a,r,e,t){var i=a.get("renderItem"),n=a.coordinateSystem,o={};n&&(o=n.prepareCustoms?n.prepareCustoms():bT[n.type](n));var s,l,u,h,c,d=D({getWidth:t.getWidth,getHeight:t.getHeight,getZr:t.getZr,getDevicePixelRatio:t.getDevicePixelRatio,value:function(t,e){return null==e&&(e=s),r.get(r.getDimension(t||0),e)},style:function(t,e){null==e&&(e=s),g(e);var i=l.getModel(vT).getItemStyle();null!=c&&(i.fill=c);var n=r.getItemVisual(e,"opacity");null!=n&&(i.opacity=n);var o=t?CT(t,u):u;return nl(i,o,null,{autoColor:c,isRectText:!0}),i.text=o.getShallow("show")?H(a.getFormattedLabel(e,"normal"),Ug(r,e)):null,t&<(i,t),i},styleEmphasis:function(t,e){null==e&&(e=s),g(e);var i=l.getModel(yT).getItemStyle(),n=t?CT(t,h):h;return nl(i,n,null,{isRectText:!0},!0),i.text=n.getShallow("show")?Z(a.getFormattedLabel(e,"emphasis"),a.getFormattedLabel(e,"normal"),Ug(r,e)):null,t&<(i,t),i},visual:function(t,e){return null==e&&(e=s),r.getItemVisual(e,t)},barLayout:function(t){if(n.getBaseAxis){return function(t){var e=[],i=t.axis;if("category"===i.type){for(var n=i.getBandWidth(),o=0;oe[1]&&e.reverse();var i=t.getExtent(),n=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:e[0],r:e[1],startAngle:-i[0]*n,endAngle:-i[1]*n,clockwise:t.inverse,contain:function(t,e){var i=t-this.cx,n=e-this.cy,o=i*i+n*n,a=this.r,r=this.r0;return o<=a*a&&r*r<=o}}}};var GT=ku.extend({type:"polarAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"polar",index:this.option.polarIndex,id:this.option.polarId})[0]}});m(GT.prototype,dg);var FT={splitNumber:5};function WT(t,e){return e.type||(e.data?"category":"value")}function HT(t,e){var i=this,n=i.getAngleAxis(),o=i.getRadiusAxis();if(n.scale.setExtent(1/0,-1/0),o.scale.setExtent(1/0,-1/0),t.eachSeries(function(t){if(t.coordinateSystem===i){var e=t.getData();R(e.mapDimension("radius",!0),function(t){o.scale.unionExtentFromData(e,pp(e,t))}),R(e.mapDimension("angle",!0),function(t){n.scale.unionExtentFromData(e,pp(e,t))})}}),rg(n.scale,n.model),rg(o.scale,o.model),"category"===n.type&&!n.onBand){var a=n.getExtent(),r=360/n.scale.count();n.inverse?a[1]+=r:a[1]-=r,n.setExtent(a[0],a[1])}}function ZT(t,e){if(t.type=e.get("type"),t.scale=sg(e),t.onBand=e.get("boundaryGap")&&"category"===t.type,t.inverse=e.get("inverse"),"angleAxis"===e.mainType){t.inverse^=e.get("clockwise");var i=e.get("startAngle");t.setExtent(i,i+(t.inverse?-360:360))}(e.axis=t).model=e}Gm("angle",GT,WT,{startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:!1}}),Gm("radius",GT,WT,FT),Tf({type:"polar",dependencies:["polarAxis","angleAxis"],coordinateSystem:null,findAxisModel:function(t){var e;return this.ecModel.eachComponent(t,function(t){t.getCoordSysModel()===this&&(e=t)},this),e},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"80%"}}),lh.register("polar",{dimensions:VT.prototype.dimensions,create:function(i,s){var l=[];return i.eachComponent("polar",function(t,e){var i=new VT(e);i.update=HT;var n=i.getRadiusAxis(),o=i.getAngleAxis(),a=t.findAxisModel("radiusAxis"),r=t.findAxisModel("angleAxis");ZT(n,a),ZT(o,r),function(t,e,i){var n=e.get("center"),o=i.getWidth(),a=i.getHeight();t.cx=El(n[0],o),t.cy=El(n[1],a);var r=t.getRadiusAxis(),s=Math.min(o,a)/2,l=e.get("radius");null==l?l=[0,"100%"]:L(l)||(l=[0,l]),l=[El(l[0],s),El(l[1],s)],r.inverse?r.setExtent(l[1],l[0]):r.setExtent(l[0],l[1])}(i,t,s),l.push(i),(t.coordinateSystem=i).model=t}),i.eachSeries(function(t){if("polar"===t.get("coordinateSystem")){var e=i.queryComponents({mainType:"polar",index:t.get("polarIndex"),id:t.get("polarId")})[0];t.coordinateSystem=e.coordinateSystem}}),l}});var UT=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function XT(t,e,i){e[1]>e[0]&&(e=e.slice().reverse());var n=t.coordToPoint([e[0],i]),o=t.coordToPoint([e[1],i]);return{x1:n[0],y1:n[1],x2:o[0],y2:o[1]}}function YT(t){return t.getRadiusAxis().inverse?0:1}function jT(t){var e=t[0],i=t[t.length-1];e&&i&&Math.abs(Math.abs(e.coord-i.coord)-360)<1e-4&&t.pop()}mv.extend({type:"angleAxis",axisPointerClass:"PolarAxisPointer",render:function(e,t){if(this.group.removeAll(),e.get("show")){var i=e.axis,n=i.polar,o=n.getRadiusAxis().getExtent(),a=i.getTicksCoords(),r=i.getMinorTicksCoords(),s=O(i.getViewLabels(),function(t){return(t=k(t)).coord=i.dataToCoord(t.tickValue),t});jT(s),jT(a),R(UT,function(t){!e.get(t+".show")||i.scale.isBlank()&&"axisLine"!==t||this["_"+t](e,n,a,r,o,s)},this)}},_axisLine:function(t,e,i,n,o){var a,r=t.getModel("axisLine.lineStyle"),s=YT(e),l=s?0:1;(a=0===o[l]?new Yr({shape:{cx:e.cx,cy:e.cy,r:o[s]},style:r.getLineStyle(),z2:1,silent:!0}):new Kr({shape:{cx:e.cx,cy:e.cy,r:o[s],r0:o[l]},style:r.getLineStyle(),z2:1,silent:!0})).style.fill=null,this.group.add(a)},_axisTick:function(t,e,i,n,o){var a=t.getModel("axisTick"),r=(a.get("inside")?-1:1)*a.get("length"),s=o[YT(e)],l=O(i,function(t){return new ls({shape:XT(e,[s,s+r],t.coord)})});this.group.add(Rs(l,{style:D(a.getModel("lineStyle").getLineStyle(),{stroke:t.get("axisLine.lineStyle.color")})}))},_minorTick:function(t,e,i,n,o){if(n.length){for(var a=t.getModel("axisTick"),r=t.getModel("minorTick"),s=(a.get("inside")?-1:1)*r.get("length"),l=o[YT(e)],u=[],h=0;hr?"left":"right",u=Math.abs(a[1]-s)/o<.3?"middle":a[1]>s?"top":"bottom";p&&p[n]&&p[n].textStyle&&(i=new Cl(p[n].textStyle,g,g.ecModel));var h=new Ur({silent:Qm.isLabelSilent(c)});this.group.add(h),nl(h.style,i,{x:a[0],y:a[1],textFill:i.getTextColor()||c.get("axisLine.lineStyle.color"),text:t.formattedLabel,textAlign:l,textVerticalAlign:u}),v&&(h.eventData=Qm.makeAxisEventDataBase(c),h.eventData.targetType="axisLabel",h.eventData.value=t.rawLabel)},this)},_splitLine:function(t,e,i,n,o){var a=t.getModel("splitLine").getModel("lineStyle"),r=a.get("color"),s=0;r=r instanceof Array?r:[r];for(var l=[],u=0;um?"left":"right",h=Math.abs(l[1]-v)/g<.3?"middle":l[1]>v?"top":"bottom"}return{position:l,align:u,verticalAlign:h}}(e,i,0,s,d))}});var JT={line:function(t,e,i,n,o){return"angle"===t.dim?{type:"Line",shape:GI(e.coordToPoint([n[0],i]),e.coordToPoint([n[1],i]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:i}}},shadow:function(t,e,i,n,o){var a=Math.max(1,t.getBandWidth()),r=Math.PI/180;return"angle"===t.dim?{type:"Sector",shape:WI(e.cx,e.cy,n[0],n[1],(-i-a/2)*r,(a/2-i)*r)}:{type:"Sector",shape:WI(e.cx,e.cy,i-a/2,i+a/2,0,2*Math.PI)}}};function QT(n,t){t.update="updateView",_f(t,function(t,e){var i={};return e.eachComponent({mainType:"geo",query:t},function(e){e[n](t.name),R(e.coordinateSystem.regions,function(t){i[t.name]=e.isSelected(t.name)||!1})}),{selected:i,name:t.name}})}mv.registerAxisPointerClass("PolarAxisPointer",$T),bf(T(function(t,e,i){var N={},O=function(t){var g={};R(t,function(t,e){var i=t.getData(),n=t.coordinateSystem,o=n.getBaseAxis(),a=RT(n,o),r=o.getExtent(),s="category"===o.type?o.getBandWidth():Math.abs(r[1]-r[0])/i.count(),l=g[a]||{bandWidth:s,remainedWidth:s,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},u=l.stacks;g[a]=l;var h=OT(t);u[h]||l.autoWidthCount++,u[h]=u[h]||{width:0,maxWidth:0};var c=El(t.get("barWidth"),s),d=El(t.get("barMaxWidth"),s),f=t.get("barGap"),p=t.get("barCategoryGap");c&&!u[h].width&&(c=Math.min(l.remainedWidth,c),u[h].width=c,l.remainedWidth-=c),d&&(u[h].maxWidth=d),null!=f&&(l.gap=f),null!=p&&(l.categoryGap=p)});var d={};return R(g,function(t,i){d[i]={};var e=t.stacks,n=t.bandWidth,o=El(t.categoryGap,n),a=El(t.gap,1),r=t.remainedWidth,s=t.autoWidthCount,l=(r-o)/(s+(s-1)*a);l=Math.max(l,0),R(e,function(t,e){var i=t.maxWidth;i&&i=n.start.time&&i.timea.end.time&&t.reverse(),t},_getRangeInfo:function(t){var e;(t=[this.getDateInfo(t[0]),this.getDateInfo(t[1])])[0].time>t[1].time&&(e=!0,t.reverse());var i=Math.floor(t[1].time/864e5)-Math.floor(t[0].time/864e5)+1,n=new Date(t[0].time),o=n.getDate(),a=t[1].date.getDate();n.setDate(o+i-1);var r=n.getDate();if(r!==a)for(var s=0n.weeks||0===t&&en.lweek)return!1;var o=7*(t-1)-n.fweek+e,a=new Date(n.start.time);return a.setDate(n.start.d+o),this.getDateInfo(a)}},tA.dimensions=tA.prototype.dimensions,tA.getDimensionsInfo=tA.prototype.getDimensionsInfo,tA.create=function(i,n){var o=[];return i.eachComponent("calendar",function(t){var e=new tA(t,i,n);o.push(e),t.coordinateSystem=e}),i.eachSeries(function(t){"calendar"===t.get("coordinateSystem")&&(t.coordinateSystem=o[t.get("calendarIndex")||0])}),o},lh.register("calendar",tA);var iA=ku.extend({type:"calendar",coordinateSystem:null,defaultOption:{zlevel:0,z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",nameMap:"en",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",nameMap:"en",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},init:function(t,e,i,n){var o=Iu(t);iA.superApply(this,"init",arguments),nA(t,o)},mergeOption:function(t,e){iA.superApply(this,"mergeOption",arguments),nA(this.option,t)}});function nA(t,e){var i=t.cellSize;L(i)?1===i.length&&(i[1]=i[0]):i=t.cellSize=[i,i];var n=O([0,1],function(t){return function(t,e){return null!=t[xu[e][0]]||null!=t[xu[e][1]]&&null!=t[xu[e][2]]}(e,t)&&(i[t]="auto"),null!=i[t]&&"auto"!==i[t]});Mu(t,e,{type:"box",ignoreSize:n})}var oA={EN:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CN:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},aA={EN:["S","M","T","W","T","F","S"],CN:["日","一","二","三","四","五","六"]};Af({type:"calendar",_tlpoints:null,_blpoints:null,_firstDayOfMonth:null,_firstDayPoints:null,render:function(t,e,i){var n=this.group;n.removeAll();var o=t.coordinateSystem,a=o.getRangeInfo(),r=o.getOrient();this._renderDayRect(t,a,n),this._renderLines(t,a,r,n),this._renderYearText(t,a,r,n),this._renderMonthText(t,r,n),this._renderWeekText(t,a,r,n)},_renderDayRect:function(t,e,i){for(var n=t.coordinateSystem,o=t.getModel("itemStyle").getItemStyle(),a=n.getCellWidth(),r=n.getCellHeight(),s=e.start.time;s<=e.end.time;s=n.getNextNDay(s,1).time){var l=n.dataToRect([s],!1).tl,u=new rs({shape:{x:l[0],y:l[1],width:a,height:r},cursor:"default",style:o});i.add(u)}},_renderLines:function(i,t,n,o){var a=this,r=i.coordinateSystem,s=i.getModel("splitLine.lineStyle").getLineStyle(),l=i.get("splitLine.show"),e=s.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var u=t.start,h=0;u.time<=t.end.time;h++){d(u.formatedDate),0===h&&(u=r.getDateInfo(t.start.y+"-"+t.start.m));var c=u.date;c.setMonth(c.getMonth()+1),u=r.getDateInfo(c)}function d(t){a._firstDayOfMonth.push(r.getDateInfo(t)),a._firstDayPoints.push(r.dataToRect([t],!1).tl);var e=a._getLinePointsOfOneWeek(i,t,n);a._tlpoints.push(e[0]),a._blpoints.push(e[e.length-1]),l&&a._drawSplitline(e,s,o)}d(r.getNextNDay(t.end.time,1).formatedDate),l&&this._drawSplitline(a._getEdgesPoints(a._tlpoints,e,n),s,o),l&&this._drawSplitline(a._getEdgesPoints(a._blpoints,e,n),s,o)},_getEdgesPoints:function(t,e,i){var n=[t[0].slice(),t[t.length-1].slice()],o="horizontal"===i?0:1;return n[0][o]=n[0][o]-e/2,n[1][o]=n[1][o]+e/2,n},_drawSplitline:function(t,e,i){var n=new ts({z2:20,shape:{points:t},style:e});i.add(n)},_getLinePointsOfOneWeek:function(t,e,i){var n=t.coordinateSystem;e=n.getDateInfo(e);for(var o=[],a=0;a<7;a++){var r=n.getNextNDay(e.time,a),s=n.dataToRect([r.time],!1);o[2*r.day]=s.tl,o[2*r.day+1]=s["horizontal"===i?"bl":"tr"]}return o},_formatterLabel:function(t,e){return"string"==typeof t&&t?uu(t,e):"function"==typeof t?t(e):e.nameMap},_yearTextPositionControl:function(t,e,i,n,o){e=e.slice();var a=["center","bottom"];"bottom"===n?(e[1]+=o,a=["center","top"]):"left"===n?e[0]-=o:"right"===n?(e[0]+=o,a=["center","top"]):e[1]-=o;var r=0;return"left"!==n&&"right"!==n||(r=Math.PI/2),{rotation:r,position:e,style:{textAlign:a[0],textVerticalAlign:a[1]}}},_renderYearText:function(t,e,i,n){var o=t.getModel("yearLabel");if(o.get("show")){var a=o.get("margin"),r=o.get("position");r=r||("horizontal"!==i?"top":"left");var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],l=(s[0][0]+s[1][0])/2,u=(s[0][1]+s[1][1])/2,h="horizontal"===i?0:1,c={top:[l,s[h][1]],bottom:[l,s[1-h][1]],left:[s[1-h][0],u],right:[s[h][0],u]},d=e.start.y;+e.end.y>+e.start.y&&(d=d+"-"+e.end.y);var f=o.get("formatter"),p={start:e.start.y,end:e.end.y,nameMap:d},g=this._formatterLabel(f,p),m=new Ur({z2:30});nl(m.style,o,{text:g}),m.attr(this._yearTextPositionControl(m,c[r],i,r,a)),n.add(m)}},_monthTextPositionControl:function(t,e,i,n,o){var a="left",r="top",s=t[0],l=t[1];return"horizontal"===i?(l+=o,e&&(a="center"),"start"===n&&(r="bottom")):(s+=o,e&&(r="middle"),"start"===n&&(a="right")),{x:s,y:l,textAlign:a,textVerticalAlign:r}},_renderMonthText:function(t,e,i){var n=t.getModel("monthLabel");if(n.get("show")){var o=n.get("nameMap"),a=n.get("margin"),r=n.get("position"),s=n.get("align"),l=[this._tlpoints,this._blpoints];E(o)&&(o=oA[o.toUpperCase()]||[]);var u="start"===r?0:1,h="horizontal"===e?0:1;a="start"===r?-a:a;for(var c="center"===s,d=0;dd.getHeight()&&(i.textPosition="top",a=!0);var r=a?-5-n.height:p+8;o+n.width/2>d.getWidth()?(i.textPosition=["100%",r],i.textAlign="right"):o-n.width/2<0&&(i.textPosition=[0,r],i.textAlign="left")}})}function t(t,e){var i,n=m[t],o=m[e],a=u[n],r=new Cl(a,h,h.ecModel);if(l&&null!=l.newTitle&&l.featureName===n&&(a.title=l.newTitle),n&&!o){if(function(t){return 0===t.indexOf("my")}(n))i={model:r,onclick:r.option.onclick,featureName:n};else{var s=fA(n);if(!s)return;i=new s(r,c,d)}g[n]=i}else{if(!(i=g[o]))return;i.model=r,i.ecModel=c,i.api=d}n||!o?r.get("show")&&!i.unusable?(function(o,a,t){var r=o.getModel("iconStyle"),s=o.getModel("emphasis.iconStyle"),e=a.getIcons?a.getIcons():o.get("icon"),l=o.get("title")||{};if("string"==typeof e){var i=e,n=l;l={},(e={})[t]=i,l[t]=n}var u=o.iconPaths={};R(e,function(t,e){var i=yl(t,{},{x:-p/2,y:-p/2,width:p,height:p});i.setStyle(r.getItemStyle()),i.hoverStyle=s.getItemStyle(),i.setStyle({text:l[e],textAlign:s.get("textAlign"),textBorderRadius:s.get("textBorderRadius"),textPadding:s.get("textPadding"),textFill:null});var n=h.getModel("tooltip");n&&n.get("show")&&i.attr("tooltip",P({content:l[e],formatter:n.get("formatter",!0)||function(){return l[e]},formatterParams:{componentType:"toolbox",name:e,title:l[e],$vars:["name","title"]},position:n.get("position",!0)||"bottom"},n.option)),$s(i),h.get("showTitle")&&(i.__title=l[e],i.on("mouseover",function(){var t=s.getItemStyle(),e="vertical"===h.get("orient")?null==h.get("right")?"right":"left":null==h.get("bottom")?"bottom":"top";i.setStyle({textFill:s.get("textFill")||t.fill||t.stroke||"#000",textBackgroundColor:s.get("textBackgroundColor"),textPosition:s.get("textPosition")||e})}).on("mouseout",function(){i.setStyle({textFill:null,textBackgroundColor:null})})),i.trigger(o.get("iconStatus."+e)||"normal"),f.add(i),i.on("click",A(a.onclick,a,c,d,e)),u[e]=i})}(r,i,n),r.setIconStatus=function(t,e){var i=this.option,n=this.iconPaths;i.iconStatus=i.iconStatus||{},i.iconStatus[t]=e,n[t]&&n[t].trigger(e)},i.render&&i.render(r,c,d,l)):i.remove&&i.remove(c,d):i.dispose&&i.dispose(c,d)}},updateView:function(t,e,i,n){R(this._features,function(t){t.updateView&&t.updateView(t.model,e,i,n)})},remove:function(e,i){R(this._features,function(t){t.remove&&t.remove(e,i)}),this.group.removeAll()},dispose:function(e,i){R(this._features,function(t){t.dispose&&t.dispose(e,i)})}});var mA=Oc.toolbox.saveAsImage;function vA(t){this.model=t}vA.defaultOption={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:mA.title,type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:mA.lang.slice()},vA.prototype.unusable=!v.canvasSupported,vA.prototype.onclick=function(t,e){var i=this.model,n=i.get("name")||t.get("title.0.text")||"echarts",o="svg"===e.getZr().painter.getType()?"svg":i.get("type",!0)||"png",a=e.getConnectedDataURL({type:o,backgroundColor:i.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")});if("function"!=typeof MouseEvent||v.browser.ie||v.browser.edge)if(window.navigator.msSaveOrOpenBlob){for(var r=atob(a.split(",")[1]),s=r.length,l=new Uint8Array(s);s--;)l[s]=r.charCodeAt(s);var u=new Blob([l]);window.navigator.msSaveOrOpenBlob(u,n+"."+o)}else{var h=i.get("lang"),c='';window.open().document.write(c)}else{var d=document.createElement("a");d.download=n+"."+o,d.target="_blank",d.href=a;var f=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});d.dispatchEvent(f)}},dA("saveAsImage",vA);var yA=Oc.toolbox.magicType,xA="__ec_magicType_stack__";function _A(t){this.model=t}_A.defaultOption={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:k(yA.title),option:{},seriesIndex:{}};var wA=_A.prototype;wA.getIcons=function(){var t=this.model,e=t.get("icon"),i={};return R(t.get("type"),function(t){e[t]&&(i[t]=e[t])}),i};var bA={line:function(t,e,i,n){if("bar"===t)return m({id:e,type:"line",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},n.get("option.line")||{},!0)},bar:function(t,e,i,n){if("line"===t)return m({id:e,type:"bar",data:i.get("data"),stack:i.get("stack"),markPoint:i.get("markPoint"),markLine:i.get("markLine")},n.get("option.bar")||{},!0)},stack:function(t,e,i,n){var o=i.get("stack")===xA;if("line"===t||"bar"===t)return n.setIconStatus("stack",o?"normal":"emphasis"),m({id:e,stack:o?"":xA},n.get("option.stack")||{},!0)}},SA=[["line","bar"],["stack"]];wA.onclick=function(u,t,h){var c=this.model,e=c.get("seriesIndex."+h);if(bA[h]){var i,d={series:[]};if(R(SA,function(t){0<=_(t,h)&&R(t,function(t){c.setIconStatus(t,"normal")})}),c.setIconStatus(h,"emphasis"),u.eachComponent({mainType:"series",query:null==e?null:{seriesIndex:e}},function(t){var e=t.subType,i=t.id,n=bA[h](e,i,t,c);n&&(D(n,t.option),d.series.push(n));var o=t.coordinateSystem;if(o&&"cartesian2d"===o.type&&("line"===h||"bar"===h)){var a=o.getAxesByScale("ordinal")[0];if(a){var r=a.dim+"Axis",s=u.queryComponents({mainType:r,index:t.get(name+"Index"),id:t.get(name+"Id")})[0].componentIndex;d[r]=d[r]||[];for(var l=0;l<=s;l++)d[r][s]=d[r][s]||{};d[r][s].boundaryGap="bar"===h}}}),"stack"===h)i=d.series&&d.series[0]&&d.series[0].stack===xA?m({stack:yA.title.tiled},yA.title):k(yA.title);t.dispatchAction({type:"changeMagicType",currentType:h,newOption:d,newTitle:i,featureName:"magicType"})}},_f({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(t,e){e.mergeOption(t.newOption)}),dA("magicType",_A);var MA=Oc.toolbox.dataView,IA=new Array(60).join("-"),TA="\t";function AA(t){var e=function(t){var o={},a=[],r=[];return t.eachRawSeries(function(t){var e=t.coordinateSystem;if(!e||"cartesian2d"!==e.type&&"polar"!==e.type)a.push(t);else{var i=e.getBaseAxis();if("category"===i.type){var n=i.dim+"_"+i.index;o[n]||(o[n]={categoryAxis:i,valueAxis:e.getOtherAxis(i),series:[]},r.push({axisDim:i.dim,axisIndex:i.index})),o[n].series.push(t)}else a.push(t)}}),{seriesGroupByCategoryAxis:o,other:a,meta:r}}(t);return{value:M([function(t){var h=[];return R(t,function(t,e){var i=t.categoryAxis,n=t.valueAxis.dim,o=[" "].concat(O(t.series,function(t){return t.name})),a=[i.model.getCategories()];R(t.series,function(t){var e=t.getRawData();a.push(t.getRawData().mapArray(e.mapDimension(n),function(t){return t}))});for(var r=[o.join(TA)],s=0;st[1]&&t.reverse(),t}function GA(t,e){return Ko(t,e,{includeMainTypes:EA})}BA.setOutputRanges=function(t,e){this.matchOutputRanges(t,e,function(t,e,i){if((t.coordRanges||(t.coordRanges=[])).push(e),!t.coordRange){t.coordRange=e;var n=ZA[t.brushType](0,i,e);t.__rangeOffset={offset:XA[t.brushType](n.values,t.range,[1,1]),xyMinMax:n.xyMinMax}}})},BA.matchOutputRanges=function(t,n,o){PA(t,function(i){var t=this.findTargetInfo(i,n);t&&!0!==t&&R(t.coordSyses,function(t){var e=ZA[i.brushType](1,t,i.range);o(i,e.values,t,n)})},this)},BA.setInputRanges=function(t,o){PA(t,function(t){var e=this.findTargetInfo(t,o);if(t.range=t.range||[],e&&!0!==e){t.panelId=e.panelId;var i=ZA[t.brushType](0,e.coordSys,t.coordRange),n=t.__rangeOffset;t.range=n?XA[t.brushType](i.values,n.offset,function(t,e){var i=jA(t),n=jA(e),o=[i[0]/n[0],i[1]/n[1]];return isNaN(o[0])&&(o[0]=1),isNaN(o[1])&&(o[1]=1),o}(i.xyMinMax,n.xyMinMax)):i.values}},this)},BA.makePanelOpts=function(i,n){return O(this._targetInfoList,function(t){var e=t.getPanelRect();return{panelId:t.panelId,defaultBrushType:n&&n(t),clipPath:hS(e),isTargetByCursor:dS(e,i,t.coordSysModel),getLinearBrushOtherExtent:cS(e)}})},BA.controlSeries=function(t,e,i){var n=this.findTargetInfo(t,i);return!0===n||n&&0<=NA(n.coordSyses,e.coordinateSystem)},BA.findTargetInfo=function(t,e){for(var i=this._targetInfoList,n=GA(e,t),o=0;on[1]&&(n[1]=e[1])})}),n[1]c[1];if(r&&!s&&!l)return!0;r&&(n=!0),s&&(e=!0),l&&(i=!0)}return n&&e&&i}):rD(h,function(t){if("empty"===o)i.setData(u=u.map(t,function(t){return function(t){return t>=c[0]&&t<=c[1]}(t)?t:NaN}));else{var e={};e[t]=c,u.selectRange(e)}}),rD(h,function(t){u.setApproximateExtent(c,t)}))})}}};var uD=R,hD=nD,cD=Tf({type:"dataZoom",dependencies:["xAxis","yAxis","zAxis","radiusAxis","angleAxis","singleAxis","series"],defaultOption:{zlevel:0,z:4,orient:null,xAxisIndex:null,yAxisIndex:null,filterMode:"filter",throttle:null,start:0,end:100,startValue:null,endValue:null,minSpan:null,maxSpan:null,minValueSpan:null,maxValueSpan:null,rangeMode:null},init:function(t,e,i){this._dataIntervalByAxis={},this._dataInfo={},this._axisProxies={},this.textStyleModel,this._autoThrottle=!0,this._rangePropMode=["percent","percent"];var n=dD(t);this.settledOption=n,this.mergeDefaultAndTheme(t,i),this.doInit(n)},mergeOption:function(t){var e=dD(t);m(this.option,t,!0),m(this.settledOption,e,!0),this.doInit(e)},doInit:function(t){var i=this.option;v.canvasSupported||(i.realtime=!1),this._setDefaultThrottle(t),fD(this,t);var n=this.settledOption;uD([["start","startValue"],["end","endValue"]],function(t,e){"value"===this._rangePropMode[e]&&(i[t[0]]=n[t[0]]=null)},this),this.textStyleModel=this.getModel("textStyle"),this._resetTarget(),this._giveAxisProxies()},_giveAxisProxies:function(){var r=this._axisProxies;this.eachTargetAxis(function(t,e,i,n){var o=this.dependentModels[t.axis][e],a=o.__dzAxisProxy||(o.__dzAxisProxy=new aD(t.name,e,this,n));r[t.name+"_"+e]=a},this)},_resetTarget:function(){var i=this.option,t=this._judgeAutoMode();hD(function(t){var e=t.axisIndex;i[e]=Vo(i[e])},this),"axisIndex"===t?this._autoSetAxisIndex():"orient"===t&&this._autoSetOrient()},_judgeAutoMode:function(){var e=this.option,i=!1;hD(function(t){null!=e[t.axisIndex]&&(i=!0)},this);var t=e.orient;return null==t&&i?"orient":i?void 0:(null==t&&(e.orient="horizontal"),"axisIndex")},_autoSetAxisIndex:function(){var a=!0,e=this.get("orient",!0),r=this.option,t=this.dependentModels;if(a){var i="vertical"===e?"y":"x";t[i+"Axis"].length?(r[i+"AxisIndex"]=[0],a=!1):uD(t.singleAxis,function(t){a&&t.get("orient",!0)===e&&(r.singleAxisIndex=[t.componentIndex],a=!1)})}a&&hD(function(t){if(a){var e=[],i=this.dependentModels[t.axis];if(i.length&&!e.length)for(var n=0,o=i.length;ne[0][1]&&(e[0][1]=a[0]),a[1]e[1][1]&&(e[1][1]=a[1])}return e&&eC(e)}};function eC(t){return new Di(t[0][0],t[1][0],t[0][1]-t[0][0],t[1][1]-t[1][0])}var iC=["#ddd"];Tf({type:"brush",dependencies:["geo","grid","xAxis","yAxis","parallel","series"],defaultOption:{toolbox:null,brushLink:null,seriesIndex:"all",geoIndex:null,xAxisIndex:null,yAxisIndex:null,brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(120,140,180,0.3)",borderColor:"rgba(120,140,180,0.8)"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},areas:[],brushType:null,brushOption:{},coordInfoList:[],optionUpdated:function(t,e){var i=this.option;e||WD(i,t,["inBrush","outOfBrush"]);var n=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:iC},n.hasOwnProperty("liftZ")||(n.liftZ=5)},setAreas:function(t){t&&(this.areas=O(t,function(t){return nC(this.option,t)},this))},setBrushOption:function(t){this.brushOption=nC(this.option,t),this.brushType=this.brushOption.brushType}});function nC(t,e){return m({brushType:t.brushType,brushMode:t.brushMode,transformable:t.transformable,brushStyle:new Cl(t.brushStyle).getItemStyle(),removeOnClick:t.removeOnClick,z:t.z},e,!0)}function oC(t,e,i,n){n&&n.$from===t.id||this._brushController.setPanels(t.brushTargetManager.makePanelOpts(i)).enableBrush(t.brushOption).updateCovers(t.areas.slice())}Af({type:"brush",init:function(t,e){this.ecModel=t,this.api=e,this.model,(this._brushController=new Ob(e.getZr())).on("brush",A(this._onBrush,this)).mount()},render:function(t){return this.model=t,oC.apply(this,arguments)},updateTransform:function(t,e){return KD(e),oC.apply(this,arguments)},updateView:oC,dispose:function(){this._brushController.dispose()},_onBrush:function(t,e){var i=this.model.id;this.model.brushTargetManager.setOutputRanges(t,this.ecModel),e.isEnd&&!e.removeOnClick||this.api.dispatchAction({type:"brush",brushId:i,areas:k(t),$from:i}),e.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:i,areas:k(t),$from:i})}}),_f({type:"brush",event:"brush"},function(e,t){t.eachComponent({mainType:"brush",query:e},function(t){t.setAreas(e.areas)})}),_f({type:"brushSelect",event:"brushSelected",update:"none"},function(){}),_f({type:"brushEnd",event:"brushEnd",update:"none"},function(){});var aC=Oc.toolbox.brush;function rC(t,e,i){this.model=t,this.ecModel=e,this.api=i,this._brushType,this._brushMode}rC.defaultOption={show:!0,type:["rect","polygon","lineX","lineY","keep","clear"],icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:k(aC.title)};var sC=rC.prototype;sC.render=sC.updateView=function(e,t,i){var n,o,a;t.eachComponent({mainType:"brush"},function(t){n=t.brushType,o=t.brushOption.brushMode||"single",a|=t.areas.length}),this._brushType=n,this._brushMode=o,R(e.get("type",!0),function(t){e.setIconStatus(t,("keep"===t?"multiple"===o:"clear"===t?a:t===n)?"emphasis":"normal")})},sC.getIcons=function(){var t=this.model,e=t.get("icon",!0),i={};return R(t.get("type",!0),function(t){e[t]&&(i[t]=e[t])}),i},sC.onclick=function(t,e,i){var n=this._brushType,o=this._brushMode;"clear"===i?(e.dispatchAction({type:"axisAreaSelect",intervals:[]}),e.dispatchAction({type:"brush",command:"clear",areas:[]})):e.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:"keep"===i?n:n!==i&&i,brushMode:"keep"===i?"multiple"===o?"single":"multiple":o}})},dA("brush",rC),yf(function(t,e){var i=t&&t.brush;if(L(i)||(i=i?[i]:[]),i.length){var n=[];R(i,function(t){var e=t.hasOwnProperty("toolbox")?t.toolbox:[];e instanceof Array&&(n=n.concat(e))});var o=t&&t.toolbox;L(o)&&(o=o[0]),o||(o={feature:{}},t.toolbox=[o]);var a=o.feature||(o.feature={}),r=a.brush||(a.brush={}),s=r.type||(r.type=[]);s.push.apply(s,n),function(i){var e={};R(i,function(t){e[t]=1}),i.length=0,R(e,function(t,e){i.push(e)})}(s),e&&!s.length&&s.push.apply(s,BD)}}),Tf({type:"title",layoutMode:{type:"box",ignoreSize:!0},defaultOption:{zlevel:0,z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bolder",color:"#333"},subtextStyle:{color:"#aaa"}}}),Af({type:"title",render:function(t,e,i){if(this.group.removeAll(),t.get("show")){var n=this.group,o=t.getModel("textStyle"),a=t.getModel("subtextStyle"),r=t.get("textAlign"),s=H(t.get("textBaseline"),t.get("textVerticalAlign")),l=new Ur({style:nl({},o,{text:t.get("text"),textFill:o.getTextColor()},{disableBox:!0}),z2:10}),u=l.getBoundingRect(),h=t.get("subtext"),c=new Ur({style:nl({},a,{text:h,textFill:a.getTextColor(),y:u.height+t.get("itemGap"),textVerticalAlign:"top"},{disableBox:!0}),z2:10}),d=t.get("link"),f=t.get("sublink"),p=t.get("triggerEvent",!0);l.silent=!d&&!p,c.silent=!f&&!p,d&&l.on("click",function(){gu(d,"_"+t.get("target"))}),f&&c.on("click",function(){gu(f,"_"+t.get("subtarget"))}),l.eventData=c.eventData=p?{componentType:"title",componentIndex:t.componentIndex}:null,n.add(l),h&&n.add(c);var g=n.getBoundingRect(),m=t.getBoxLayoutParams();m.width=g.width,m.height=g.height;var v=bu(m,{width:i.getWidth(),height:i.getHeight()},t.get("padding"));r||("middle"===(r=t.get("left")||t.get("right"))&&(r="center"),"right"===r?v.x+=v.width:"center"===r&&(v.x+=v.width/2)),s||("center"===(s=t.get("top")||t.get("bottom"))&&(s="middle"),"bottom"===s?v.y+=v.height:"middle"===s&&(v.y+=v.height/2),s=s||"top"),n.attr("position",[v.x,v.y]);var y={textAlign:r,textVerticalAlign:s};l.setStyle(y),c.setStyle(y),g=n.getBoundingRect();var x=v.margin,_=t.getItemStyle(["color","opacity"]);_.fill=t.get("backgroundColor");var w=new rs({shape:{x:g.x-x[3],y:g.y-x[0],width:g.width+x[1]+x[3],height:g.height+x[0]+x[2],r:t.get("borderRadius")},style:_,subPixelOptimize:!0,silent:!0});n.add(w)}}});function lC(t){var e=t.itemStyle||(t.itemStyle={}),i=e.emphasis||(e.emphasis={}),n=t.label||t.label||{},o=n.normal||(n.normal={}),a={normal:1,emphasis:1};R(n,function(t,e){a[e]||uC(o,e)||(o[e]=t)}),i.label&&!uC(n,"emphasis")&&(n.emphasis=i.label,delete i.label)}function uC(t,e){return t.hasOwnProperty(e)}ku.registerSubTypeDefaulter("timeline",function(){return"slider"}),_f({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},function(t,e){var i=e.getComponent("timeline");return i&&null!=t.currentIndex&&(i.setCurrentIndex(t.currentIndex),!i.get("loop",!0)&&i.isIndexMax()&&i.setPlayState(!1)),e.resetOption("timeline"),D({currentIndex:i.option.currentIndex},t)}),_f({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},function(t,e){var i=e.getComponent("timeline");i&&null!=t.playState&&i.setPlayState(t.playState)});var hC=ku.extend({type:"timeline",layoutMode:"box",defaultOption:{zlevel:0,z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},init:function(t,e,i){this._data,this._names,this.mergeDefaultAndTheme(t,i),this._initData()},mergeOption:function(t){hC.superApply(this,"mergeOption",arguments),this._initData()},setCurrentIndex:function(t){null==t&&(t=this.option.currentIndex);var e=this._data.count();this.option.loop?t=(t%e+e)%e:(e<=t&&(t=e-1),t<0&&(t=0)),this.option.currentIndex=t},getCurrentIndex:function(){return this.option.currentIndex},isIndexMax:function(){return this.getCurrentIndex()>=this._data.count()-1},setPlayState:function(t){this.option.autoPlay=!!t},getPlayState:function(){return!!this.option.autoPlay},_initData:function(){var t=this.option,e=t.data||[],i=t.axisType,o=this._names=[];if("category"===i){var a=[];R(e,function(t,e){var i,n=Wo(t);z(t)?(i=k(t)).value=e:i=e,a.push(i),E(n)||null!=n&&!isNaN(n)||(n=""),o.push(n+"")}),e=a}var n={category:"ordinal",time:"time"}[i]||"number";(this._data=new Yf([{name:"value",type:n}],this)).initData(e,o)},getData:function(){return this._data},getCategories:function(){if("category"===this.get("axisType"))return this._names.slice()}});b(hC.extend({type:"timeline.slider",defaultOption:{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"emptyCircle",symbolSize:10,lineStyle:{show:!0,width:2,color:"#304654"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#304654"},itemStyle:{color:"#304654",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:13,color:"#c23531",borderWidth:5,borderColor:"rgba(194,53,49, 0.5)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:22,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"path://M18.6,50.8l22.5-22.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3-0.1-0.5-0.3-0.7L18.7,4.4c-0.1-0.1-0.2-0.3-0.2-0.5 c0-0.4,0.3-0.8,0.8-0.8c0.2,0,0.5,0.1,0.6,0.3l23.5,23.5l0,0c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-0.1,0.1L19.7,52 c-0.1,0.1-0.3,0.2-0.5,0.2c-0.4,0-0.8-0.3-0.8-0.8C18.4,51.2,18.5,51,18.6,50.8z",prevIcon:"path://M43,52.8L20.4,30.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.5,0.3-0.7L42.9,6.4c0.1-0.1,0.2-0.3,0.2-0.5 c0-0.4-0.3-0.8-0.8-0.8c-0.2,0-0.5,0.1-0.6,0.3L18.3,28.8l0,0c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l0.1,0.1L41.9,54 c0.1,0.1,0.3,0.2,0.5,0.2c0.4,0,0.8-0.3,0.8-0.8C43.2,53.2,43.1,53,43,52.8z",color:"#304654",borderColor:"#304654",borderWidth:1},emphasis:{label:{show:!0,color:"#c23531"},itemStyle:{color:"#c23531"},controlStyle:{color:"#c23531",borderColor:"#c23531",borderWidth:2}},data:[]}}),Xh);function cC(t,e,i,n){Gg.call(this,t,e,i),this.type=n||"value",this.model=null}var dC=gc.extend({type:"timeline"});cC.prototype={constructor:cC,getLabelModel:function(){return this.model.getModel("label")},isHorizontal:function(){return"horizontal"===this.model.get("orient")}},w(cC,Gg);var fC=A,pC=R,gC=Math.PI;function mC(t,e,i,n,o,a){var r=e.get("color");o?(o.setColor(r),i.add(o),a&&a.onUpdate(o)):((o=wg(t.get("symbol"),-1,-1,2,2,r)).setStyle("strokeNoScale",!0),i.add(o),a&&a.onCreate(o));var s=e.getItemStyle(["color","symbol","symbolSize"]);o.setStyle(s),n=m({rectHover:!0,z2:100},n,!0);var l=t.get("symbolSize");(l=l instanceof Array?l.slice():[+l,+l])[0]/=2,l[1]/=2,n.scale=l;var u=t.get("symbolOffset");if(u){var h=n.position=n.position||[0,0];h[0]+=El(u[0],l[0]),h[1]+=El(u[1],l[1])}var c=t.get("symbolRotate");return n.rotation=(c||0)*Math.PI/180||0,o.attr(n),o.updateTransform(),o}function vC(t,e,i,n,o){if(!t.dragging){var a=n.getModel("checkpointStyle"),r=i.dataToCoord(n.getData().get(["value"],e));o||!a.get("animation",!0)?t.attr({position:[r,0]}):(t.stopAnimation(!0),t.animateTo({position:[r,0]},a.get("animationDuration",!0),a.get("animationEasing",!0)))}}dC.extend({type:"timeline.slider",init:function(t,e){this.api=e,this._axis,this._viewRect,this._timer,this._currentPointer,this._mainGroup,this._labelGroup},render:function(e,t,i,n){if(this.model=e,this.api=i,this.ecModel=t,this.group.removeAll(),e.get("show",!0)){var o=this._layout(e,i),a=this._createGroup("mainGroup"),r=this._createGroup("labelGroup"),s=this._axis=this._createAxis(o,e);e.formatTooltip=function(t){return au(s.scale.getLabel(t))},pC(["AxisLine","AxisTick","Control","CurrentPointer"],function(t){this["_render"+t](o,a,s,e)},this),this._renderAxisLabel(o,r,s,e),this._position(o,e)}this._doPlayStop()},remove:function(){this._clearTimer(),this.group.removeAll()},dispose:function(){this._clearTimer()},_layout:function(t,e){var i=t.get("label.position"),n=t.get("orient"),o=function(t,e){return bu(t.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()},t.get("padding"))}(t,e);null==i||"auto"===i?i="horizontal"===n?o.y+o.height/2n[1]&&(i=n[1]),i":"\n"),s&&(l+=xC(s),null!=a&&(l+=" : ")),null!=a&&(l+=xC(r)),l},getData:function(){return this._data},setData:function(t){this._data=t}});b(wC,Xh),wC.extend({type:"markPoint",defaultOption:{zlevel:0,z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}}});var bC=_;function SC(t,e,i,n,o,a){var r=[],s=fp(e,n)?e.getCalculationInfo("stackResultDimension"):n,l=LC(e,s,t),u=e.indicesOfNearest(s,l)[0];r[o]=e.get(i,u),r[a]=e.get(s,u);var h=e.get(n,u),c=Vl(e.get(n,u));return 0<=(c=Math.min(c,20))&&(r[a]=+r[a].toFixed(c)),[r,h]}var MC=T,IC={min:MC(SC,"min"),max:MC(SC,"max"),average:MC(SC,"average")};function TC(t,e){var i=t.getData(),n=t.coordinateSystem;if(e&&!function(t){return!isNaN(parseFloat(t.x))&&!isNaN(parseFloat(t.y))}(e)&&!L(e.coord)&&n){var o=n.dimensions,a=AC(e,i,n,t);if((e=k(e)).type&&IC[e.type]&&a.baseAxis&&a.valueAxis){var r=bC(o,a.baseAxis.dim),s=bC(o,a.valueAxis.dim),l=IC[e.type](i,a.baseDataDim,a.valueDataDim,r,s);e.coord=l[0],e.value=l[1]}else{for(var u=[null!=e.xAxis?e.xAxis:e.radiusAxis,null!=e.yAxis?e.yAxis:e.angleAxis],h=0;h<2;h++)IC[u[h]]&&(u[h]=LC(i,i.mapDimension(o[h]),u[h]));e.coord=u}}return e}function AC(t,e,i,n){var o={};return null!=t.valueIndex||null!=t.valueDim?(o.valueDataDim=null!=t.valueIndex?e.getDimension(t.valueIndex):t.valueDim,o.valueAxis=i.getAxis(function(t,e){var i=t.getData(),n=i.dimensions;e=i.getDimension(e);for(var o=0;oi[o],f=[-h.x,-h.y];e||(f[n]=s.position[n]);var p=[0,0],g=[-c.x,-c.y],m=H(t.get("pageButtonGap",!0),t.get("itemGap",!0));d&&("end"===t.get("pageButtonPosition",!0)?g[n]+=i[o]-c[o]:p[n]+=c[o]+m);g[1-n]+=h[a]/2-c[a]/2,s.attr("position",f),l.attr("position",p),u.attr("position",g);var v={x:0,y:0};if(v[o]=d?i[o]:h[o],v[a]=Math.max(h[a],c[a]),v[r]=Math.min(0,c[r]+g[1-n]),l.__rectSize=i[o],d){var y={x:0,y:0};y[o]=Math.max(i[o]-c[o]-m,0),y[a]=v[a],l.setClipPath(new rs({shape:y})),l.__rectSize=y[o]}else u.eachChild(function(t){t.attr({invisible:!0,silent:!0})});var x=this._getPageInfo(t);return null!=x.pageIndex&&cl(s,{position:x.contentPosition},d&&t),this._updatePageInfoView(t,x),v},_pageGo:function(t,e,i){var n=this._getPageInfo(e)[t];null!=n&&i.dispatchAction({type:"legendScroll",scrollDataIndex:n,legendId:e.id})},_updatePageInfoView:function(n,o){var a=this._controllerGroup;R(["pagePrev","pageNext"],function(t){var e=null!=o[t+"DataIndex"],i=a.childOfName(t);i&&(i.setStyle("fill",e?n.get("pageIconColor",!0):n.get("pageIconInactiveColor",!0)),i.cursor=e?"pointer":"default")});var t=a.childOfName("pageText"),e=n.get("pageFormatter"),i=o.pageIndex,r=null!=i?i+1:0,s=o.pageCount;t&&e&&t.setStyle("text",E(e)?e.replace("{current}",r).replace("{total}",s):e({current:r,total:s}))},_getPageInfo:function(t){var e=t.get("scrollDataIndex",!0),i=this.getContentGroup(),n=this._containerGroup.__rectSize,o=t.getOrient().index,a=aL[o],r=rL[o],s=this._findTargetItemIndex(e),l=i.children(),u=l[s],h=l.length,c=h?1:0,d={contentPosition:i.position.slice(),pageCount:c,pageIndex:c-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!u)return d;var f=y(u);d.contentPosition[o]=-f.s;for(var p=s+1,g=f,m=f,v=null;p<=h;++p)(!(v=y(l[p]))&&m.e>g.s+n||v&&!x(v,g.s))&&(g=m.i>g.i?m:v)&&(null==d.pageNextDataIndex&&(d.pageNextDataIndex=g.i),++d.pageCount),m=v;for(p=s-1,g=f,m=f,v=null;-1<=p;--p)(v=y(l[p]))&&x(m,v.s)||!(g.i=e&&t.s<=e+n}},_findTargetItemIndex:function(n){return this._showController?(this.getContentGroup().eachChild(function(t,e){var i=t.__legendDataIndex;null==a&&null!=i&&(a=e),i===n&&(o=e)}),null!=o?o:a):0;var o,a}});_f("legendScroll","legendscroll",function(t,e){var i=t.scrollDataIndex;null!=i&&e.eachComponent({mainType:"legend",subType:"scroll",query:t},function(t){t.setScrollDataIndex(i)})});cD.extend({type:"dataZoom.slider",layoutMode:"box",defaultOption:{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#2f4554",width:.5,opacity:.3},areaStyle:{color:"rgba(47,69,84,0.3)",opacity:.3}},borderColor:"#ddd",fillerColor:"rgba(167,183,204,0.4)",handleIcon:"M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z",handleSize:"100%",handleStyle:{color:"#a7b7cc"},labelPrecision:null,labelFormatter:null,showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#333"}}});var lL=rs,uL=Rl,hL=Bl,cL=A,dL=R,fL="horizontal",pL="vertical",gL=["line","bar","candlestick","scatter"],mL=pD.extend({type:"dataZoom.slider",init:function(t,e){this._displayables={},this._orient,this._range,this._handleEnds,this._size,this._handleWidth,this._handleHeight,this._location,this._dragging,this._dataShadowInfo,this.api=e},render:function(t,e,i,n){mL.superApply(this,"render",arguments),kc(this,"_dispatchZoomAction",this.dataZoomModel.get("throttle"),"fixRate"),this._orient=t.get("orient"),!1!==this.dataZoomModel.get("show")?(n&&"dataZoom"===n.type&&n.from===this.uid||this._buildView(),this._updateView()):this.group.removeAll()},remove:function(){mL.superApply(this,"remove",arguments),Pc(this,"_dispatchZoomAction")},dispose:function(){mL.superApply(this,"dispose",arguments),Pc(this,"_dispatchZoomAction")},_buildView:function(){var t=this.group;t.removeAll(),this._resetLocation(),this._resetInterval();var e=this._displayables.barGroup=new Ci;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(e),this._positionGroup()},_resetLocation:function(){var t=this.dataZoomModel,e=this.api,i=this._findCoordRect(),n={width:e.getWidth(),height:e.getHeight()},o=this._orient===fL?{right:n.width-i.x-i.width,top:n.height-30-7,width:i.width,height:30}:{right:7,top:i.y,width:30,height:i.height},a=Iu(t.option);R(["right","top","width","height"],function(t){"ph"===a[t]&&(a[t]=o[t])});var r=bu(a,n,t.padding);this._location={x:r.x,y:r.y},this._size=[r.width,r.height],this._orient===pL&&this._size.reverse()},_positionGroup:function(){var t=this.group,e=this._location,i=this._orient,n=this.dataZoomModel.getFirstTargetAxisModel(),o=n&&n.get("inverse"),a=this._displayables.barGroup,r=(this._dataShadowInfo||{}).otherAxisInverse;a.attr(i!==fL||o?i===fL&&o?{scale:r?[-1,1]:[-1,-1]}:i!==pL||o?{scale:r?[-1,-1]:[-1,1],rotation:Math.PI/2}:{scale:r?[1,-1]:[1,1],rotation:Math.PI/2}:{scale:r?[1,1]:[1,-1]});var s=t.getBoundingRect([a]);t.attr("position",[e.x-s.x,e.y-s.y])},_getViewExtent:function(){return[0,this._size[0]]},_renderBackground:function(){var t=this.dataZoomModel,e=this._size,i=this._displayables.barGroup;i.add(new lL({silent:!0,shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:t.get("backgroundColor")},z2:-40})),i.add(new lL({shape:{x:0,y:0,width:e[0],height:e[1]},style:{fill:"transparent"},z2:0,onclick:A(this._onClickPanelClick,this)}))},_renderDataShadow:function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(t){var e=this._size,i=t.series,n=i.getRawData(),o=i.getShadowDim?i.getShadowDim():t.otherDim;if(null!=o){var a=n.getDataExtent(o),r=.3*(a[1]-a[0]);a=[a[0]-r,a[1]+r];var s,l=[0,e[1]],u=[0,e[0]],h=[[e[0],0],[0,0]],c=[],d=u[1]/(n.count()-1),f=0,p=Math.round(n.count()/e[0]);n.each([o],function(t,e){if(0e[0]||i[1]<0||i[1]>e[1])){var n=this._handleEnds,o=(n[0]+n[1])/2,a=this._updateInterval("all",i[0]-o);this._updateView(),a&&this._dispatchZoomAction()}},_dispatchZoomAction:function(){var t=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,start:t[0],end:t[1]})},_findCoordRect:function(){var i;if(dL(this.getTargetCoordInfo(),function(t){if(!i&&t.length){var e=t[0].model.coordinateSystem;i=e.getRect&&e.getRect()}}),!i){var t=this.api.getWidth(),e=this.api.getHeight();i={x:.2*t,y:.2*e,width:.6*t,height:.6*e}}return i}});function vL(t){return"vertical"===t?"ns-resize":"ew-resize"}cD.extend({type:"dataZoom.inside",defaultOption:{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}});var yL="\0_ec_dataZoom_roams";function xL(t,n){var e=wL(t),o=n.dataZoomId,a=n.coordId;R(e,function(t,e){var i=t.dataZoomInfos;i[o]&&_(n.allCoordIds,a)<0&&(delete i[o],t.count--)}),bL(e);var i=e[a];i||((i=e[a]={coordId:a,dataZoomInfos:{},count:0}).controller=function(t,r){var e=new Vy(t.getZr());return R(["pan","zoom","scrollMove"],function(a){e.on(a,function(n){var o=[];R(r.dataZoomInfos,function(t){if(n.isAvailableBehavior(t.dataZoomModel.option)){var e=(t.getRange||{})[a],i=e&&e(r.controller,n);!t.dataZoomModel.get("disabled",!0)&&i&&o.push({dataZoomId:t.dataZoomId,start:i[0],end:i[1]})}}),o.length&&r.dispatchAction(o)})}),e}(t,i),i.dispatchAction=T(SL,t)),i.dataZoomInfos[o]||i.count++,i.dataZoomInfos[o]=n;var r=function(t){var n,o={type_true:2,type_move:1,type_false:0,type_undefined:-1},a=!0;return R(t,function(t){var e=t.dataZoomModel,i=!e.get("disabled",!0)&&(!e.get("zoomLock",!0)||"move");o["type_"+n]"],L(t)&&(t=t.slice(),n=!0),o=e?t:n?[u(t[0]),u(t[1])]:u(t),E(l)?l.replace("{value}",n?o[0]:o).replace("{value2}",n?o[1]:o):C(l)?n?l(t[0],t[1]):l(t):n?t[0]===s[0]?i[0]+" "+o[1]:t[1]===s[1]?i[1]+" "+o[0]:o[0]+" - "+o[1]:o;function u(t){return t===s[0]?"min":t===s[1]?"max":(+t).toFixed(Math.min(r,20))}},resetExtent:function(){var t=this.option,e=GL([t.min,t.max]);this._dataExtent=e},getDataDimension:function(t){var e=this.option.dimension,i=t.dimensions;if(null!=e||i.length){if(null!=e)return t.getDimension(e);for(var n=t.dimensions,o=n.length-1;0<=o;o--){var a=n[o];if(!t.getDimensionInfo(a).isCalculationCoord)return a}}},getExtent:function(){return this._dataExtent.slice()},completeVisualOption:function(){var t=this.ecModel,e=this.option,i={inRange:e.inRange,outOfRange:e.outOfRange},n=e.target||(e.target={}),o=e.controller||(e.controller={});m(n,i),m(o,i);var u=this.isCategory();function a(n){BL(e.color)&&!n.inRange&&(n.inRange={color:e.color.slice().reverse()}),n.inRange=n.inRange||{color:t.get("gradientColor")},VL(this.stateList,function(t){var e=n[t];if(E(e)){var i=OL(e,"active",u);i?(n[t]={},n[t][e]=i):delete n[t]}},this)}a.call(this,n),a.call(this,o),function(t,e,i){var n=t[e],o=t[i];n&&!o&&(o=t[i]={},VL(n,function(t,e){if(g_.isValidType(e)){var i=OL(e,"inactive",u);null!=i&&(o[e]=i,"color"!==e||o.hasOwnProperty("opacity")||o.hasOwnProperty("colorAlpha")||(o.opacity=[0,0]))}}))}.call(this,n,"inRange","outOfRange"),function(a){var r=(a.inRange||{}).symbol||(a.outOfRange||{}).symbol,s=(a.inRange||{}).symbolSize||(a.outOfRange||{}).symbolSize,l=this.get("inactiveColor");VL(this.stateList,function(t){var e=this.itemSize,i=a[t];null==(i=i||(a[t]={color:u?l:[l]})).symbol&&(i.symbol=r&&k(r)||(u?"roundRect":["roundRect"])),null==i.symbolSize&&(i.symbolSize=s&&k(s)||(u?e[0]:[e[0],e[0]])),i.symbol=EL(i.symbol,function(t){return"none"===t||"square"===t?"roundRect":t});var n=i.symbolSize;if(null!=n){var o=-1/0;zL(n,function(t){oe[1]&&e.reverse(),e[0]=Math.max(e[0],t[0]),e[1]=Math.min(e[1],t[1]))},completeVisualOption:function(){WL.prototype.completeVisualOption.apply(this,arguments),R(this.stateList,function(t){var e=this.option.controller[t].symbolSize;e&&e[0]!==e[1]&&(e[0]=0)},this)},setSelected:function(t){this.option.range=t.slice(),this._resetRange()},getSelected:function(){var t=this.getExtent(),e=Bl((this.get("range")||[]).slice());return e[0]>t[1]&&(e[0]=t[1]),e[1]>t[1]&&(e[1]=t[1]),e[0]=i[1]||t<=e[1])?"inRange":"outOfRange"},findTargetDataIndices:function(n){var o=[];return this.eachTargetSeries(function(t){var i=[],e=t.getData();e.each(this.getDataDimension(e),function(t,e){n[0]<=t&&t<=n[1]&&i.push(e)},this),o.push({seriesId:t.id,dataIndex:i})},this),o},getVisualMeta:function(i){var t=UL(this,"outOfRange",this.getExtent()),e=UL(this,"inRange",this.option.range.slice()),n=[];function o(t,e){n.push({value:t,color:i(t,e)})}for(var a=0,r=0,s=e.length,l=t.length;rt[1])break;i.push({color:this.getControllerVisual(a,"color",e),offset:o/100})}return i.push({color:this.getControllerVisual(t[1],"color",e),offset:1}),i},_createBarPoints:function(t,e){var i=this.visualMapModel.itemSize;return[[i[0]-e[0],t[0]],[i[0],t[0]],[i[0],t[1]],[i[0]-e[1],t[1]]]},_createBarGroup:function(t){var e=this._orient,i=this.visualMapModel.get("inverse");return new Ci("horizontal"!==e||i?"horizontal"===e&&i?{scale:"bottom"===t?[-1,1]:[1,1],rotation:-Math.PI/2}:"vertical"!==e||i?{scale:"left"===t?[1,1]:[-1,1]}:{scale:"left"===t?[1,-1]:[-1,-1]}:{scale:"bottom"===t?[1,1]:[-1,1],rotation:Math.PI/2})},_updateHandle:function(n,o){if(this._useHandle){var a=this._shapes,r=this.visualMapModel,s=a.handleThumbs,l=a.handleLabels;KL([0,1],function(t){var e=s[t];e.setStyle("fill",o.handlesColor[t]),e.position[1]=n[t];var i=pl(a.handleLabelPoints[t],fl(e,this.group));l[t].setStyle({x:i[0],y:i[1],text:r.formatValueText(this._dataInterval[t]),textVerticalAlign:"middle",textAlign:this._applyTransform("horizontal"===this._orient?0===t?"bottom":"top":"left",a.barGroup)})},this)}},_showIndicator:function(t,e,i,n){var o=this.visualMapModel,a=o.getExtent(),r=o.itemSize,s=[0,r[1]],l=qL(t,a,s,!0),u=this._shapes,h=u.indicator;if(h){h.position[1]=l,h.attr("invisible",!1),h.setShape("points",function(t,e,i,n){return t?[[0,-$L(e,JL(i,0))],[6,0],[0,$L(e,JL(n-i,0))]]:[[0,0],[5,-5],[5,5]]}(!!i,n,l,r[1]));var c=this.getControllerVisual(t,"color",{convertOpacityToAlpha:!0});h.setStyle("fill",c);var d=pl(u.indicatorLabelPoint,fl(h,this.group)),f=u.indicatorLabel;f.attr("invisible",!1);var p=this._applyTransform("left",u.barGroup),g=this._orient;f.setStyle({text:(i||"")+o.formatValueText(e),textVerticalAlign:"horizontal"===g?p:"middle",textAlign:"horizontal"===g?"center":p,x:d[0],y:d[1]})}},_enableHoverLinkToSeries:function(){var n=this;this._shapes.barGroup.on("mousemove",function(t){if(n._hovering=!0,!n._dragging){var e=n.visualMapModel.itemSize,i=n._applyTransform([t.offsetX,t.offsetY],n._shapes.barGroup,!0,!0);i[1]=$L(JL(0,i[1]),e[1]),n._doHoverLinkToSeries(i[1],0<=i[0]&&i[0]<=e[0])}}).on("mouseout",function(){n._hovering=!1,n._dragging||n._clearHoverLinkToSeries()})},_enableHoverLinkFromSeries:function(){var t=this.api.getZr();this.visualMapModel.option.hoverLink?(t.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),t.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},_doHoverLinkToSeries:function(t,e){var i=this.visualMapModel,n=i.itemSize;if(i.option.hoverLink){var o=[0,n[1]],a=i.getExtent();t=$L(JL(o[0],t),o[1]);var r=function(t,e,i){var n=6,o=t.get("hoverLinkDataSize");o&&(n=qL(o,e,i,!0)/2);return n}(i,a,o),s=[t-r,t+r],l=qL(t,o,a,!0),u=[qL(s[0],o,a,!0),qL(s[1],o,a,!0)];s[0] ",r):this._showIndicator(l,l,"≈ ",r));var h=this._hoverLinkDataIndices,c=[];(e||ek(i))&&(c=this._hoverLinkDataIndices=i.findTargetDataIndices(u));var d=function(t,e){var i={},n={};return o(t||[],i),o(e||[],n,i),[a(i),a(n)];function o(t,e,i){for(var n=0,o=t.length;ni&&n([i,e[0]],"outOfRange"),n(e.slice()),i=e[1])},this),{stops:a,outerColors:r}}function n(t,e){var i=s.getRepresentValue({interval:t});e=e||s.getValueState(i);var n=o(i,e);t[0]===-1/0?r[0]=n:t[1]===1/0?r[1]=n:a.push({value:t[0],color:n},{value:t[1],color:n})}}}),ok={splitNumber:function(){var t=this.option,e=this._pieceList,i=Math.min(t.precision,20),n=this.getExtent(),o=t.splitNumber;o=Math.max(parseInt(o,10),1),t.splitNumber=o;for(var a=(n[1]-n[0])/o;+a.toFixed(i)!==a&&i<5;)i++;t.precision=i,a=+a.toFixed(i),t.minOpen&&e.push({interval:[-1/0,n[0]],close:[0,0]});for(var r=0,s=n[0];r","≥"][e[0]]];t.text=t.text||this.formatValueText(null!=t.value?t.value:t.interval,!1,i)},this)}};function ak(t,e){var i=t.inverse;("vertical"===t.orient?!i:i)&&e.reverse()}XL.extend({type:"visualMap.piecewise",doRender:function(){var a=this.group;a.removeAll();var r=this.visualMapModel,s=r.get("textGap"),t=r.textStyleModel,l=t.getFont(),u=t.getTextColor(),h=this._getItemAlign(),c=r.itemSize,e=this._getViewData(),i=e.endsText,d=W(r.get("showLabel",!0),!i);i&&this._renderEndsText(a,i[0],c,d,h),R(e.viewPieceList,function(t){var e=t.piece,i=new Ci;i.onclick=A(this._onItemClick,this,e),this._enableHoverLink(i,t.indexInModelPieceList);var n=r.getRepresentValue(e);if(this._createItemSymbol(i,n,[0,0,c[0],c[1]]),d){var o=this.visualMapModel.getValueState(n);i.add(new Ur({style:{x:"right"===h?-s:c[0]+s,y:c[1]/2,text:e.text,textVerticalAlign:"middle",textAlign:h,textFont:l,textFill:u,opacity:"outOfRange"===o?.5:1}}))}a.add(i)},this),i&&this._renderEndsText(a,i[1],c,d,h),wu(r.get("orient"),a,r.get("itemGap")),this.renderBackground(a),this.positionGroup(a)},_enableHoverLink:function(t,i){function e(t){var e=this.visualMapModel;e.option.hoverLink&&this.api.dispatchAction({type:t,batch:jL(e.findTargetDataIndices(i),e)})}t.on("mouseover",A(e,this,"highlight")).on("mouseout",A(e,this,"downplay"))},_getItemAlign:function(){var t=this.visualMapModel,e=t.option;if("vertical"===e.orient)return YL(t,this.api,t.itemSize);var i=e.align;return i&&"auto"!==i||(i="left"),i},_renderEndsText:function(t,e,i,n,o){if(e){var a=new Ci,r=this.visualMapModel.textStyleModel;a.add(new Ur({style:{x:n?"right"===o?i[0]:0:i[0]/2,y:i[1]/2,textVerticalAlign:"middle",textAlign:n?o:"center",text:e,textFont:r.getFont(),textFill:r.getTextColor()}})),t.add(a)}},_getViewData:function(){var t=this.visualMapModel,e=O(t.getPieceList(),function(t,e){return{piece:t,indexInModelPieceList:e}}),i=t.get("text"),n=t.get("orient"),o=t.get("inverse");return("horizontal"===n?o:!o)?e.reverse():i=i&&i.slice().reverse(),{viewPieceList:e,endsText:i}},_createItemSymbol:function(t,e,i){t.add(wg(this.getControllerVisual(e,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(e,"color")))},_onItemClick:function(t){var e=this.visualMapModel,i=e.option,n=k(i.selected),o=e.getSelectedMapKey(t);"single"===i.selectedMode?(n[o]=!0,R(n,function(t,e){n[e]=e===o})):n[o]=!n[o],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:n})}});yf(DL);var rk,sk="urn:schemas-microsoft-com:vml",lk="undefined"==typeof window?null:window,uk=!1,hk=lk&&lk.document;function ck(t){return rk(t)}if(hk&&!v.canvasSupported)try{hk.namespaces.zrvml||hk.namespaces.add("zrvml",sk),rk=function(t){return hk.createElement("')}}catch(t){rk=function(t){return hk.createElement("<"+t+' xmlns="'+sk+'" class="zrvml">')}}var dk,fk=rr.CMD,pk=Math.round,gk=Math.sqrt,mk=Math.abs,vk=Math.cos,yk=Math.sin,xk=Math.max;if(!v.canvasSupported){var _k=",",wk="progid:DXImageTransform.Microsoft",bk=21600,Sk=bk/2,Mk=function(t){t.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",t.coordsize=bk+","+bk,t.coordorigin="0,0"},Ik=function(t,e,i){return"rgb("+[t,e,i].join(",")+")"},Tk=function(t,e){e&&t&&e.parentNode!==t&&t.appendChild(e)},Ak=function(t,e){e&&t&&e.parentNode===t&&t.removeChild(e)},Dk=function(t,e,i){return 1e5*(parseFloat(t)||0)+1e3*(parseFloat(e)||0)+i},Ck=Yn,Lk=function(t,e,i){var n=Fe(e);i=+i,isNaN(i)&&(i=1),n&&(t.color=Ik(n[0],n[1],n[2]),t.opacity=i*n[3])},kk=function(t,e,i,n){var o="fill"===e,a=t.getElementsByTagName(e)[0];null!=i[e]&&"none"!==i[e]&&(o||!o&&i.lineWidth)?(t[o?"filled":"stroked"]="true",i[e]instanceof cs&&Ak(t,a),a=a||ck(e),o?function(t,e,i){var n,o,a=e.fill;if(null!=a)if(a instanceof cs){var r,s=0,l=[0,0],u=0,h=1,c=i.getBoundingRect(),d=c.width,f=c.height;if("linear"===a.type){r="gradient";var p=i.transform,g=[a.x*d,a.y*f],m=[a.x2*d,a.y2*f];p&&(bt(g,g,p),bt(m,m,p));var v=m[0]-g[0],y=m[1]-g[1];(s=180*Math.atan2(v,y)/Math.PI)<0&&(s+=360),s<1e-6&&(s=0)}else{r="gradientradial";g=[a.x*d,a.y*f],p=i.transform;var x=i.scale,_=d,w=f;l=[(g[0]-c.x)/_,(g[1]-c.y)/w],p&&bt(g,g,p),_/=x[0]*bk,w/=x[1]*bk;var b=xk(_,w);u=0/b,h=2*a.r/b-u}var S=a.colorStops.slice();S.sort(function(t,e){return t.offset-e.offset});for(var M=S.length,I=[],T=[],A=0;A=c&&d<=i+1){for(var n=[],o=0;o=c&&d<=o+1)return _P(h,e.components,u,l);p[t]=e}else p[t]=void 0}var s;f++}for(;f<=e;){var r=a();if(r)return r}},pushComponent:function(t,e,i){var n=t[t.length-1];n&&n.added===e&&n.removed===i?t[t.length-1]={count:n.count+1,added:e,removed:i}:t.push({count:1,added:e,removed:i})},extractCommon:function(t,e,i,n){for(var o=e.length,a=i.length,r=t.newPos,s=r-n,l=0;r+1\n\r<"))}},R(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","pathToImage"],function(t){OP.prototype[t]=function(t){return function(){vi('In SVG mode painter not support method "'+t+'"')}}(t)}),Po("svg",OP),t.version="4.9.0",t.dependencies={zrender:"4.3.2"},t.PRIORITY=Ld,t.init=function(t,e,i){var n=mf(t);if(n)return n;var o=new Ed(t,e,i);return o.id="ec_"+cf++,uf[o.id]=o,Jo(t,ff,o.id),function(n){var o="__connectUpdateStatus";function a(t,e){for(var i=0;i