fossasia / pslab-webapp

PSLab Web App https://pslab.io
Apache License 2.0
1.48k stars 42 forks source link

added underscore dependency and enabled array manipulations #69

Closed jithinbp closed 7 years ago

jithinbp commented 7 years ago

psl_virt_plot_array


small change I'm unable to make : Can't call the replot method on an existing plot

// alert(JSON.stringify($(`#${actionDefinition.success.target}`).data(), null, 4));
// $(`#${actionDefinition.success.target}`).data('jqplot').replot({ data: [_.zip.apply(null, resultValue)] });
$.jqplot(actionDefinition.success.target, [_.zip.apply(null, resultValue)]).replot();

Uncomment the alert to see that data attached to the jquery selector is {} even though the plot was created in that div by a component. The selector works fine with a regular small js snippet, and according to the docs, it is the correct way to update a plot. @niranjan94 any suggestions on why there seem to be no methods attached to the selector (I've cross checked with chrome's inspector) ? Another way is to store a global variable referencing the plot, but I would prefer the selector.

fixed #68