|
@ -35,8 +35,8 @@ Points.draw = function (dataset, group, framework, offset) { |
|
|
|
|
|
|
|
|
for (var i = 0; i < dataset.length; i++) { |
|
|
for (var i = 0; i < dataset.length; i++) { |
|
|
if (!callback) { |
|
|
if (!callback) { |
|
|
// draw the point the simple way.
|
|
|
|
|
|
DOMutil.drawPoint(dataset[i].x + offset, dataset[i].y, getGroupTemplate(), framework.svgElements, framework.svg, dataset[i].label); |
|
|
|
|
|
|
|
|
// draw the point the simple way.
|
|
|
|
|
|
DOMutil.drawPoint(dataset[i].x + offset, dataset[i].y, getGroupTemplate(), framework.svgElements, framework.svg, dataset[i].label); |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
var callbackResult = callback(dataset[i], group, framework); // result might be true, false or an object
|
|
|
var callbackResult = callback(dataset[i], group, framework); // result might be true, false or an object
|
|
@ -47,26 +47,27 @@ Points.draw = function (dataset, group, framework, offset) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function getGroupTemplate(callbackResult) { |
|
|
function getGroupTemplate(callbackResult) { |
|
|
callbackResult = (typeof callbackResult === 'undefined') ? {} : callbackResult; |
|
|
|
|
|
return { |
|
|
|
|
|
style: callbackResult.style || group.options.drawPoints.style, |
|
|
|
|
|
size: callbackResult.size || group.options.drawPoints.size, |
|
|
|
|
|
className: callbackResult.className || group.className |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
callbackResult = (typeof callbackResult === 'undefined') ? {} : callbackResult; |
|
|
|
|
|
return { |
|
|
|
|
|
style: callbackResult.style || group.options.drawPoints.style, |
|
|
|
|
|
styles: callbackResult.styles || group.options.drawPoints.styles, |
|
|
|
|
|
size: callbackResult.size || group.options.drawPoints.size, |
|
|
|
|
|
className: callbackResult.className || group.className |
|
|
|
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getCallback() { |
|
|
function getCallback() { |
|
|
var callback = undefined; |
|
|
|
|
|
|
|
|
var callback = undefined; |
|
|
// check for the graph2d onRender
|
|
|
// check for the graph2d onRender
|
|
|
if (framework.options.drawPoints.onRender && typeof framework.options.drawPoints.onRender == 'function') { |
|
|
if (framework.options.drawPoints.onRender && typeof framework.options.drawPoints.onRender == 'function') { |
|
|
callback = framework.options.drawPoints.onRender; |
|
|
|
|
|
|
|
|
callback = framework.options.drawPoints.onRender; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// override it with the group onRender if defined
|
|
|
// override it with the group onRender if defined
|
|
|
if (group.group.options && group.group.options.drawPoints && group.group.options.drawPoints.onRender && typeof group.group.options.drawPoints.onRender == 'function') { |
|
|
if (group.group.options && group.group.options.drawPoints && group.group.options.drawPoints.onRender && typeof group.group.options.drawPoints.onRender == 'function') { |
|
|
callback = group.group.options.drawPoints.onRender; |
|
|
|
|
|
|
|
|
callback = group.group.options.drawPoints.onRender; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return callback; |
|
|
return callback; |
|
|
} |
|
|
} |
|
|
}; |
|
|
}; |
|
|