MCPcopy Create free account
hub / github.com/angular-rust/ux-charts / create_entity

Method create_entity

src/line.rs:1167–1205  ·  view source on GitHub ↗
(
        &self,
        channel_index: usize,
        entity_index: usize,
        value: Option<D>,
        color: Color,
        highlight_color: Color,
    )

Source from the content-addressed store, hash-verified

1165 }
1166
1167 fn create_entity(
1168 &self,
1169 channel_index: usize,
1170 entity_index: usize,
1171 value: Option<D>,
1172 color: Color,
1173 highlight_color: Color,
1174 ) -> LinePoint<D> {
1175 let props = self.props.borrow();
1176
1177 let x = self.xlabel_x(entity_index) + props.xlabel_hop / 2.;
1178 let old_y = props.xaxis_top;
1179
1180 // let formatted_value = if value != 0 {
1181 // entity_value_formatter(value)
1182 // } else {
1183 // null
1184 // };
1185
1186 // old_cp1 and old_cp2 are calculated in `update_channel`
1187 LinePoint {
1188 index: entity_index,
1189 old_value: None,
1190 value,
1191 // formatted_value,
1192 color,
1193 highlight_color,
1194 old_x: x,
1195 old_y,
1196 old_cp1: Default::default(),
1197 old_cp2: Default::default(),
1198 cp1: Default::default(),
1199 cp2: Default::default(),
1200 old_point_radius: 9.,
1201 x,
1202 y: self.value_to_y(value),
1203 point_radius: self.base.options.channel.markers.size,
1204 }
1205 }
1206
1207 fn create_channels(&self, start: usize, end: usize) {
1208 let mut start = start;

Callers 1

create_entitiesMethod · 0.45

Calls 2

xlabel_xMethod · 0.45
value_to_yMethod · 0.45

Tested by

no test coverage detected