Skip to content

Commit

Permalink
Consistent naming of visualization (#7124)
Browse files Browse the repository at this point in the history
  • Loading branch information
hubertp authored Jun 26, 2023
1 parent ae4666c commit 4e5cb9c
Show file tree
Hide file tree
Showing 99 changed files with 2,030 additions and 2,030 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

Enso is an award-winning interactive programming language with dual visual and
textual representations. It is a tool that spans the entire stack, going from
high-level visualisation and communication to the nitty-gritty of backend
high-level visualization and communication to the nitty-gritty of backend
services, all in a single language. Watch the following introduction video to
learn what Enso is, and how it helps companies build data workflows in minutes
instead of weeks.
Expand Down
2 changes: 1 addition & 1 deletion app/gui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

Enso is an award-winning interactive programming language with dual visual and
textual representations. It is a tool that spans the entire stack, going from
high-level visualisation and communication to the nitty-gritty of backend
high-level visualization and communication to the nitty-gritty of backend
services, all in a single language. Watch the following introduction video to
learn what Enso is, and how it helps companies build data workflows in minutes
instead of weeks.
Expand Down
6 changes: 3 additions & 3 deletions app/gui/controller/engine-protocol/src/binary/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::binary::message::FromServerPayloadOwned;
use crate::binary::message::MessageFromServerOwned;
use crate::binary::message::MessageToServerRef;
use crate::binary::message::ToServerPayload;
use crate::binary::message::VisualisationContext;
use crate::binary::message::VisualizationContext;
use crate::common::error::UnexpectedMessage;
use crate::handler::Disposition;
use crate::handler::Handler;
Expand Down Expand Up @@ -44,7 +44,7 @@ pub enum Notification {
/// A new data has been sent for a visualization.
VisualizationUpdate {
/// Identifies the specific visualization.
context: VisualisationContext,
context: VisualizationContext,
/// Data to be passed to the visualization.
data: Vec<u8>,
},
Expand Down Expand Up @@ -371,7 +371,7 @@ mod tests {
fixture.executor.run_until_stalled();
event_fut.expect_pending();

let context = VisualisationContext {
let context = VisualizationContext {
visualization_id: Uuid::new_v4(),
expression_id: Uuid::new_v4(),
context_id: Uuid::new_v4(),
Expand Down
6 changes: 3 additions & 3 deletions app/gui/controller/engine-protocol/src/binary/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl<T> MessageFromServer<T> {
/// Identifies the visualization in the update message.
#[allow(missing_docs)]
#[derive(Clone, Debug, Copy, PartialEq, Eq)]
pub struct VisualisationContext {
pub struct VisualizationContext {
pub visualization_id: Uuid,
pub context_id: Uuid,
pub expression_id: Uuid,
Expand Down Expand Up @@ -110,7 +110,7 @@ pub enum ToServerPayloadOwned {
pub enum FromServerPayloadOwned {
Error { code: i32, message: String, data: Option<ErrorPayload> },
Success {},
VisualizationUpdate { context: VisualisationContext, data: Vec<u8> },
VisualizationUpdate { context: VisualizationContext, data: Vec<u8> },
FileContentsReply { contents: Vec<u8> },
WriteBytesReply { checksum: EnsoDigest },
ReadBytesReply { checksum: EnsoDigest, bytes: Vec<u8> },
Expand Down Expand Up @@ -149,7 +149,7 @@ pub enum ToServerPayload<'a> {
pub enum FromServerPayload<'a> {
Error { code: i32, message: &'a str, data: Option<ErrorPayload> },
Success {},
VisualizationUpdate { context: VisualisationContext, data: &'a [u8] },
VisualizationUpdate { context: VisualizationContext, data: &'a [u8] },
FileContentsReply { contents: &'a [u8] },
WriteBytesReply { checksum: EnsoDigest },
ReadBytesReply { checksum: EnsoDigest, bytes: &'a [u8] },
Expand Down
36 changes: 18 additions & 18 deletions app/gui/controller/engine-protocol/src/binary/serialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,22 @@ impl<'a> SerializableDeserializableObject<'a> for Vec<String> {
}


// === impl VisualisationContext ===
// === impl VisualizationContext ===

impl<'a> SerializableDeserializableObject<'a> for message::VisualisationContext {
type Out = VisualisationContext<'a>;
impl<'a> SerializableDeserializableObject<'a> for message::VisualizationContext {
type Out = VisualizationContext<'a>;
fn serialize(&self, builder: &mut FlatBufferBuilder<'a>) -> WIPOffset<Self::Out> {
VisualisationContext::create(builder, &VisualisationContextArgs {
visualisationId: Some(&self.visualization_id.into()),
VisualizationContext::create(builder, &VisualizationContextArgs {
visualizationId: Some(&self.visualization_id.into()),
expressionId: Some(&self.expression_id.into()),
contextId: Some(&self.context_id.into()),
})
}

fn deserialize(fbs: Self::Out) -> Result<Self, DeserializationError> {
Ok(message::VisualisationContext {
Ok(message::VisualizationContext {
context_id: fbs.contextId().into(),
visualization_id: fbs.visualisationId().into(),
visualization_id: fbs.visualizationId().into(),
expression_id: fbs.expressionId().into(),
})
}
Expand Down Expand Up @@ -325,9 +325,9 @@ impl SerializableUnion for FromServerPayloadOwned {
FromServerPayloadOwned::VisualizationUpdate { data, context } => {
let data = builder.create_vector(data);
let context = context.serialize(builder);
VisualisationUpdate::create(builder, &VisualisationUpdateArgs {
VisualizationUpdate::create(builder, &VisualizationUpdateArgs {
data: Some(data),
visualisationContext: Some(context),
visualizationContext: Some(context),
})
.as_union_value()
}
Expand Down Expand Up @@ -362,7 +362,7 @@ impl SerializableUnion for FromServerPayloadOwned {
FromServerPayloadOwned::FileContentsReply { .. } =>
OutboundPayload::FILE_CONTENTS_REPLY,
FromServerPayloadOwned::VisualizationUpdate { .. } =>
OutboundPayload::VISUALISATION_UPDATE,
OutboundPayload::VISUALIZATION_UPDATE,
FromServerPayloadOwned::WriteBytesReply { .. } => OutboundPayload::WRITE_BYTES_REPLY,
FromServerPayloadOwned::ReadBytesReply { .. } => OutboundPayload::READ_BYTES_REPLY,
FromServerPayloadOwned::ChecksumBytesReply { .. } =>
Expand Down Expand Up @@ -424,12 +424,12 @@ impl<'a> DeserializableUnionField<'a, OutboundMessage<'a>> for FromServerPayload
})
}
OutboundPayload::SUCCESS => Ok(FromServerPayload::Success {}),
OutboundPayload::VISUALISATION_UPDATE => {
let payload = message.payload_as_visualisation_update().unwrap();
let context = payload.visualisationContext();
OutboundPayload::VISUALIZATION_UPDATE => {
let payload = message.payload_as_visualization_update().unwrap();
let context = payload.visualizationContext();
Ok(FromServerPayload::VisualizationUpdate {
data: payload.data(),
context: message::VisualisationContext::deserialize(context)?,
context: message::VisualizationContext::deserialize(context)?,
})
}
OutboundPayload::WRITE_BYTES_REPLY => {
Expand Down Expand Up @@ -531,12 +531,12 @@ impl<'a> DeserializableUnionField<'a, OutboundMessage<'a>> for FromServerPayload
})
}
OutboundPayload::SUCCESS => Ok(FromServerPayloadOwned::Success {}),
OutboundPayload::VISUALISATION_UPDATE => {
let payload = message.payload_as_visualisation_update().unwrap();
let context = payload.visualisationContext();
OutboundPayload::VISUALIZATION_UPDATE => {
let payload = message.payload_as_visualization_update().unwrap();
let context = payload.visualizationContext();
Ok(FromServerPayloadOwned::VisualizationUpdate {
data: Vec::from(payload.data()),
context: message::VisualisationContext::deserialize(context)?,
context: message::VisualizationContext::deserialize(context)?,
})
}
OutboundPayload::WRITE_BYTES_REPLY => {
Expand Down
Loading

0 comments on commit 4e5cb9c

Please sign in to comment.