use of net.sf.dynamicreports.report.datasource.DRDataSource in project hmftools by hartwigmedical.
the class GradientBar method build.
@NotNull
public ComponentBuilder<?, ?> build() {
final TextColumnBuilder<String> itemColumn = col.column("item", "item", String.class);
final TextColumnBuilder<Integer> valueColumn = col.column("value", "value", Integer.class);
final DRDataSource dataSource = new DRDataSource("item", "value");
dataSource.add("value", 100);
final GradientPaint gradientPaint = new GradientPaint(0, 0, startColor(), 10, 0, endColor());
final GradientBarCustomizer customizer = ImmutableGradientBarCustomizer.of(gradientPaint, startText(), endText(), value(), marker());
return cht.barChart().customizers(customizer).setCategory(itemColumn).series(cht.serie(valueColumn)).setHeight(39).setDataSource(dataSource);
}
use of net.sf.dynamicreports.report.datasource.DRDataSource in project hmftools by hartwigmedical.
the class VariantDataSource method fromVariants.
@NotNull
public static JRDataSource fromVariants(@NotNull final List<VariantReport> variantReports, @NotNull DrupFilter drupFilter) {
final DRDataSource variantDataSource = new DRDataSource(GENE_FIELD.getName(), POSITION_FIELD.getName(), VARIANT_FIELD.getName(), DEPTH_VAF_FIELD.getName(), COSMIC_FIELD.getName(), COSMIC_NR_FIELD.getName(), HGVS_CODING_FIELD.getName(), HGVS_PROTEIN_FIELD.getName(), CONSEQUENCE_FIELD.getName(), PLOIDY_TAF_FIELD.getName());
for (final VariantReport variantReport : variantReports) {
final String displayGene = drupFilter.test(variantReport) ? variantReport.gene() + " *" : variantReport.gene();
variantDataSource.add(displayGene, variantReport.variant().chromosomePosition(), variantReport.variantField(), variantReport.depthVafField(), variantReport.cosmicID(), stripCosmicIdentifier(variantReport.cosmicID()), variantReport.hgvsCoding(), variantReport.hgvsProtein(), variantReport.consequence(), variantReport.ploidyTafField());
}
return variantDataSource;
}
Aggregations