Skip to content
This repository has been archived by the owner on Oct 14, 2022. It is now read-only.

Sankey -- TypeError: Func is not a constructor. #75

Open
freaksN opened this issue Apr 27, 2018 · 4 comments
Open

Sankey -- TypeError: Func is not a constructor. #75

freaksN opened this issue Apr 27, 2018 · 4 comments

Comments

@freaksN
Copy link

freaksN commented Apr 27, 2018

I know that SgVizler supports all the major chart types offered by the Google Visualization API. I was wondering if Sankey Diagrams were also supported. I've tried to use sankey diagrams but the console spits out an error google.visualization.Sankey -- TypeError: Func is not a constructor. I've also checked the class in the Google API and it says that in order to load this diagram you need to load the class name
google.visualization.Sankey. So it shouldn't be a typo on my side.

@freaksN
Copy link
Author

freaksN commented May 1, 2018

After little more research I've found out that google.visualization.WordTree produces the same error google.visualization.WordTree-- TypeError: Func is not a constructor.

How can I send the query and get the results through sgvlizler and then use these functions ? What would be way to configure this in the script ?

@mgskjaeveland
Copy link
Owner

I see now that my reply by email to github has not appeared. Here is what is wrote to your first post:

This visualisation function is not registered in Sgvizler (just because it is was not available at the time Sgvizler was developed).

Try to add it to registry.js, which specifies the google libraries required to load:

registry = {
  google: {
    visualization: {
      DataTable: { t: 'core',
                   d: { i: GVIZ }
      },

      ...

      Sankey: { d: { i: 'sankey' } }

For Wordtree, try to set WordTree: { d: { i: 'wordtree' } }.

@freaksN
Copy link
Author

freaksN commented May 1, 2018

@mgskjaeveland Thanks for your suggestion. Yes this seems to be the right way but in order it to function properly sgvizler.js Line 715 needs to be changed as well. Just add the following there too.
registry = {
google: {
visualization: {
DataTable: { t: 'core',
d: { i: GVIZ }
}, ....... Sankey: { d: { i: 'sankey' } }

@freaksN
Copy link
Author

freaksN commented May 1, 2018

Do you know how could I add sankey.node.colors and sankey.link.colors to the options menu ?
endpointURL("http://data.linkedmdb.org/sparql") .endpointOutputFormat("jsonp") .chartFunction("google.visualization.ColumnChart") .chartWidth(1100) .chartHeight(1100) something like
.nodeColors .nodeLink ???

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants