File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
different-images-per-label Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 55
66const IMG_ID = 'img_uniq'
77// TODO: use your own keys and values here for label lookup and data objects to display
8- const imagesRoot = '/static/custom-scripts/custom-scripts/show_different_images_based_on_label_selected /img'
8+ const imagesRoot = '/static/custom-scripts/custom-scripts/different-images-per-label /img'
99const images = {
1010 'Addressee' : `${ imagesRoot } /demo-addressee.jpg` ,
1111 'Account number' : `${ imagesRoot } /demo-routing-number.png` ,
Original file line number Diff line number Diff line change 2222<!--
2323{
2424 "data": {
25- "image": "/static/custom-scripts/custom-scripts/show_different_images_based_on_label_selected /img/demo-sample.png"
25+ "image": "/static/custom-scripts/custom-scripts/different-images-per-label /img/demo-sample.png"
2626 }
2727}
2828-->
Original file line number Diff line number Diff line change 55await LSI . import ( 'https://cdn.plot.ly/plotly-2.26.0.min.js' , 'sha384-xuh4dD2xC9BZ4qOrUrLt8psbgevXF2v+K+FrXxV4MlJHnWKgnaKoh74vd/6Ik8uF' , ) ;
66
77let data = LSI . task . data ;
8- if ( window . Plotly && data ) {
8+ if ( ! window . Plotly || ! data ) {
9+ Htx . showModal ( "Plotly data not found in task" , "error" ) ;
10+ }
11+
12+ try {
913 Plotly . newPlot ( "plot" , [ data . plotly ] ) ;
14+ } catch ( error ) {
15+ Htx . showModal ( `Error loading Plotly: ${ error . message } ` , "error" ) ;
1016}
You can’t perform that action at this time.
0 commit comments