Skip to content
This repository has been archived by the owner on Dec 28, 2021. It is now read-only.

Add profiling mode to GUI #1546

Merged
merged 36 commits into from
Jun 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b55d610
Add profiling mode
s9ferech May 6, 2021
26984e6
Merge branch 'develop' into wip/fr/profiling
s9ferech May 6, 2021
4d35256
Include profiling shortcut in documentation
s9ferech May 6, 2021
798defb
Display profiling indicators in front of edges
s9ferech May 6, 2021
c02c45e
Fix formatting of CHANGELOG.md
s9ferech May 6, 2021
332d3cd
Move definition of ExecutionStatuses
s9ferech May 6, 2021
54004d8
Fix formatting
s9ferech May 7, 2021
1214dc7
Fix formatting
s9ferech May 7, 2021
dff8a4f
Fix formatting
s9ferech May 7, 2021
e89a093
Address some review comments
s9ferech May 7, 2021
b9b5a9d
Merge branch 'wip/fr/profiling' of https://github.com/enso-org/ide in…
s9ferech May 7, 2021
9e7e277
Remove identical conversion
s9ferech May 7, 2021
e264d8f
Disable syntax highlighting in profiling mode
s9ferech May 11, 2021
cf84b4a
Make requested changes
s9ferech May 16, 2021
3543f4c
Fix placement of profiling indicator
s9ferech May 17, 2021
a0c4b77
Gray out JS visualizations in profiling mode
s9ferech May 17, 2021
d76a471
Merge branch 'develop' into wip/fr/profiling
s9ferech May 17, 2021
7bd0376
Document `set_grayscale` on `DomScene`
s9ferech May 17, 2021
030fa56
Solve linting errors
s9ferech May 17, 2021
da1bc98
Make some of the requested changes
s9ferech May 20, 2021
c3cd76a
Make requested changes
s9ferech May 25, 2021
7aeab47
Fix FRP initializations
s9ferech May 25, 2021
659a68b
Rename running time label to profiling label
s9ferech May 25, 2021
c1c503e
Update edge colors less often
s9ferech May 26, 2021
ea12ada
Fix some color initializations and updates
s9ferech May 26, 2021
24a6001
Merge branch 'develop' into wip/fr/profiling
s9ferech May 26, 2021
bcfa122
Fix field order in struct constructions
s9ferech May 26, 2021
873c5c4
Fix text color when edited in profiling mode
s9ferech May 26, 2021
3ff04b5
Merge branch 'develop' into wip/fr/profiling
s9ferech May 27, 2021
4f19a29
Update for renamed definitions
s9ferech May 27, 2021
fdee41a
Fix cursor color after view mode switch
s9ferech May 27, 2021
1073d1a
Rename "mode" to "view mode"
s9ferech May 27, 2021
25ce8b0
Update CHANGELOG.md
s9ferech May 28, 2021
1a2917d
Make requested changes
s9ferech Jun 8, 2021
e4b6784
Merge branch 'develop' into wip/fr/profiling
s9ferech Jun 8, 2021
b329223
Merge branch 'develop' into wip/fr/profiling
s9ferech Jun 10, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

#### Visual Environment

- [Profling mode.][1546] The IDE contains a profiling mode now which can be
entered through a button in the top-right corner or through the keybinding
<kbd>ctrl</kbd>+<kbd>p</kbd>. This mode does not display any information yet.
In the future, it will display the running times of nodes and maybe more
useful statistics.
- [Signed builds.][1366] Our builds are signed and will avoid warnings from the
operating system about being untrusted.
- [Opening projects in application graphical interface][1587]. Press `cmd`+`o`
Expand Down
1 change: 1 addition & 0 deletions docs/product/shortcuts.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ further investigation.
| <kbd>ctrl</kbd>+<kbd>q</kbd> | Close the application (Linux) |
| <kbd>alt</kbd>+<kbd>F4</kbd> | Close the application (MacOS, Windows, Linux) |
| <kbd>ctrl</kbd>+<kbd>w</kbd> | Close the application (Windows, Linux) |
| :warning: <kbd>ctrl</kbd>+<kbd>p</kbd> | Toggle profiling mode |


