You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
as you can see in the above there is no unique id to link to this item. I'm trying to make a table that displays the same information as the graph. So if you click on an element in the table it makes the item on the graph 'grow' or become more visible. However; if the item is a small one as in the above, there is no way to select that item and change the shape or traits of the DOM.
However, in bigger items that have a label attached to them, there is an id.
Example:
Is there any plans on making a unique id for the rect class? IE "d3plus_rect_Some_generic_quiz_rect". This will help me out greatly when I'm trying to locate the item using jquery from the datatable script I already have made.
Example:
$(document).ready(function(){vartable=$("#table").DataTable({data: radarValues,columns: [{data: "quiz",title: "Quiz Name"},{data: "avg",title: "Average Score"},{data: "taken",title: "How Many Times Taken"}]});//onclick function to find and make circles bigger. $("#table tbody").on("click","tr",function(){//code to find element on form and enlarge it.vardata=table.row(this).data();if($(this).css("background-color")!="rgb(255, 255, 0)"){$(this).css("background-color","yellow");varstr=data.quiz;//get ride of the & signsstr=str.replace("&","and")vareleToEnlarge="#d3plus_label_"+str.replace(/\s/g,"_")+"_rect";//var element = $(eleToEnlarge).varrect=$(eleToEnlarge).closest(".d3plus_data");console.log("eleToEnlarge",eleToEnlarge);console.log("rect",rect);//set the heightvarheight=rect.attr("height");varwidth=rect.attr("width");rect.attr("height",height+10);rect.attr("width",width+10);}else{$(this).css("background-color","white");varstr=data.quiz;//get ride of the & signsstr=str.replace("&","and")vareleToEnlarge="#d3plus_label_"+str.replace(/\s/g,"_")+"_rect";varrect=$(eleToEnlarge).closest("rect");//var rect = element.closest(".d3plus_data");//set the heightvarheight=rect.attr("height");varwidth=rect.attr("width");rect.attr("height",height-10);rect.attr("width",width-10);}});//end of onclick function});//end of document ready
sorry for the formatting of the jQuery I copied it over from Eclipse and the tabs stayed. I'm a little two lazy to back space all the lines. I know, not really an excuse, but it's Friday.
Also here is the code for the call to d3plus. This is being generated by php, after the data is pulled from mongo and formatted to json.
varradarValues=['.$stringForJsonRadar.']varvisualization=d3plus.viz().container("'.$docID.'").data(radarValues).type("scatter").id("quiz").x("taken").y("avg").size("taken").descs({"taken":"How many times a test was taken","avg": "The avg grade per attempt"}).tooltip(["taken","avg"]).draw()
The text was updated successfully, but these errors were encountered:
Instead of jumping around trying to assign a standard ID to all shape types, I just applied an unique ID to each data <g>. This fix will be part of the next release. 🍻
That was something I was thinking of after making the request, because it makes more sense. Thanks! Will help me out a load, with these graphs I'm making.
bryanph
pushed a commit
to bryanph/d3plus
that referenced
this issue
May 18, 2016
This is more of a feature request. On smaller objects in say a scatter plot, there is no id to try and link to using jquery.
Example:
as you can see in the above there is no unique id to link to this item. I'm trying to make a table that displays the same information as the graph. So if you click on an element in the table it makes the item on the graph 'grow' or become more visible. However; if the item is a small one as in the above, there is no way to select that item and change the shape or traits of the DOM.
However, in bigger items that have a label attached to them, there is an id.
Example:
Is there any plans on making a unique id for the rect class? IE "d3plus_rect_Some_generic_quiz_rect". This will help me out greatly when I'm trying to locate the item using jquery from the datatable script I already have made.
Example:
sorry for the formatting of the jQuery I copied it over from Eclipse and the tabs stayed. I'm a little two lazy to back space all the lines. I know, not really an excuse, but it's Friday.
Also here is the code for the call to d3plus. This is being generated by php, after the data is pulled from mongo and formatted to json.
The text was updated successfully, but these errors were encountered: