mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Add d3 for correct imports in nvd3 chart
This commit is contained in:
+346
-346
File diff suppressed because one or more lines are too long
@@ -1,6 +1,7 @@
|
||||
/** This is the common wrapper for nvd3 based visualizations. */
|
||||
import Utilities from "./utilities/tabular-utilities";
|
||||
import * as nv from "nvd3";
|
||||
import * as d3 from "d3";
|
||||
//import "nvd3/build/nv.d3.css";
|
||||
|
||||
var CommonWrapper = Backbone.View.extend({
|
||||
@@ -23,10 +24,16 @@ var CommonWrapper = Backbone.View.extend({
|
||||
d3chart.xAxis.axisLabel(chart.settings.get("x_axis_label"));
|
||||
d3chart.yAxis.axisLabel(chart.settings.get("y_axis_label")).axisLabelDistance(30);
|
||||
d3chart.options({ showControls: false });
|
||||
d3chart.showLegend && d3chart.showLegend(chart.settings.get("show_legend") == "true");
|
||||
if (d3chart.showLegend) {
|
||||
d3chart.showLegend(chart.settings.get("show_legend") == "true");
|
||||
}
|
||||
self._makeAxes(d3chart, groups, chart.settings);
|
||||
makeConfig && makeConfig(d3chart);
|
||||
chart.settings.get("__use_panels") === "true" && d3chart.options({ showControls: false });
|
||||
if (makeConfig) {
|
||||
makeConfig(d3chart);
|
||||
}
|
||||
if (chart.settings.get("__use_panels") === "true") {
|
||||
d3chart.options({ showControls: false });
|
||||
}
|
||||
d3chart.xAxis.showMaxMin(false);
|
||||
d3chart.yAxis.showMaxMin(chart.definition.showmaxmin);
|
||||
d3chart.tooltipContent(function(key, x, y, graph) {
|
||||
@@ -36,7 +43,9 @@ var CommonWrapper = Backbone.View.extend({
|
||||
var canvas = d3.select("#" + canvas_id);
|
||||
canvas.datum(groups).call(d3chart);
|
||||
if (chart.definition.zoomable && chart.definition.zoomable != "native") {
|
||||
d3chart.clipEdge && d3chart.clipEdge(true);
|
||||
if (d3chart.clipEdge) {
|
||||
d3chart.clipEdge(true);
|
||||
}
|
||||
Utilities.addZoom({
|
||||
xAxis: d3chart.xAxis,
|
||||
yAxis: d3chart.yAxis,
|
||||
@@ -66,10 +75,11 @@ var CommonWrapper = Backbone.View.extend({
|
||||
type: settings.get(id + "_axis_type|type"),
|
||||
precision: settings.get(id + "_axis_type|precision"),
|
||||
formatter: function(formatter) {
|
||||
formatter &&
|
||||
if (formatter) {
|
||||
d3chart[id + "Axis"].tickFormat(function(value) {
|
||||
return formatter(value);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user