Search in sources :

Example 6 with CategoryAxis

use of javafx.scene.chart.CategoryAxis in project jvarkit by lindenb.

the class AFBySexChartFactory method build.

@Override
public Chart build() {
    final CategoryAxis xAxis = new CategoryAxis();
    xAxis.setLabel("Sex");
    final NumberAxis yAxis = new NumberAxis();
    yAxis.setLabel("Mean-MAF");
    final XYChart.Series<String, Number> serie = new XYChart.Series<String, Number>();
    serie.setName("Sex");
    for (int i = 0; i < this.popcount.size(); ++i) {
        final PedFile.Sex sexxxxx = PedFile.Sex.values()[i];
        double v = 0;
        if (this.popcount.get(i).num_maf > 0) {
            v = this.popcount.get(i).sum / ((double) this.popcount.get(i).num_maf);
        }
        serie.getData().add(new XYChart.Data<String, Number>(sexxxxx.name(), v));
    }
    final BarChart<String, Number> sbc = new BarChart<String, Number>(xAxis, yAxis);
    sbc.setTitle(this.getName());
    sbc.getData().add(serie);
    sbc.setCategoryGap(0.2);
    sbc.setLegendVisible(false);
    return sbc;
}
Also used : NumberAxis(javafx.scene.chart.NumberAxis) PedFile(com.github.lindenb.jvarkit.tools.vcfviewgui.PedFile) CategoryAxis(javafx.scene.chart.CategoryAxis) BarChart(javafx.scene.chart.BarChart) XYChart(javafx.scene.chart.XYChart)

Example 7 with CategoryAxis

use of javafx.scene.chart.CategoryAxis in project jvarkit by lindenb.

the class AlleleFrequencyChartFactory method build.

@Override
public Chart build() {
    final CategoryAxis xAxis = new CategoryAxis();
    xAxis.setLabel("AF");
    final NumberAxis yAxis = new NumberAxis();
    yAxis.setLabel("Count");
    final XYChart.Series<String, Number> serie = new XYChart.Series<String, Number>();
    serie.setName(xAxis.getLabel());
    for (final Limit limit : this.limits) {
        if (this.afindexcount.count(limit.index) == 0L)
            continue;
        serie.getData().add(new XYChart.Data<String, Number>(limit.label, this.afindexcount.count(limit.index)));
    }
    final StackedBarChart<String, Number> sbc = new StackedBarChart<String, Number>(xAxis, yAxis);
    sbc.setTitle("Allele Frequency" + (this.nSamples > 0 ? " (Nbr. Sample(s):" + this.nSamples + ")" : ""));
    sbc.getData().add(serie);
    sbc.setCategoryGap(0.2);
    sbc.setLegendVisible(false);
    return sbc;
}
Also used : NumberAxis(javafx.scene.chart.NumberAxis) CategoryAxis(javafx.scene.chart.CategoryAxis) StackedBarChart(javafx.scene.chart.StackedBarChart) XYChart(javafx.scene.chart.XYChart)

Example 8 with CategoryAxis

use of javafx.scene.chart.CategoryAxis in project jvarkit by lindenb.

the class TiTvChartFactory method build.

@Override
public Chart build() {
    final CategoryAxis xAxis = new CategoryAxis();
    xAxis.setLabel("Sample");
    final NumberAxis yAxis = new NumberAxis();
    yAxis.setLabel("Count");
    final List<XYChart.Series<String, Number>> type2count = new ArrayList<>(3);
    for (int i = 0; i < 2; ++i) {
        final XYChart.Series<String, Number> serie = new XYChart.Series<String, Number>();
        serie.setName(i == 0 ? "Transition" : "Transversion");
        type2count.add(serie);
        if (this.sample2titv.isEmpty()) {
            serie.getData().add(new XYChart.Data<String, Number>("ALL", (i == 0 ? all.transition : all.transvertion)));
        } else {
            for (final String sampleName : this.sample2titv.keySet()) {
                final TiTv titv = this.sample2titv.get(sampleName);
                serie.getData().add(new XYChart.Data<String, Number>(sampleName, (i == 0 ? titv.transition : titv.transvertion)));
            }
        }
    }
    final StackedBarChart<String, Number> sbc = new StackedBarChart<String, Number>(xAxis, yAxis);
    sbc.setTitle(this.getName());
    sbc.getData().addAll(type2count);
    sbc.setCategoryGap(0.2);
    return sbc;
}
Also used : NumberAxis(javafx.scene.chart.NumberAxis) ArrayList(java.util.ArrayList) StackedBarChart(javafx.scene.chart.StackedBarChart) CategoryAxis(javafx.scene.chart.CategoryAxis) XYChart(javafx.scene.chart.XYChart)

Example 9 with CategoryAxis

use of javafx.scene.chart.CategoryAxis in project Gargoyle by callakrsos.

the class GoogleTrendExam method start.

/* (non-Javadoc)
	 * @see javafx.application.Application#start(javafx.stage.Stage)
	 */
