Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.1.0 #50

Merged
merged 18 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/update-from-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,8 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh_pr_up() {
gh pr create "$@" || gh pr edit "$@"
gh pr create -H "${{ env.UPDATE_BRANCH }}" "$@" || git checkout "${{ env.UPDATE_BRANCH }}" && gh pr edit "$@"
}
gh_pr_up -B "${{ steps.main.outputs.current_branch }}" \
-H "${{ env.UPDATE_BRANCH }}" \
--title "Update from template" \
--body "An automated PR to sync changes from the template into this repo"
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
## 1.1.0
* Added support for more [data structures](https://www.chartjs.org/docs/4.4.0/general/data-structures.html) inside ``Dataset#data``
* ``Dataset#data`` can now contain ``Object``s

## 1.0.2
* Support Java 11
* Updated dependencies

## 1.0.1
* Added support for [stacked bar chart with groups](https://www.chartjs.org/docs/latest/samples/bar/stacked-groups.html)
* Added support for [stacked bar chart with groups](https://www.chartjs.org/docs/4.4.0/samples/bar/stacked-groups.html)

## 1.0.0
Initial release
Expand Down
2 changes: 1 addition & 1 deletion chartjs-java-model-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.xdev-software</groupId>
<artifactId>chartjs-java-model-demo</artifactId>
<version>1.0.3-SNAPSHOT</version>
<version>1.1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<inceptionYear>2022</inceptionYear>
Expand Down
6 changes: 3 additions & 3 deletions chartjs-java-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.xdev-software</groupId>
<artifactId>chartjs-java-model</artifactId>
<version>1.0.3-SNAPSHOT</version>
<version>1.1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>chartjs-java-model</name>
Expand Down Expand Up @@ -49,7 +49,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<slf4j-version>2.0.9</slf4j-version>
<log4j-version>2.21.0</log4j-version>
<log4j-version>2.21.1</log4j-version>
<testcontainers-version>1.19.1</testcontainers-version>

<!-- by default run no tests as Docker is required -->
Expand Down Expand Up @@ -240,7 +240,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.2</version>
<version>3.2.1</version>
<configuration>
<skipTests>${skipTests}</skipTests>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import software.xdev.chartjs.model.options.Options;


public abstract class AbstractChart<T, O extends Options<O, ?>, D extends Data<D, ?, ?>>
public abstract class AbstractChart<T, O extends Options<O, ?>, D extends Data<D, ?>>
implements Chart<T, O, D>
{
protected D data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


@SuppressWarnings("java:S119") // SELF means the Chart itself... Not a problem
public interface Chart<SELF, O extends Options<O, ?>, D extends Data<D, ?, ?>>
public interface Chart<SELF, O extends Options<O, ?>, D extends Data<D, ?>>
{
/**
* @return type of this {@link Chart} implementation for proper drawing in JavaScript.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@
*/
package software.xdev.chartjs.model.data;

import java.math.BigDecimal;

import software.xdev.chartjs.model.dataset.BarDataset;


public class BarData extends Data<BarData, BarDataset, BigDecimal>
public class BarData extends Data<BarData, BarDataset>
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
*/
package software.xdev.chartjs.model.data;

import software.xdev.chartjs.model.datapoint.BubbleDataPoint;
import software.xdev.chartjs.model.dataset.BubbleDataset;


public class BubbleData extends Data<BubbleData, BubbleDataset, BubbleDataPoint>
public class BubbleData extends Data<BubbleData, BubbleDataset>
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
import software.xdev.chartjs.model.dataset.Dataset;


public class Data<D extends Data<D, T, O>, T extends Dataset<T, O>, O>
public class Data<D extends Data<D, T>, T extends Dataset<T, ?>>
{

private final List<String> labels = new ArrayList<>();
private final List<T> datasets = new ArrayList<>();

Expand All @@ -40,7 +39,6 @@ public List<String> getLabels() {
/**
* Sets the backing label list, replacing any labels previously added or set
*
* @param labels
* @return this object to allow method chaining
*/
public D setLabels(final Collection<String> labels) {
Expand All @@ -54,7 +52,6 @@ public D setLabels(final Collection<String> labels) {
/**
* Sets the backing label list, replacing any labels previously added or set
*
* @param labels
* @return this object to allow method chaining
*/
public D setLabels(final String... labels) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@
*/
package software.xdev.chartjs.model.data;

import java.math.BigDecimal;

import software.xdev.chartjs.model.dataset.DoughnutDataset;


public class DoughnutData extends Data<DoughnutData, DoughnutDataset, BigDecimal>
public class DoughnutData extends Data<DoughnutData, DoughnutDataset>
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@
*/
package software.xdev.chartjs.model.data;

import java.math.BigDecimal;

import software.xdev.chartjs.model.dataset.LineDataset;


public class LineData extends Data<LineData, LineDataset, BigDecimal>
public class LineData extends Data<LineData, LineDataset>
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@
*/
package software.xdev.chartjs.model.data;

import java.math.BigDecimal;

import software.xdev.chartjs.model.dataset.PieDataset;


public class PieData extends Data<PieData, PieDataset, BigDecimal>
public class PieData extends Data<PieData, PieDataset>
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@
*/
package software.xdev.chartjs.model.data;

import java.math.BigDecimal;

import software.xdev.chartjs.model.dataset.PolarDataset;


public class PolarData extends Data<PolarData, PolarDataset, BigDecimal>
public class PolarData extends Data<PolarData, PolarDataset>
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@
*/
package software.xdev.chartjs.model.data;

import java.math.BigDecimal;

import software.xdev.chartjs.model.dataset.RadarDataset;


public class RadarData extends Data<RadarData, RadarDataset, BigDecimal>
public class RadarData extends Data<RadarData, RadarDataset>
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
*/
package software.xdev.chartjs.model.data;

import software.xdev.chartjs.model.datapoint.ScatterDataPoint;
import software.xdev.chartjs.model.dataset.ScatterDataset;


public class ScatterData extends Data<ScatterData, ScatterDataset, ScatterDataPoint>
public class ScatterData extends Data<ScatterData, ScatterDataset>
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,8 @@
import java.math.BigDecimal;


public class BubbleDataPoint
public class BubbleDataPoint extends XYDataPointBase<BubbleDataPoint>
{

/**
* @see #setX(BigDecimal)
*/
private BigDecimal x;

/**
* @see #setY(BigDecimal)
*/
private BigDecimal y;

/**
* @see #setR(BigDecimal)
*/
private BigDecimal r;

public BubbleDataPoint()
Expand All @@ -42,68 +28,15 @@ public BubbleDataPoint()

public BubbleDataPoint(final BigDecimal x, final BigDecimal y, final BigDecimal r)
{
this.x = x;
this.y = y;
super(x, y);
this.r = r;
}

public BigDecimal getX()
{
return this.x;
}

public BubbleDataPoint setX(final int x)
{
this.x = new BigDecimal(x);
return this;
}

public BubbleDataPoint setX(final double x)
{
this.x = new BigDecimal(String.valueOf(x));
return this;
}

public BubbleDataPoint setX(final BigDecimal x)
{
this.x = x;
return this;
}

public BigDecimal getY()
{
return this.y;
}

public BubbleDataPoint setY(final int y)
{
this.y = new BigDecimal(y);
return this;
}

public BubbleDataPoint setY(final double y)
{
this.y = new BigDecimal(String.valueOf(y));
return this;
}

public BubbleDataPoint setY(final BigDecimal y)
{
this.y = y;
return this;
}

/**
* @see #setR(BigDecimal)
*/
public BigDecimal getR()
{
return this.r;
}

/**
* @see #setR(BigDecimal)
*/
public BubbleDataPoint setR(final double r)
{
this.r = new BigDecimal(String.valueOf(r));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,82 +17,25 @@

import java.math.BigDecimal;

import com.fasterxml.jackson.annotation.JsonInclude;


@JsonInclude()
public class ScatterDataPoint
public class ScatterDataPoint extends XYDataPointBase<ScatterDataPoint>
{

private BigDecimal x;

private BigDecimal y;

public ScatterDataPoint()
{
}

public ScatterDataPoint(final int x, final int y)
{
this.setX(x);
this.setY(y);
super(x, y);
}

public ScatterDataPoint(final double x, final double y)
{
this.setX(x);
this.setY(y);
super(x, y);
}

public ScatterDataPoint(final BigDecimal x, final BigDecimal y)
{
this.setX(x);
this.setY(y);
}

public BigDecimal getX()
{
return this.x;
}

public ScatterDataPoint setX(final int x)
{
this.x = new BigDecimal(x);
return this;
}

public ScatterDataPoint setX(final double x)
{
this.x = new BigDecimal(String.valueOf(x));
return this;
}

public ScatterDataPoint setX(final BigDecimal x)
{
this.x = x;
return this;
}

public BigDecimal getY()
{
return this.y;
}

public ScatterDataPoint setY(final int y)
{
this.y = new BigDecimal(y);
return this;
}

public ScatterDataPoint setY(final double y)
{
this.y = new BigDecimal(String.valueOf(y));
return this;
}

public ScatterDataPoint setY(final BigDecimal y)
{
this.y = y;
return this;
super(x, y);
}
}
Loading