File tree 3 files changed +9
-3
lines changed
different-images-per-label
3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 5
5
6
6
const IMG_ID = 'img_uniq'
7
7
// 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'
9
9
const images = {
10
10
'Addressee' : `${ imagesRoot } /demo-addressee.jpg` ,
11
11
'Account number' : `${ imagesRoot } /demo-routing-number.png` ,
Original file line number Diff line number Diff line change 22
22
<!--
23
23
{
24
24
"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"
26
26
}
27
27
}
28
28
-->
Original file line number Diff line number Diff line change 5
5
await LSI . import ( 'https://cdn.plot.ly/plotly-2.26.0.min.js' , 'sha384-xuh4dD2xC9BZ4qOrUrLt8psbgevXF2v+K+FrXxV4MlJHnWKgnaKoh74vd/6Ik8uF' , ) ;
6
6
7
7
let 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 {
9
13
Plotly . newPlot ( "plot" , [ data . plotly ] ) ;
14
+ } catch ( error ) {
15
+ Htx . showModal ( `Error loading Plotly: ${ error . message } ` , "error" ) ;
10
16
}
You can’t perform that action at this time.
0 commit comments