@Override
public void start(Stage primaryStage) throws Exception {
    URL url = new URL(createUrl());
    String jsonString = RequestUtil.requestSSL(url, requestHandler);
    //		String source = ValueUtil.toString(GoogleTrendExam.class.getResourceAsStream("GoogleTrendSample.json"));
    BaseGoogleTrendChart root = new BaseGoogleTrendChart(jsonString, new CategoryAxis(), new NumberAxis(0, 100, 10));
    root.setVerticalGridLinesVisible(false);
    root.addEventFilter(GoogleTrendChartEvent.GOOGLE_CHART_INTERSECT_NODE_CLICK, ev -> {
        System.out.println(ev.getContents());
    });
    root.addEventHandler(GoogleTrendChartEvent.GOOGLE_CHART_INTERSECT_NODE_CLICK, ev -> {
        System.out.println(ev.getContents());
    });
    primaryStage.setScene(new Scene(root));
    primaryStage.show();
}
Also used : NumberAxis(javafx.scene.chart.NumberAxis) CategoryAxis(javafx.scene.chart.CategoryAxis) BaseGoogleTrendChart(com.kyj.fx.voeditor.visual.component.chart.service.BaseGoogleTrendChart) Scene(javafx.scene.Scene) URL(java.net.URL)

Example 10 with CategoryAxis

use of javafx.scene.chart.CategoryAxis in project Gargoyle by callakrsos.

the class SVNViewer method initialize.

@FXML
public void initialize() {
    tvSvnView = new SVNTreeView();
    tvSvnView.setOnAction(this::svnTreeViewOnAction);
    tvSvnView.setOnKeyPressed(this::svnTreeVoewOnKeyPressed);
    tvSvnView.load();
    anTreePane.getChildren().set(0, tvSvnView);
    AnchorPane.setLeftAnchor(tvSvnView, 0.0);
    AnchorPane.setRightAnchor(tvSvnView, 0.0);
    AnchorPane.setBottomAnchor(tvSvnView, 0.0);
    AnchorPane.setTopAnchor(tvSvnView, 0.0);
    colRevision.setCellValueFactory(v -> new SimpleObjectProperty<Long>(v.getValue().getRevision()));
    colUser.setCellValueFactory(v -> new SimpleStringProperty(v.getValue().getAuthor()));
    colComment.setCellValueFactory(v -> new SimpleStringProperty(v.getValue().getMessage()));
    colDate.setCellValueFactory(v -> new SimpleStringProperty(DateUtil.getDateString(v.getValue().getDate().getTime(), "yyyy-MM-dd")));
    javaTextAre = new JavaTextArea();
    borSource.setCenter(javaTextAre);
    lineHist = new LineChart<>(new CategoryAxis(), new CategoryAxis());
    borChart.setCenter(lineHist);
    tbRevision.getSelectionModel().setCellSelectionEnabled(true);
    tbRevision.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
    //		FxClipboardUtil.installCopyPasteHandler(tbRevision);
    //		FxTableViewUtil.
    FxUtil.installClipboardKeyEvent(tbRevision);
    MenuItem menuDiff = new MenuItem("Diff");
    menuDiff.setOnAction(this::menuDiffOnAction);
    tbRevision.setContextMenu(new ContextMenu(menuDiff));
    tvSvnView.svnGraphPropertyProperty().addListener((oba, oldView, newView) -> {
        if (newView != null) {
            Tab tabSvnGraph = new Tab("SVN Graph", newView);
            if (tabPaneSVN.getTabs().size() <= TAB_INDEX_SVN_GRAPH) {
                tabPaneSVN.getTabs().add(tabSvnGraph);
            } else {
                tabPaneSVN.getTabs().add(TAB_INDEX_SVN_GRAPH, tabSvnGraph);
            }
        }
    });
    displayLatestRevision();
}
Also used : Tab(javafx.scene.control.Tab) JavaTextArea(com.kyj.fx.voeditor.visual.component.text.JavaTextArea) CategoryAxis(javafx.scene.chart.CategoryAxis) MenuItem(javafx.scene.control.MenuItem) ContextMenu(javafx.scene.control.ContextMenu) SimpleStringProperty(javafx.beans.property.SimpleStringProperty) FXML(javafx.fxml.FXML)

Aggregations

CategoryAxis (javafx.scene.chart.CategoryAxis)17 NumberAxis (javafx.scene.chart.NumberAxis)15 XYChart (javafx.scene.chart.XYChart)11 StackedBarChart (javafx.scene.chart.StackedBarChart)7 BarChart (javafx.scene.chart.BarChart)6 ArrayList (java.util.ArrayList)5 TreeSet (java.util.TreeSet)3 PedFile (com.github.lindenb.jvarkit.tools.vcfviewgui.PedFile)2 Series (javafx.scene.chart.XYChart.Series)2 GraphDataBean (com.canoo.dp.impl.platform.projector.graph.GraphDataBean)1 GraphMetadata (com.canoo.dp.impl.platform.projector.graph.GraphMetadata)1 GraphType (com.canoo.dp.impl.platform.projector.graph.GraphType)1 MetadataUtilities (com.canoo.dp.impl.platform.projector.metadata.MetadataUtilities)1 Binding (com.canoo.platform.core.functional.Binding)1 Subscription (com.canoo.platform.core.functional.Subscription)1 FXBinder (com.canoo.platform.remoting.client.javafx.FXBinder)1 BaseGoogleTrendChart (com.kyj.fx.voeditor.visual.component.chart.service.BaseGoogleTrendChart)1 JavaTextArea (com.kyj.fx.voeditor.visual.component.text.JavaTextArea)1 Location (eu.hansolo.tilesfx.tools.Location)1 TimeData (eu.hansolo.tilesfx.tools.TimeData)1