USEPA / ckanext-plotly

2 stars 2 forks source link

Unable to generate a view #1

Open BENETNATH opened 2 years ago

BENETNATH commented 2 years ago

Hello, I've just installed ckan through docker I wanted to add a good way to visualize the dataset that I'm uploading. I installed the plugin, but I'm not able to build the editor inside the docker npm is installed npm build gives me an error :

0 info it worked if it ends with ok 1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build' ] 2 info using npm@6.14.17 3 info using node@v14.20.0 4 verbose run-script [ 'prebuild', 'build', 'postbuild' ] 5 info lifecycle CKAN-plotly-editor@0.2.0-prebuild: CKAN-plotly-editor@0.2.0 6 info lifecycle CKAN-plotly-editor@0.2.0-build: CKAN-plotly-editor@0.2.0 7 verbose lifecycle CKAN-plotly-editor@0.2.0-build: unsafe-perm in lifecycle true 8 verbose lifecycle CKAN-plotly-editor@0.2.0-build: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/srv/app/ckanext-plotly/editor_app/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 9 verbose lifecycle CKAN-plotly-editor@0.2.0-build: CWD: /srv/app/ckanext-plotly/editor_app 10 silly lifecycle CKAN-plotly-editor@0.2.0-build: Args: [ '-c', 'react-scripts build' ] 11 info lifecycle CKAN-plotly-editor@0.2.0-build: Failed to exec build script 12 verbose stack Error: CKAN-plotly-editor@0.2.0 build: react-scripts build 12 verbose stack spawn ENOENT 12 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18) 12 verbose stack at ChildProcess.emit (events.js:400:28) 12 verbose stack at maybeClose (internal/child_process.js:1088:16) 12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5) 13 verbose pkgid CKAN-plotly-editor@0.2.0 14 verbose cwd /srv/app/ckanext-plotly/editor_app/src 15 verbose Linux 5.4.0-122-generic 16 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "build" 17 verbose node v14.20.0 18 verbose npm v6.14.17 19 error code ELIFECYCLE 20 error syscall spawn 21 error file sh 22 error errno ENOENT 23 error CKAN-plotly-editor@0.2.0 build: react-scripts build 23 error spawn ENOENT 24 error Failed at the CKAN-plotly-editor@0.2.0 build script. 24 error This is probably not a problem with npm. There is likely additional logging output above. 25 verbose exit [ 1, true ]

plugin is correctly displayed but when I want to create a view, I've got an error "Plotly config: Invalid JSON string near line 1 column 1, Expecting value" I guess it's because my plotly configuration field is empty.

Any help ?

pdekraker-epa commented 2 years ago

The plotly configuration specifies what to plot and how it should be displayed, and there are a couple methods to generate it.

You can build the json by hand, which is more tedious, but I mention it as doing so offers more customization. The top level of the configuration JSON dictionary can have three keys: traces, layout and config. Traces specifies what to plot via a list of items. You can look at the plotly.js examples for some of the details on what is needed for the various chart types. Note that to connect with your data where the example might use x and y the extension will use xsrc and ysrc where you can specify the column from the datastore to plot,

The easier way, is to use the Open Graphical Editor button under the configuration text box. After constructing the desired plot click save and you should return to see the configuration populated with the setup you created.

Hope it helps

BENETNATH commented 2 years ago

Thanks, sadly I can't build the graphical editor, so the button is not working

BENETNATH commented 2 years ago

ok, I managed to have it working ! (needed to install node on the alpine docker and build it and find the good setup) Is there a way to keep the settings in the chart explorer once you define it ?