-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more construals to offline projects and fix a selector bug
- Loading branch information
Showing
20 changed files
with
8,943 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
480 changes: 480 additions & 0 deletions
480
resources/projects/Arduino - Binary to Hexadecimal.js-e
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
/** | ||
* @title Start Your Model | ||
*/ | ||
action start {/* Enter some script here */ | ||
do @external Layouts > book; | ||
do :project > line; | ||
|
||
bookpic is picture; | ||
|
||
frame = 0; | ||
frame = 1; | ||
when (frame > 0) { | ||
wait 40; | ||
frame += 3; | ||
} | ||
|
||
waveform1 is 4*sin(x*10+frame) :: x in 1..100; | ||
waveform2 is sin(x*20+(9*frame)) :: x in 1..100; | ||
waveform3 is (0.3 * (waveform1[ix]-0.5 + waveform2[ix]-0.5))::ix in 1..100; | ||
waveform is [waveform1,waveform3]; | ||
|
||
demo_chart is LineChart; | ||
|
||
data is waveform; | ||
width is book_width - 100; | ||
height is book_height - 100; | ||
x = 50; | ||
y = 50; | ||
|
||
lc_y_axis_size = 2; | ||
lc_show_points = false; | ||
lc_show_line = true; | ||
lc_show_fill = true; | ||
lc_common_range = true; | ||
|
||
test1 is type(data[1]); | ||
|
||
picture is demo_chart; | ||
|
||
} | ||
|
||
do lib:unexecuted; | ||
if (jseden_project_mode == "restore") do :project > ACTIVE; | ||
if (jseden_project_mode != "safe") do :project > start; | ||
else createView("safemode","ScriptInput"); | ||
|
||
action ACTIVE { | ||
jseden_project_title = "Charts"; | ||
views_number_created = 0; | ||
jseden_autosave = false; | ||
jseden_leaveprompt = false; | ||
jseden_menu_visible = false; | ||
jseden_explorer_width = 0; | ||
jseden_explorer_zoom = 1; | ||
background_audio = Audio("background_audio", true); | ||
background_audio_paused = false; | ||
background_audio_chapter = "start"; | ||
background_audio_chapters = Object(); | ||
background_audio_looping = false; | ||
background_audio_position = Point(0, 0); | ||
background_audio_speed = 1; | ||
background_audio_time = 0; | ||
background_audio_volume = 1; | ||
plugins_html_loaded = true; | ||
mouseVelocity = Point(0, 0); | ||
jseden_project_name = "Charts"; | ||
jseden_project_thumb = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAABwCAYAAABbwT+GAAASW0lEQVR4Xu2deVRUR/bHvyACKqAi7qgkgihRNNFoiKhozLgrLphfzCSOo0bHJLPEOEZjThYd95gxcfmZqDmOY8YdNAajJ4IRl7gLAuISEUkEFZBF2QR6zn3YDkIv9V6/19D0fX/1OX3rVtWt+3mvlltVDtD40el0Oo2zYPV2bAEHBwcHLauvqXIqOAOiZfOxbgaEfYAtYMICDAi7B1uAAQESExMREBDAzsAWkGUBu/mCMCCy/IKFH1mAAWFXYAtwF4u7WEyBMgvwF0SZ3V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0wcxMTHCbe3j44NGjRrhwoULwmnCw8OxatUqHDp0SChNaWkp/Pz8cPDgQfj6+gqlIdk333wTQ4YMwdq1a4XSzJgxA5GRkbhx44aQPAlNnDgR7u7uUn1EnpKSEjg5OWHy5MnYsGGDSBJJJjAwEHFxccLyJEhtI6cud+/exSeffCJcl4qFsRtAMjIy4OzsDA8PD6HGINmgoCAcPnwYol/Z/Px81K9fX0g/CemdKiIiAqGhoULpSHbNmjWYO3cuQkJChNKQs2/atElIloTI+cgJ5TxUl0GDBiE2NhZka9GHXkLZ2dmi4pLcggULMG/ePOE0ZFuym5LHLgCZPn06li9fjgkTJmDv3r1CdmrSpAkSExMlOJo1E7tAZsCAAZg/fz569+4tlAc5VU5ODsLCwhAVFSWUhho6ODgYjo6O8PT0FEojFxBSSl+Bpk2bYuTIkUJ56GEfPnw49u3bJ5SGhOQCQrYqKioSbkfKIz09HZMmTcL+/fuFy6UXtAtAZFuFE7AFHlmAAWFXYAuYsAADwu7BFmBA2AfYAsoswF8QZXbjVHZiAQbEThqaq6nMAgyIMrtxKjuxAANiJw3N1VRmAa0B+S+/ezH4oRbETwAAAABJRU5ErkJggg=="; | ||
jseden_project_author = "Nicolas Pope"; | ||
views_list = ["safemode"]; | ||
view_safemode_visibility = "visible"; | ||
view_safemode_title = "Script View"; | ||
view_safemode_tabs = [":project"]; | ||
view_safemode_current = 0; | ||
view_safemode_showtabs = true; | ||
view_safemode_showbuttons = true; | ||
view_safemode_query is jseden_script_query; | ||
view_safemode_type = "ScriptInput"; | ||
view_safemode_width = 600; | ||
view_safemode_height = 405; | ||
view_safemode_x = 659; | ||
view_safemode_y = 220.5; | ||
} | ||
|
||
action line {lc_left_bar is Line(lc_x, y, lc_x, y+height,lc_axiscolour,Object("lineWidth",lc_y_axis_size)) | ||
if lc_y_axis_size > 0 else @; | ||
lc_bottom_bar is Line(x, y+lc_height, x+width, y+lc_height,lc_axiscolour,Object("lineWidth",lc_x_axis_size)) | ||
if lc_x_axis_size > 0 else @; | ||
lc_left is [lc_left_bar]; | ||
lc_bottom is [lc_bottom_bar]; | ||
lc_axisopts is Object("lineWidth",lc_axissize); | ||
|
||
lc_labely is Text(keys[i], lc_datapoint_x, y+height+lc_keysize, lc_keysize, "middle center"); | ||
lc_labelsy is (lc_labely :: i in 1..keys#) if keys else []; | ||
|
||
lc_numpoints is lc_dataset#; | ||
lc_maxval is max(lc_dataset) if type(data[1]) != "list" || !lc_common_range | ||
else max(max(data[k])::k in 1..data#); | ||
lc_minval is min(lc_dataset) if type(data[1]) != "list" || !lc_common_range | ||
else min(min(data[k])::k in 1..data#); | ||
lc_range is lc_maxval-lc_minval if lc_maxval-lc_minval > 0 else 1; | ||
lc_offsetx = 0; | ||
lc_scaley is 0.8; | ||
|
||
lc_linecolours = [ | ||
"rgba(0,133,188,1)", | ||
"rgba(188,24,24,1)" | ||
]; | ||
|
||
lc_fillcolours = [ | ||
"rgba(0,133,188,0.2)", | ||
"rgba(188,24,24,0.2)" | ||
]; | ||
|
||
lc_linecolour = "rgba(0,133,188,1)"; | ||
lc_fillcolour = "rgba(0,133,188,0.2)"; | ||
lc_linesize = 4; | ||
lc_axissize = 2; | ||
lc_x_axis_size is lc_axissize; | ||
lc_y_axis_size is lc_axissize; | ||
lc_y_axis_width is 20; | ||
lc_x_axis_height is 20; | ||
lc_axiscolour = "#aaa"; | ||
lc_keysize = 12; | ||
lc_width is width - lc_y_axis_width - 10; | ||
lc_height is height - lc_x_axis_height; | ||
lc_x is x+lc_y_axis_width; | ||
lc_y is y; | ||
lc_show_points = false; | ||
lc_show_fill = true; | ||
lc_show_line = true; | ||
lc_point_radius is lc_linesize * 0.75; | ||
lc_point_colour = "#222"; | ||
lc_common_range = false; | ||
|
||
lc_zeroy is lc_y+(lc_height * lc_scaley * (1.0 - ((0 - lc_minval)/lc_range)))+((1.0 - lc_scaley)*lc_height/2); | ||
|
||
lc_datapoint_x is lc_x+(lc_width / (lc_numpoints-1) * (i-1))-lc_offsetx; | ||
lc_datapoint_y is lc_y+(lc_height * lc_scaley * (1.0 - ((lc_dataset[i] - lc_minval)/lc_range)))+((1.0 - lc_scaley)*lc_height/2); | ||
lc_datapoint is Point(lc_datapoint_x, lc_datapoint_y); | ||
lc_points is lc_datapoint with i in 1..lc_dataset#; | ||
lc_polygonpoints is lc_points // [Point(lc_x+lc_width,lc_y+lc_height),Point(lc_x,lc_y+lc_height)]; | ||
lc_polygon is Polygon(lc_polygonpoints, lc_fillcolour, "transparent") | ||
if lc_show_fill else @; | ||
lc_lines is LineSequence(lc_points, lc_linecolour, Object("lineWidth",lc_linesize)) | ||
if lc_show_line else @; | ||
lc_points is (Circle(lc_datapoint_x, lc_datapoint_y, lc_point_radius, lc_point_colour) :: | ||
i in 1..lc_dataset#); | ||
|
||
lc_zeroline is Line(x, lc_zeroy, x+width, lc_zeroy,"black",Object("lineWidth",1)) | ||
if (lc_showzero && lc_zeroy > y && lc_zeroy < y+height) else @; | ||
|
||
lc_datacollection is [lc_polygon,lc_lines,lc_points if lc_show_points else @, lc_zeroline]; | ||
lc_dataelement is lc_datacollection:: | ||
lc_dataset is data[j], | ||
lc_linecolour is lc_linecolours[j], | ||
lc_fillcolour is lc_fillcolours[j]; | ||
lc_data is (lc_datacollection::lc_dataset=data) if (type(data[1]) != "list") | ||
else (lc_dataelement :: j in 1..data#); | ||
|
||
lc_showzero = true; | ||
|
||
LineChart is [lc_data,lc_left, lc_bottom, lc_labelsy];} |
Oops, something went wrong.