Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I´m using this piece of code in order to select values inside my extension
svg.selectAll("text") | |||||
.data(words) | |||||
.enter().append("text") | |||||
.style("fill", function (d, i) { return fill(i); }) | |||||
.attr("text-anchor", "middle") | |||||
.on("click", function(d, i) { qv.selectValues(0,[d.text.trim()],true) }) | |||||
.attr("transform", function (d) { return "translate(" + [d.x, d.y] + ") rotate(" + d.rotate + ")"; }) | |||||
.style("font-size", function (d) { return d.size + "px"; }) | |||||
.text(function (d) { return d.text;}) | |||||
.append("svg:title").text(function (d) { return d.text + ':' + d.value; }); |
this method qv.selectValues(0,[d.text.trim()],true) is beeing called on 'click' event (please see the attached image), shows the selection toolbar and one error is generated.
Using devTools I could see the error code
<p class="dm-p" q-translation="ErrorCode.-32602">Parâmetros inválidos de protocolo JSON</p>
Could anyone help me?
Hi,
When selecting values you need to refer to the qElemNumber value rather than the text itself. The JSON error you're getting is probably because you're passing a text array to the selectValues function. In your code you need to map the qElemValue from the dimension and use that.
I've forked the solution on git and applied the code, if you'd like to see it working I can commit the changes submit a pull request.
I hope that helps.
Thanks
Nick
Please show me your solution
I have submitted a pull request in git with the changes I've made. I may getting a reference to the extension ("Qv" variable) in a different way to you but hopefully it demonstrates how to execute the selection.
Thanks
Nick