trying out a chart.container idea to get a reference to the DOM element the chart is plotted in to help with a auto resize functionality, and may have other uses

master-patched
Bob Monteverde 12 years ago
parent c494172fe2
commit d1c2f59cd9

@ -1604,6 +1604,7 @@ nv.models.cumulativeLineChart = function() {
//TODO: decide if this is a good idea, and if it should be in all models
chart.update = function() { chart(selection) };
chart.container = this; // I need a reference to the container in order to have outside code check if the chart is visible or not
return chart;
@ -2142,9 +2143,8 @@ nv.models.discreteBarChart = function() {
//TODO: decide if this makes sense to add into all the models for ease of updating (updating without needing the selection)
chart.update = function() {
selection.transition().call(chart);
}
chart.update = function() { selection.transition().call(chart); };
chart.container = this; // I need a reference to the container in order to have outside code check if the chart is visible or not
});
@ -3110,6 +3110,7 @@ nv.models.lineChart = function() {
//TODO: decide if this is a good idea, and if it should be in all models
chart.update = function() { chart(selection) };
chart.container = this; // I need a reference to the container in order to have outside code check if the chart is visible or not
return chart;
@ -3395,6 +3396,7 @@ nv.models.linePlusBarChart = function() {
chart.update = function() { selection.transition().call(chart) };
chart.container = this; // I need a reference to the container in order to have outside code check if the chart is visible or not
});
@ -3755,6 +3757,7 @@ nv.models.lineWithFocusChart = function() {
//TODO: decide if this is a good idea, and if it should be in all models
chart.update = function() { chart(selection) };
chart.container = this; // I need a reference to the container in order to have outside code check if the chart is visible or not
return chart;
@ -4361,6 +4364,7 @@ nv.models.multiBarChart = function() {
chart.update = function() { selection.transition().call(chart) };
chart.container = this; // I need a reference to the container in order to have outside code check if the chart is visible or not
});
@ -4993,6 +4997,7 @@ nv.models.multiBarHorizontalChart = function() {
//TODO: decide if this makes sense to add into all the models for ease of updating (updating without needing the selection)
chart.update = function() { selection.transition().call(chart) };
chart.container = this; // I need a reference to the container in order to have outside code check if the chart is visible or not
});
@ -5808,9 +5813,6 @@ nv.models.scatterChart = function() {
var container = d3.select(this),
that = this;
//TODO: decide if this makes sense to add into all the models for ease of updating (updating without needing the selection)
chart.update = function() { selection.transition().call(chart) };
var availableWidth = (width || parseInt(container.style('width')) || 960)
- margin.left - margin.right,
@ -6040,6 +6042,12 @@ nv.models.scatterChart = function() {
x0 = x.copy();
y0 = y.copy();
//TODO: decide if this makes sense to add into all the models for ease of updating (updating without needing the selection)
chart.update = function() { selection.transition().call(chart) };
chart.container = this; // I need a reference to the container in order to have outside code check if the chart is visible or not
});
return chart;
@ -6746,9 +6754,6 @@ nv.models.stackedAreaChart = function() {
var container = d3.select(this),
that = this;
//TODO: decide if this makes sense to add into all the models for ease of updating (updating without needing the selection)
chart.update = function() { selection.transition().call(chart) };
var availableWidth = (width || parseInt(container.style('width')) || 960)
- margin.left - margin.right,
@ -6903,6 +6908,10 @@ nv.models.stackedAreaChart = function() {
if (tooltips) dispatch.on('tooltipHide', nv.tooltip.cleanup);
//TODO: decide if this makes sense to add into all the models for ease of updating (updating without needing the selection)
chart.update = function() { selection.transition().call(chart) };
chart.container = this; // I need a reference to the container in order to have outside code check if the chart is visible or not
});

8
nv.d3.min.js vendored

File diff suppressed because one or more lines are too long

@ -237,6 +237,7 @@ nv.models.cumulativeLineChart = function() {
//TODO: decide if this is a good idea, and if it should be in all models
chart.update = function() { chart(selection) };
chart.container = this; // I need a reference to the container in order to have outside code check if the chart is visible or not
return chart;

@ -157,9 +157,8 @@ nv.models.discreteBarChart = function() {
//TODO: decide if this makes sense to add into all the models for ease of updating (updating without needing the selection)
chart.update = function() {
selection.transition().call(chart);
}
chart.update = function() { selection.transition().call(chart); };
chart.container = this; // I need a reference to the container in order to have outside code check if the chart is visible or not
});

@ -159,6 +159,7 @@ nv.models.lineChart = function() {
//TODO: decide if this is a good idea, and if it should be in all models
chart.update = function() { chart(selection) };
chart.container = this; // I need a reference to the container in order to have outside code check if the chart is visible or not
return chart;

@ -223,6 +223,7 @@ nv.models.linePlusBarChart = function() {
chart.update = function() { selection.transition().call(chart) };
chart.container = this; // I need a reference to the container in order to have outside code check if the chart is visible or not
});

@ -276,6 +276,7 @@ nv.models.lineWithFocusChart = function() {
//TODO: decide if this is a good idea, and if it should be in all models
chart.update = function() { chart(selection) };
chart.container = this; // I need a reference to the container in order to have outside code check if the chart is visible or not
return chart;

@ -220,6 +220,7 @@ nv.models.multiBarChart = function() {
chart.update = function() { selection.transition().call(chart) };
chart.container = this; // I need a reference to the container in order to have outside code check if the chart is visible or not
});

@ -202,6 +202,7 @@ nv.models.multiBarHorizontalChart = function() {
//TODO: decide if this makes sense to add into all the models for ease of updating (updating without needing the selection)
chart.update = function() { selection.transition().call(chart) };
chart.container = this; // I need a reference to the container in order to have outside code check if the chart is visible or not
});

@ -64,9 +64,6 @@ nv.models.scatterChart = function() {
var container = d3.select(this),
that = this;
//TODO: decide if this makes sense to add into all the models for ease of updating (updating without needing the selection)
chart.update = function() { selection.transition().call(chart) };
var availableWidth = (width || parseInt(container.style('width')) || 960)
- margin.left - margin.right,
@ -296,6 +293,12 @@ nv.models.scatterChart = function() {
x0 = x.copy();
y0 = y.copy();
//TODO: decide if this makes sense to add into all the models for ease of updating (updating without needing the selection)
chart.update = function() { selection.transition().call(chart) };
chart.container = this; // I need a reference to the container in order to have outside code check if the chart is visible or not
});
return chart;

@ -45,9 +45,6 @@ nv.models.stackedAreaChart = function() {
var container = d3.select(this),
that = this;
//TODO: decide if this makes sense to add into all the models for ease of updating (updating without needing the selection)
chart.update = function() { selection.transition().call(chart) };
var availableWidth = (width || parseInt(container.style('width')) || 960)
- margin.left - margin.right,
@ -202,6 +199,10 @@ nv.models.stackedAreaChart = function() {
if (tooltips) dispatch.on('tooltipHide', nv.tooltip.cleanup);
//TODO: decide if this makes sense to add into all the models for ease of updating (updating without needing the selection)
chart.update = function() { selection.transition().call(chart) };
chart.container = this; // I need a reference to the container in order to have outside code check if the chart is visible or not
});

Loading…
Cancel
Save