spotfiresoftware / spotfire-mods

Spotfire® Mods
https://spotfiresoftware.github.io/spotfire-mods/
Other
54 stars 41 forks source link

"Create Visualization Mod" Option is Grayed Out #81

Closed KenACollins closed 2 years ago

KenACollins commented 2 years ago

Hi, I am trying to follow the first tutorial for Spotfire Mods, "Create a bar chart using Google Charts" at URL https://tibcosoftware.github.io/spotfire-mods/docs/tutorials/barchart-googlechart/ but I hit a snag right in the beginning. I cannot select Tools > Development > Create visualization mod. The option is grayed out. For the record the other option Tools > Development > Enable development for mods in analysis is also grayed out.

Spotfire Mods Options Are Grayed Out under Tools

I am logged into a Spotfire 11 staging server so I know Spotfire Mods is supported. Do I need to ask an administrator for some special rights?

I found a workaround. If I connect any random data source, then when I return to Tools > Development I am suddenly able to select Create visualization mod and proceed with the demo. But this is a hack and I end up with the demo chart along with a legend representing the data in the connection I made.

objerke commented 2 years ago

Thank you @KenACollins for reaching out with these issues in the tutorial. We appreciate when you share hurdles in the documentation or the API.

The tutorial includes a dataset section early on which is needed in order for the tutorial to work as expected. I have now added a section in the "initial setup" list where this is mentioned image

Spotfire Visualization mods are as the name suggests Spotfire visualizations. A visualization requires an opened analysis file in order to be to be added. Your hack of loading data or an existing analysis is not a hack but in fact a requirement to get started with development. The reason for this is to get a live feedback loop when developing, against data you know, and to easier see what happens when the data is marked, filtered or transformed.

KenACollins commented 2 years ago

Hi Olof (@objerke),

Okay, I can see your point that data must be loaded first. I did load the heroes.txt file. However, the reason why I found this to be an odd prerequisite is because the demo shows that the data can be specified entirely in the main.js file:

var data = google.visualization.arrayToDataTable([
    ["Element", "Density", { role: "style" }],
    ["Copper", 8.94, "#b87333"],
    ["Silver", 10.49, "silver"],
    ["Gold", 19.3, "gold"],
    ["Platinum", 21.45, "color: #e5e4e2"]
]);

So what was happening was until I reached the point where we get rid of that hardcoded data and focus on the heroes.txt data, I had both the precious metals bar chart AND the heroes legend on the screen at all times.