From c97ac0e9c68c45fef07d91fd1586819ab4549c84 Mon Sep 17 00:00:00 2001 From: Koy Zhuang Date: Tue, 2 Jul 2024 00:43:50 +0800 Subject: [PATCH] update: add options embedded --- .../echarts4j/option/ChartOption.java | 4 ++ .../echarts4j/option/chart/Polar.java | 19 +++++++++ .../echarts4j/option/chart/RadiusAxis.java | 39 +++++++++++++++++++ .../TextStyle.java} | 4 +- .../echarts4j/option/chart/XAxis.java | 14 +------ .../echarts4j/option/chart/YAxis.java | 14 +------ .../echarts4j/option/embedded/AreaStyle.java | 11 ++++++ .../echarts4j/option/embedded/ItemStyle.java | 11 ++++++ .../echarts4j/option/embedded/Label.java | 11 ++++++ .../echarts4j/option/embedded/LineStyle.java | 11 ++++++ .../option/embedded/NameTextStyle.java | 16 ++++++++ .../option/embedded/NameTruncate.java | 16 ++++++++ .../echarts4j/option/embedded/TextStyle.java | 15 +++++++ .../Tooltip.java} | 4 +- .../option/series/GenericSeriesOption.java | 8 ++-- .../option/series/embed/AreaStyle.java | 4 -- .../option/series/embed/ItemStyle.java | 4 -- .../echarts4j/option/series/embed/Label.java | 4 -- .../option/series/embed/LineStyle.java | 4 -- 19 files changed, 165 insertions(+), 48 deletions(-) create mode 100644 echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/chart/Polar.java create mode 100644 echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/chart/RadiusAxis.java rename echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/{series/embed/SeriesTextStyle.java => chart/TextStyle.java} (75%) create mode 100644 echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/AreaStyle.java create mode 100644 echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/ItemStyle.java create mode 100644 echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/Label.java create mode 100644 echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/LineStyle.java create mode 100644 echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/NameTextStyle.java create mode 100644 echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/NameTruncate.java create mode 100644 echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/TextStyle.java rename echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/{series/embed/SeriesTooltip.java => embedded/Tooltip.java} (79%) delete mode 100644 echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/embed/AreaStyle.java delete mode 100644 echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/embed/ItemStyle.java delete mode 100644 echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/embed/Label.java delete mode 100644 echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/embed/LineStyle.java diff --git a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/ChartOption.java b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/ChartOption.java index 0febd7a..a0f56d3 100644 --- a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/ChartOption.java +++ b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/ChartOption.java @@ -10,6 +10,7 @@ import com.github.koooooo7.echarts4j.option.chart.YAxis; import com.github.koooooo7.echarts4j.option.series.SeriesOption; import com.github.koooooo7.echarts4j.option.chart.Title; +import com.github.koooooo7.echarts4j.type.FuncStr; import lombok.Data; import lombok.experimental.SuperBuilder; @@ -32,6 +33,9 @@ public class ChartOption { private Toolbox toolbox; private Object color; private Boolean animation; + private Integer animationThreshold; + private FuncStr animationDuration; + private FuncStr animationDelay; private Boolean useUTC; private final List series = new ArrayList<>(); diff --git a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/chart/Polar.java b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/chart/Polar.java new file mode 100644 index 0000000..b62a09c --- /dev/null +++ b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/chart/Polar.java @@ -0,0 +1,19 @@ +package com.github.koooooo7.echarts4j.option.chart; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.github.koooooo7.echarts4j.type.FuncStr; +import lombok.Builder; +import lombok.Data; + +@Data +@Builder +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Polar { + private String id; + @JsonProperty("zlevel") + private Integer zLevel; + private Integer z; + private FuncStr center; + private Object radius; +} diff --git a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/chart/RadiusAxis.java b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/chart/RadiusAxis.java new file mode 100644 index 0000000..a522d8d --- /dev/null +++ b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/chart/RadiusAxis.java @@ -0,0 +1,39 @@ +package com.github.koooooo7.echarts4j.option.chart; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.github.koooooo7.echarts4j.option.embedded.NameTextStyle; +import com.github.koooooo7.echarts4j.option.embedded.NameTruncate; +import com.github.koooooo7.echarts4j.type.FuncStr; +import com.github.koooooo7.echarts4j.util.annotation.EmbedScope; +import lombok.Builder; +import lombok.Data; +import lombok.experimental.SuperBuilder; + +import java.util.List; + +@Data +@SuperBuilder +@JsonInclude(JsonInclude.Include.NON_NULL) +public class RadiusAxis { + private String id; + private Integer polarIndex; + private String type; + private String name; + private String nameLocation; + private List data; + private NameTextStyle nameTextStyle; + private NameTruncate nameTruncate; + private Boolean inverse; + private Object boundaryGap; + private FuncStr min; + private FuncStr max; + private Boolean scale; + private Integer splitNumber; + private Integer minInterval; + private Integer maxInterval; + private Integer interval; + private Integer logBase; + private Boolean silent; + private Boolean triggerEvent; + +} diff --git a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/embed/SeriesTextStyle.java b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/chart/TextStyle.java similarity index 75% rename from echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/embed/SeriesTextStyle.java rename to echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/chart/TextStyle.java index 8be49da..8eccc94 100644 --- a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/embed/SeriesTextStyle.java +++ b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/chart/TextStyle.java @@ -1,4 +1,4 @@ -package com.github.koooooo7.echarts4j.option.series.embed; +package com.github.koooooo7.echarts4j.option.chart; import com.fasterxml.jackson.annotation.JsonInclude; import lombok.Builder; @@ -7,7 +7,7 @@ @Data @Builder @JsonInclude(JsonInclude.Include.NON_NULL) -public class SeriesTextStyle { +public class TextStyle { private String color; private String fontStyle; private String fontWeight; diff --git a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/chart/XAxis.java b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/chart/XAxis.java index e962a0d..c1e8c17 100644 --- a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/chart/XAxis.java +++ b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/chart/XAxis.java @@ -1,6 +1,8 @@ package com.github.koooooo7.echarts4j.option.chart; import com.fasterxml.jackson.annotation.JsonInclude; +import com.github.koooooo7.echarts4j.option.embedded.NameTextStyle; +import com.github.koooooo7.echarts4j.option.embedded.NameTruncate; import com.github.koooooo7.echarts4j.type.FuncStr; import com.github.koooooo7.echarts4j.util.annotation.EmbedScope; import lombok.Builder; @@ -36,16 +38,4 @@ public class XAxis { private Boolean silent; private Boolean triggerEvent; - @Data - @Builder - @JsonInclude(JsonInclude.Include.NON_NULL) - @EmbedScope({XAxis.class, YAxis.class}) - public static class NameTextStyle { - } - - @Data - @Builder - @JsonInclude(JsonInclude.Include.NON_NULL) - public static class NameTruncate { - } } diff --git a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/chart/YAxis.java b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/chart/YAxis.java index 973c382..ab6582d 100644 --- a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/chart/YAxis.java +++ b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/chart/YAxis.java @@ -1,6 +1,8 @@ package com.github.koooooo7.echarts4j.option.chart; import com.fasterxml.jackson.annotation.JsonInclude; +import com.github.koooooo7.echarts4j.option.embedded.NameTextStyle; +import com.github.koooooo7.echarts4j.option.embedded.NameTruncate; import com.github.koooooo7.echarts4j.type.FuncStr; import com.github.koooooo7.echarts4j.util.annotation.EmbedScope; import lombok.Builder; @@ -36,16 +38,4 @@ public class YAxis { private Boolean silent; private Boolean triggerEvent; - @Data - @Builder - @JsonInclude(JsonInclude.Include.NON_NULL) - @EmbedScope({XAxis.class, YAxis.class}) - public static class NameTextStyle { - } - - @Data - @Builder - @JsonInclude(JsonInclude.Include.NON_NULL) - public static class NameTruncate { - } } diff --git a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/AreaStyle.java b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/AreaStyle.java new file mode 100644 index 0000000..a67c2fe --- /dev/null +++ b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/AreaStyle.java @@ -0,0 +1,11 @@ +package com.github.koooooo7.echarts4j.option.embedded; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Builder; +import lombok.Data; + +@Data +@Builder +@JsonInclude(JsonInclude.Include.NON_NULL) +public class AreaStyle { +} diff --git a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/ItemStyle.java b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/ItemStyle.java new file mode 100644 index 0000000..63c3c34 --- /dev/null +++ b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/ItemStyle.java @@ -0,0 +1,11 @@ +package com.github.koooooo7.echarts4j.option.embedded; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Builder; +import lombok.Data; + +@Data +@Builder +@JsonInclude(JsonInclude.Include.NON_NULL) +public class ItemStyle { +} diff --git a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/Label.java b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/Label.java new file mode 100644 index 0000000..85c0954 --- /dev/null +++ b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/Label.java @@ -0,0 +1,11 @@ +package com.github.koooooo7.echarts4j.option.embedded; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Builder; +import lombok.Data; + +@Data +@Builder +@JsonInclude(JsonInclude.Include.NON_NULL) +public class Label { +} diff --git a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/LineStyle.java b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/LineStyle.java new file mode 100644 index 0000000..4b2c781 --- /dev/null +++ b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/LineStyle.java @@ -0,0 +1,11 @@ +package com.github.koooooo7.echarts4j.option.embedded; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Builder; +import lombok.Data; + +@Data +@Builder +@JsonInclude(JsonInclude.Include.NON_NULL) +public class LineStyle { +} diff --git a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/NameTextStyle.java b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/NameTextStyle.java new file mode 100644 index 0000000..6403893 --- /dev/null +++ b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/NameTextStyle.java @@ -0,0 +1,16 @@ +package com.github.koooooo7.echarts4j.option.embedded; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.github.koooooo7.echarts4j.option.chart.RadiusAxis; +import com.github.koooooo7.echarts4j.option.chart.XAxis; +import com.github.koooooo7.echarts4j.option.chart.YAxis; +import com.github.koooooo7.echarts4j.util.annotation.EmbedScope; +import lombok.Builder; +import lombok.Data; + +@Data +@Builder +@JsonInclude(JsonInclude.Include.NON_NULL) +@EmbedScope({XAxis.class, YAxis.class, RadiusAxis.class}) +public class NameTextStyle { +} diff --git a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/NameTruncate.java b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/NameTruncate.java new file mode 100644 index 0000000..5d13ac8 --- /dev/null +++ b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/NameTruncate.java @@ -0,0 +1,16 @@ +package com.github.koooooo7.echarts4j.option.embedded; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.github.koooooo7.echarts4j.option.chart.RadiusAxis; +import com.github.koooooo7.echarts4j.option.chart.XAxis; +import com.github.koooooo7.echarts4j.option.chart.YAxis; +import com.github.koooooo7.echarts4j.util.annotation.EmbedScope; +import lombok.Builder; +import lombok.Data; + +@Data +@Builder +@JsonInclude(JsonInclude.Include.NON_NULL) +@EmbedScope({XAxis.class, YAxis.class, RadiusAxis.class}) +public class NameTruncate { +} \ No newline at end of file diff --git a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/TextStyle.java b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/TextStyle.java new file mode 100644 index 0000000..bee5bed --- /dev/null +++ b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/TextStyle.java @@ -0,0 +1,15 @@ +package com.github.koooooo7.echarts4j.option.embedded; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Builder; +import lombok.Data; + +@Data +@Builder +@JsonInclude(JsonInclude.Include.NON_NULL) +public class TextStyle { + private String color; + private String fontStyle; + private String fontWeight; + private Integer fontSize; +} \ No newline at end of file diff --git a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/embed/SeriesTooltip.java b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/Tooltip.java similarity index 79% rename from echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/embed/SeriesTooltip.java rename to echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/Tooltip.java index 4342da9..b7a11f0 100644 --- a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/embed/SeriesTooltip.java +++ b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/embedded/Tooltip.java @@ -1,4 +1,4 @@ -package com.github.koooooo7.echarts4j.option.series.embed; +package com.github.koooooo7.echarts4j.option.embedded; import com.fasterxml.jackson.annotation.JsonInclude; import com.github.koooooo7.echarts4j.type.FuncStr; @@ -8,7 +8,7 @@ @Data @Builder @JsonInclude(JsonInclude.Include.NON_NULL) -public class SeriesTooltip { +public class Tooltip { private Object position; private FuncStr formatter; private FuncStr valueFormatter; diff --git a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/GenericSeriesOption.java b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/GenericSeriesOption.java index 94e4780..70e447b 100644 --- a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/GenericSeriesOption.java +++ b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/GenericSeriesOption.java @@ -2,8 +2,8 @@ import com.fasterxml.jackson.annotation.JsonInclude; import com.github.koooooo7.echarts4j.chart.ChartType; -import com.github.koooooo7.echarts4j.option.series.embed.SeriesTextStyle; -import com.github.koooooo7.echarts4j.option.series.embed.SeriesTooltip; +import com.github.koooooo7.echarts4j.option.embedded.TextStyle; +import com.github.koooooo7.echarts4j.option.embedded.Tooltip; import com.github.koooooo7.echarts4j.type.FuncStr; import lombok.Builder; import lombok.Data; @@ -56,8 +56,8 @@ public class GenericSeriesOption implements SeriesOption { private FuncStr animationDurationUpdate; private String animationEasingUpdate; private FuncStr animationDelayUpdate; - private SeriesTooltip tooltip; - private SeriesTextStyle textStyle; + private Tooltip tooltip; + private TextStyle textStyle; } diff --git a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/embed/AreaStyle.java b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/embed/AreaStyle.java deleted file mode 100644 index a333187..0000000 --- a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/embed/AreaStyle.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.github.koooooo7.echarts4j.option.series.embed; - -public class AreaStyle { -} diff --git a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/embed/ItemStyle.java b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/embed/ItemStyle.java deleted file mode 100644 index ffe7cc6..0000000 --- a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/embed/ItemStyle.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.github.koooooo7.echarts4j.option.series.embed; - -public class ItemStyle { -} diff --git a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/embed/Label.java b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/embed/Label.java deleted file mode 100644 index 9578e5d..0000000 --- a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/embed/Label.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.github.koooooo7.echarts4j.option.series.embed; - -public class Label { -} diff --git a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/embed/LineStyle.java b/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/embed/LineStyle.java deleted file mode 100644 index c6bf7b9..0000000 --- a/echarts4j-project/src/main/java/com/github/koooooo7/echarts4j/option/series/embed/LineStyle.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.github.koooooo7.echarts4j.option.series.embed; - -public class LineStyle { -}