Skip to content

Commit 210e290

Browse files
authored
Merge pull request #300 from xdev-software/develop
Release
2 parents 292e5f9 + 24a1a04 commit 210e290

File tree

12 files changed

+199
-322
lines changed

12 files changed

+199
-322
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 2.6.0
2+
* Synced ``Doughnut/PieOptions`` from ChartJS source code #293
3+
* Synced ``GridLineConfiguration`` from ChartJS source code / improved Types for more options #289
4+
* Updated dependencies
5+
16
## 2.5.0
27
* Synced ``Legend`` from ChartJS source code #285
38

chartjs-java-model-demo/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
<parent>
88
<groupId>software.xdev</groupId>
99
<artifactId>chartjs-java-model-root</artifactId>
10-
<version>2.5.1-SNAPSHOT</version>
10+
<version>2.6.0-SNAPSHOT</version>
1111
</parent>
1212

1313
<artifactId>chartjs-java-model-demo</artifactId>
14-
<version>2.5.1-SNAPSHOT</version>
14+
<version>2.6.0-SNAPSHOT</version>
1515
<packaging>jar</packaging>
1616

1717
<organization>

chartjs-java-model/pom.xml

+10-10
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>software.xdev</groupId>
88
<artifactId>chartjs-java-model</artifactId>
9-
<version>2.5.1-SNAPSHOT</version>
9+
<version>2.6.0-SNAPSHOT</version>
1010
<packaging>jar</packaging>
1111

1212
<name>chartjs-java-model</name>
@@ -49,8 +49,8 @@
4949
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
5050

5151
<slf4j-version>2.0.16</slf4j-version>
52-
<log4j-version>2.24.1</log4j-version>
53-
<testcontainers-version>1.20.3</testcontainers-version>
52+
<log4j-version>2.24.2</log4j-version>
53+
<testcontainers-version>1.20.4</testcontainers-version>
5454

5555
<!-- by default run no tests as Docker is required -->
5656
<skipTests>true</skipTests>
@@ -95,7 +95,7 @@
9595
<dependency>
9696
<groupId>com.fasterxml.jackson.core</groupId>
9797
<artifactId>jackson-databind</artifactId>
98-
<version>2.18.1</version>
98+
<version>2.18.2</version>
9999
</dependency>
100100

101101
<!-- Tests -->
@@ -170,7 +170,7 @@
170170
<dependency>
171171
<groupId>org.seleniumhq.selenium</groupId>
172172
<artifactId>selenium-chrome-driver</artifactId>
173-
<version>4.26.0</version>
173+
<version>4.27.0</version>
174174
<scope>test</scope>
175175
<exclusions>
176176
<!-- Tracing is not needed -->
@@ -245,7 +245,7 @@
245245
<executions>
246246
<execution>
247247
<id>attach-javadocs</id>
248-
<phase>verify</phase>
248+
<phase>package</phase>
249249
<goals>
250250
<goal>jar</goal>
251251
</goals>
@@ -263,7 +263,7 @@
263263
<executions>
264264
<execution>
265265
<id>attach-sources</id>
266-
<phase>verify</phase>
266+
<phase>package</phase>
267267
<goals>
268268
<goal>jar-no-fork</goal>
269269
</goals>
@@ -360,7 +360,7 @@
360360
<dependency>
361361
<groupId>com.puppycrawl.tools</groupId>
362362
<artifactId>checkstyle</artifactId>
363-
<version>10.20.1</version>
363+
<version>10.20.2</version>
364364
</dependency>
365365
</dependencies>
366366
<configuration>
@@ -397,12 +397,12 @@
397397
<dependency>
398398
<groupId>net.sourceforge.pmd</groupId>
399399
<artifactId>pmd-core</artifactId>
400-
<version>7.7.0</version>
400+
<version>7.8.0</version>
401401
</dependency>
402402
<dependency>
403403
<groupId>net.sourceforge.pmd</groupId>
404404
<artifactId>pmd-java</artifactId>
405-
<version>7.7.0</version>
405+
<version>7.8.0</version>
406406
</dependency>
407407
</dependencies>
408408
</plugin>

chartjs-java-model/src/main/java/software/xdev/chartjs/model/options/DoughnutOptions.java

+1-93
Original file line numberDiff line numberDiff line change
@@ -16,100 +16,8 @@
1616
package software.xdev.chartjs.model.options;
1717

1818
import software.xdev.chartjs.model.options.animation.DoughnutAnimation;
19-
import software.xdev.chartjs.model.options.elements.ArcElements;
2019

2120

