Come ottenere l'effetto del cursore che punta al contenuto visualizzato su una pagina web utilizzando JSL in JMP?Grazie Esperti!
http://worldmap.ifnews.com/chinamap/china/fmap
h = [=>];
h["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36";
h["Accept"] = "application/json, text/javascript, */*; q=0.01";
h["Referer"] = "http://worldmap.ifnews.com/chinamap/china/fmap";
h["X-Requested-With"] = "XMLHttpRequest";
u = "http://worldmap.ifnews.com/chinamap/china/financialData?type=all";
rs = New HTTP Request(URL(u), Method("GET"), Headers(h));
rr = rs << Send;
If( !Is Missing( rr ),
txt = Blob To Char( rr );
dt = JSON To Data Table( txt );
dt << Set Name( "map" );
dt:price << Data Type( Numeric ) << Modeling Type( Continuous );
dt:priceLimit << Data Type( Numeric ) << Modeling Type( Continuous );
dt:changeAmount << Data Type( Numeric ) << Modeling Type( Continuous );
dt:countryCName << Set Property( "Map Role", {Map Role( NameName, Map Name( "World", "Countries" ) )} );
dt << Graph Builder(
Size( 800, 600 ),
Show Control Panel( 0 ),
Variables( Shape( :countryCName ), Color( :priceLimit ) ),
Elements( Map Shapes( Legend( 5 ) ) ),
SendToReport(
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
5,
Properties(
0,
{gradient(
{Color Theme( "Red to Green" ),
Reverse Gradient( 1 )}
)},
Item ID( "priceLimit", 1 )
)
)}
)
)
);
);

Automazione e scriptingRe: In che modo il JSL del software MP ottiene questo effetto sulle pagine web?Quale effetto? Quali pagine web?
Re: In che modo il JSL del software MP ottiene questo effetto sulle pagine web?Come ottenere l'effetto del cursore che punta al contenuto visualizzato su una pagina web utilizzando JSL in JMP?
http://worldmap.ifnews.com/chinamap/china/fmap 
Quando il cursore punta su un determinato intervallo di paesi sulla mappa, vengono visualizzati i dati
Grazie!
Re: In che modo il JSL del software MP ottiene questo effetto sulle pagine web?In JMP, questa funzione è implementata tramite etichette Hover:

Se hai bisogno di un aggiornamento più rapido e magari non ti piace l'aspetto di Hoverlabel Box, puoi usare Mousetrap.
Per ulteriori dettagli, vedere la risposta di @Craige_Hales a una domanda simile:
https://community.jmp.com/t5/Discussions/Can-JMP-graphics-have-this-effect/mp/810221/highlight/true#M99217
Re: In che modo il JSL del software MP ottiene questo effetto sulle pagine web?In alternativa, puoi modificare lo script "Immagine" di HoverLabel per attivare qualsiasi azione desideri:
- aprire una pagina web
- visualizzare ulteriori informazioni nel grafico
- apri un altro complotto ...
Ulteriori dettagli possono essere trovati in questo post:
Re: azioni tramite mouseover? - usa un tasto modificatore :backhand_index_pointing_right::white_square_button:
Il vantaggio di questo approccio:
Hoverlabel conosce il paese in cui si trova attualmente il mouse, non c'è bisogno di cercarlo:
:Country[local:_firstrow]
Re: In che modo il JSL del software MP ottiene questo effetto sulle pagine web?
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/World Demographics.jmp" );
mapxy = Open( "$MAPS/World-XY.jmp" );
mapname = Open( "$MAPS/World-Name.jmp" );
mapname << New Column( "X", Format( "Longitude DDD", "PUNDIR", 14, 4 ) );
mapname << New Column( "Y", Format( "Latitude DDD", "PUNDIR", 14, 4 ) );
For Each( {rw}, Index( 1, N Rows( mapname ) ),
shapeID = mapName:ShapeID[rw];
rws = mapxy << get rows where( :ShapeID == shapeID & :PartID == 1 );
xs = mapxy[rws, "X"];
ys = mapxy[rws, "Y"];
{x, y} = Polygon Centroid( xs, ys );
mapname:x[rw] = x;
mapname:y[rw] = y;
);
dt << Update( With( mapname ), Match Columns( :Territory = :Region ), Add Columns from Update Table( :X, :Y ) );
New Namespace(
"hover"
);
hover:GDP = 0;
hover:x = 0;
hover:y = 0;
gb = Graph Builder(
Variables( Color( :GDP per Capita ), Shape( :Territory ) ),
Elements( Map Shapes() ),
SendToReport(
Dispatch( {}, "", ScaleBox,
{Format( "Longitude DDD", "PUNDIR", 16 ), Min( 0 ), Max( 30 )}
),
Dispatch( {}, "", ScaleBox( 2 ),
{Format( "Latitude DDD", "PUNDIR", 16, 0 ), Min( 40 ), Max( 50 )}
),
Dispatch( {}, "Graph Builder", FrameBox,
{Set Graphlet(
Picture(
hover:GDP = :GDP per Capita[local:_firstrow];
hover:x = :X[local:_firstrow];
hover:y = :y[local:_firstrow];
//approach1: select the current country and trigger an update -> nice, but draggy
//local:_dataTable << Clear Select << select rows(local:_firstrow);
gb << inval;
gb << updatewindow;
)
)}
)
)
);
fb1 = Report( gb )[FrameBox( 1 )];
fb1 << addgraphicsscript(
x = hover:x;
y = hover:y;
Text( center justified, {hover:x, hover:y}, "GDP: " || Char( Round( hover:GDP ) ) );
);
Etichetta passante conosce la posizione attuale del mouse?
sfortunatamente, locale:_assex/_assey =0 .
Come soluzione alternativa ho utilizzato questo approccio
https://community.jmp.com/t5/Discussions/exporting-x-amp-y-values-coordinates-from-graph-builder-once-jmp/mp/193660/highlight/true#M41407 @johnmoore per calcolare il baricentro del paese, per mostrare il PIL.
In alternativa, è possibile utilizzare Mousetrap (oltre alla soluzione alternativa Hover Label) per ottenere la posizione del mouse.
Svantaggio: meno interattivo perché l'utente deve premere il pulsante del mouse.
Re: In che modo il JSL del software MP ottiene questo effetto sulle pagine web?Grazie Esperti! 