Skip to content

Commit

Permalink
Revert "Added macros "df_transposed" to transpose vectors (mixed data…
Browse files Browse the repository at this point in the history
… type) into Echarts dataframe format."

This reverts commit 86c41a1.
  • Loading branch information
humphreylee committed Jul 31, 2024
1 parent f410e84 commit 9f3c796
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions charming/src/datatype/dataframe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,43 +69,3 @@ macro_rules! df {
]
};
}

#[macro_export]
macro_rules! df_transposed {
($([$($x:expr),*]),* $(,)?) => {

// Determine the length of the vectors (assuming they are all the same length)
let len = $crate::vec_len!($($col),*);

// Create a vector to store the resulting rows
let mut rows = Vec::with_capacity(len);

// Iterate over the length of the vectors
for i in 0..len {
vec![
$(
$crate::datatype::DataPoint::from($crate::datatype::CompositeValue::from(vec![
$(
$crate::datatype::CompositeValue::from($x[i].clone())
),*
]))
),*
]
}
};
($($x:expr),* $(,)?) => {
vec![
$(
$crate::datatype::DataPoint::from($x)
),*
]
};
}

#[macro_export]
macro_rules! vec_len {
($first:expr $(, $rest:expr)*) => {
$first.len()
};
}

0 comments on commit 9f3c796

Please sign in to comment.