MCPcopy Index your code
hub / github.com/askanium/rustplotlib / extract_keys

Method extract_keys

src/views/horizontal_bar.rs:151–163  ·  view source on GitHub ↗

Extract the list of keys to use when stacking and coloring the bars.

(data: &Vec<impl BarDatum>)

Source from the content-addressed store, hash-verified

149
150 /// Extract the list of keys to use when stacking and coloring the bars.
151 fn extract_keys(data: &Vec<impl BarDatum>) -> Vec<String> {
152 let mut keys = Vec::new();
153 let mut map = HashMap::new();
154
155 for datum in data.iter() {
156 match map.insert(datum.get_key(), 0) {
157 Some(_) => {},
158 None => keys.push(datum.get_key()),
159 }
160 }
161
162 keys
163 }
164
165 /// Add a [Bar] entry to the dataset entries list.
166 fn add_bar(&mut self, bar: Bar) {

Callers

nothing calls this directly

Calls 1

get_keyMethod · 0.80

Tested by

no test coverage detected