22-
public class DoughnutOptions extends Options<DoughnutOptions, DoughnutAnimation>
21+
public class DoughnutOptions extends DoughnutOptionsBase<DoughnutOptions, DoughnutAnimation>
2322
{
24-
/**
25-
* Default {@code 50}
26-
*
27-
* @see #setCutout(Number cutout)
28-
*/
29-
protected Number cutout;
30-
31-
/**
32-
* Rotation in degrees. Default {@code 0}. {@code 0} is at the top.
33-
*
34-
* @see #setRotation(Number rotation)
35-
*/
36-
protected Number rotation;
37-
38-
/**
39-
* Circumference in degrees. Default {@code 360}.
40-
*
41-
* @see #setCircumference(Number circumference)
42-
*/
43-
protected Number circumference;
44-
45-
protected ArcElements elements;
46-
47-
/**
48-
* @see #setCutout(Number cutoutPercentage)
49-
*/
50-
public Number getCutout()
51-
{
52-
return this.cutout;
53-
}
54-
55-
/**
56-
* The pixels as number of the chart that is cut out of the middle.
57-
*/
58-
public DoughnutOptions setCutout(final Number cutout)
59-
{
60-
this.cutout = cutout;
61-
return this;
62-
}
63-
64-
/**
65-
* @see #setRotation(Number rotation)
66-
*/
67-
public Number getRotation()
68-
{
69-
return this.rotation;
70-
}
71-
72-
/**
73-
* Starting angle to draw arcs from in degrees
74-
*/
75-
public DoughnutOptions setRotation(final Number rotation)
76-
{
77-
this.rotation = rotation;
78-
return this;
79-
}
80-
81-
/**
82-
* @see #setCircumference(Number circumference)
83-
*/
84-
public Number getCircumference()
85-
{
86-
return this.circumference;
87-
}
88-
89-
/**
90-
* Sweep to allow arcs to cover in degrees
91-
*/
92-
public DoughnutOptions setCircumference(final Number circumference)
93-
{
94-
this.circumference = circumference;
95-
return this;
96-
}
97-
98-
/**
99-
* @return {@link ArcElements} instance, or {@code null} if not set
100-
*/
101-
public ArcElements getElements()
102-
{
103-
return this.elements;
104-
}
105-
106-
/**
107-
* @param elements an {@link ArcElements} instance, or {@code null}
108-
* @return this instance for method chaining
109-
*/
110-
public DoughnutOptions setElements(final ArcElements elements)
111-
{
112-
this.elements = elements;
113-
return this;
114-
}
11523
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
/*
2+
* Copyright © 2023 XDEV Software (https://xdev.software)
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package software.xdev.chartjs.model.options;
17+
18+
import software.xdev.chartjs.model.options.animation.DoughnutAnimationBase;
19+
20+
21+
/**
22+
* @see <a href="https://github.com/chartjs/Chart.js/blob/v4.4.6/src/types/index.d.ts#L298">ChartJS Source</a>
23+
*/
24+
public abstract class DoughnutOptionsBase<O extends DoughnutOptionsBase<O, A>, A extends DoughnutAnimationBase<A>>
25+
extends Options<O, A>
26+
{
27+
protected Number circumference;
28+
protected Object cutout; // number or string
29+
protected Object offset; // number or number[]
30+
protected Object radius; // number or string
31+
protected Number rotation;
32+
protected Number spacing;
33+
34+
public Number getCircumference()
35+
{
36+
return this.circumference;
37+
}
38+
39+
public DoughnutOptionsBase<O, A> setCircumference(final Number circumference)
40+
{
41+
this.circumference = circumference;
42+
return this.self();
43+
}
44+
45+
public Object getCutout()
46+
{
47+
return this.cutout;
48+
}
49+
50+
public DoughnutOptionsBase<O, A> setCutout(final Object cutout)
51+
{
52+
this.cutout = cutout;
53+
return this.self();
54+
}
55+
56+
public Object getOffset()
57+
{
58+
return this.offset;
59+
}
60+
61+
public DoughnutOptionsBase<O, A> setOffset(final Object offset)
62+
{
63+
this.offset = offset;
64+
return this.self();
65+
}
66+
67+
public Object getRadius()
68+
{
69+
return this.radius;
70+
}
71+
72+
public DoughnutOptionsBase<O, A> setRadius(final Object radius)
73+
{
74+
this.radius = radius;
75+
return this.self();
76+
}
77+
78+
public Number getRotation()
79+
{
80+
return this.rotation;
81+
}
82+
83+
public DoughnutOptionsBase<O, A> setRotation(final Number rotation)
84+
{
85+
this.rotation = rotation;
86+
return this.self();
87+
}
88+
89+
public Number getSpacing()
90+
{
91+
return this.spacing;
92+
}
93+
94+
public DoughnutOptionsBase<O, A> setSpacing(final Number spacing)
95+
{
96+
this.spacing = spacing;
97+
return this.self();
98+
}
99+
}

chartjs-java-model/src/main/java/software/xdev/chartjs/model/options/Options.java

+7-10
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@
2828

2929

3030
/**
31-
* @see <a href="https://github.com/chartjs/Chart.js/blob/v4.4.3/src/types/index.d.ts#L1588">ChartJS Source</a>
31+
* @see <a href="https://github.com/chartjs/Chart.js/blob/v4.4.7/src/types/index.d.ts#L1588">
32+
* ChartJS Source (Options)</a>
33+
* @see <a href="https://github.com/chartjs/Chart.js/blob/v4.4.7/src/types/index.d.ts#L1756">
34+
* ChartJS Source (AnimationOptons)</a>
3235
*/
3336
public class Options<T extends Options<T, A>, A extends Animation<A>>
3437
{
@@ -43,7 +46,7 @@ public class Options<T extends Options<T, A>, A extends Animation<A>>
4346
protected CoreInteractionOptions interaction;
4447
protected CoreInteractionOptions hover;
4548
protected Animations<A> animations;
46-
protected Boolean animation = true;
49+
protected Object animation; // Usually a boolean or of Type <A>
4750
protected Layout layout;
4851
protected Plugins plugins = new Plugins();
4952

@@ -89,18 +92,12 @@ public T setResponsive(final Boolean responsive)
8992
return this.self();
9093
}
9194

92-
/**
93-
* @see #setAnimation(Boolean)
94-
*/
95-
public Boolean getAnimation()
95+
public Object getAnimation()
9696
{
9797
return this.animation;
9898
}
9999

100-
/**
101-
* Default {@code true} Disables the Animation completely if set to {@code false}.
102-
*/
103-
public T setAnimation(final Boolean animation)
100+
public T setAnimation(final Object animation)
104101
{
105102
this.animation = animation;
106103
return this.self();

0 commit comments

Comments
 (0)