#### Navigation
Expand Down
13 changes: 11 additions & 2 deletions src/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/rust/ensogl/lib/components/src/toggle_button.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ impl<Shape:ColorableShape+'static> ToggleButton<Shape>{
// === State ===

toggle <- any(frp.toggle,icon.mouse_down);
frp.source.state <+ toggle.toggle();
frp.source.state <+ frp.state.not().sample(&toggle);
s9ferech marked this conversation as resolved.
Show resolved Hide resolved
frp.source.state <+ frp.set_state;


Expand Down Expand Up @@ -242,6 +242,7 @@ impl<Shape:ColorableShape+'static> ToggleButton<Shape>{
eval color.value ((color) model.icon.set_color(color.into()));
}

frp.set_state.emit(false);
color.target_alpha.emit(0.0);
self
}
Expand Down
6 changes: 6 additions & 0 deletions src/rust/ensogl/lib/core/src/data/color/space/def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,12 @@ impl Lcha {
pub fn to_javascript_string(self) -> String {
Rgba::from(self).to_javascript_string()
}

/// Convert the color to grayscale by setting chroma to zero.
pub fn to_grayscale(mut self) -> Lcha {
self.data.opaque.chroma = 0.0;
self
}
}


Expand Down
2 changes: 1 addition & 1 deletion src/rust/ensogl/lib/core/src/display/object/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ impl<Host> Model<Host> {
// ==========

/// Globally unique identifier of a display object.
#[derive(Clone,CloneRef,Copy,Debug,Default,Display,Eq,From,Hash,Into,PartialEq)]
#[derive(Clone,CloneRef,Copy,Debug,Default,Display,Eq,From,Hash,Into,PartialEq,Ord,PartialOrd)]
pub struct Id(usize);


Expand Down
6 changes: 6 additions & 0 deletions src/rust/ensogl/lib/core/src/display/scene/dom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ impl DomScene {
self.data.dom.set_style_or_warn("z-index", z.to_string(), &self.logger);
}

/// Sets the CSS property `filter: grayscale({value})` on this element. A value of 0.0 displays
/// the element normally. A value of 1.0 will make the element completely gray.
pub fn filter_grayscale(&self, value:f32) {
self.data.dom.set_style_or_warn("filter",format!("grayscale({})",value),&self.logger);
}

/// Creates a new instance of DomSymbol and adds it to parent.
pub fn manage(&self, object:&DomSymbol) {
let dom = object.dom();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,41 @@ define_sdf_shapes! {
float dist = max(abs(position).x*norm.x + position.y*norm.y - height/2.0*norm.y, pos_y);
return bound_sdf(dist,bounding_box(width,height/2.0));
}


// === Uneven Capsule ===

/// An upright capsule shape with ends of independent width. In other words, the convex hull of
/// two circles where the radius of both circles can be chosen independently. The origin is at
/// the center of the lower circle.
///
/// # Arguments
/// * `radius_top` - Radius of the top circle.
/// * `radius_bottom` - Radius of the bottom circle.
/// * `inner_height` - Distance between the centers of the two circles.
UnevenCapsule (radius_top:Pixels, radius_bottom:Pixels, inner_height:Pixels) {
position.x = abs(position.x);
float b = (radius_bottom-radius_top) / inner_height;
float a = sqrt(1.0-b*b);
float k = dot(position,vec2(-b,a));
float dist;
if (k < 0.0) {
dist = length(position) - radius_bottom;
} else if (k > a * inner_height) {
dist = length(position-vec2(0.0,inner_height)) - radius_top;
} else {
dist = dot(position,vec2(a,b)) - radius_bottom;
}

float max_radius = max(radius_top,radius_bottom);
float min_x = -max_radius;
float max_x = max_radius;
float min_y = -radius_bottom;
float max_y = inner_height + radius_top;
BoundingBox bounds = bounding_box(min_x,max_x,min_y,max_y);

return bound_sdf(dist,bounds);
}
}


Expand Down
3 changes: 3 additions & 0 deletions src/rust/ensogl/lib/text/src/component.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
//! Visual components implementation.

pub mod area;
#[warn(missing_docs)]
mod selection;

pub use area::Area;
use selection::Selection;