Remove styling: use css
parent
9087d3d81b
commit
bd53a0a6d9
|
@ -222,29 +222,13 @@ namespace gtsam {
|
|||
/* ************************************************************************ */
|
||||
string DecisionTreeFactor::html(const KeyFormatter& keyFormatter,
|
||||
const Names& names) const {
|
||||
const string style =
|
||||
"<style scoped=\'\'>\n"
|
||||
" .dataframe tbody tr th:only-of-type {\n"
|
||||
" vertical-align: middle;\n"
|
||||
" }\n"
|
||||
" .dataframe tbody tr th {\n"
|
||||
" vertical-align: top;\n"
|
||||
" }\n"
|
||||
" .dataframe thead th {\n"
|
||||
" text-align: right;\n"
|
||||
" }\n"
|
||||
"</style>\n";
|
||||
|
||||
stringstream ss;
|
||||
|
||||
// Print out preamble.
|
||||
ss << "<div>\n"
|
||||
<< style
|
||||
<< "<table border=\'1\' class=\'dataframe\'>\n"
|
||||
" <thead>\n";
|
||||
ss << "<div>\n<table class=\'DecisionTreeFactor\'>\n <thead>\n";
|
||||
|
||||
// Print out header row.
|
||||
ss << " <tr style=\'text-align: right;\'>";
|
||||
ss << " <tr>";
|
||||
for (auto& key : keys()) {
|
||||
ss << "<th>" << keyFormatter(key) << "</th>";
|
||||
}
|
||||
|
|
|
@ -161,21 +161,9 @@ TEST(DecisionTreeFactor, htmlWithValueFormatter) {
|
|||
DecisionTreeFactor f(A & B, "1 2 3 4 5 6");
|
||||
string expected =
|
||||
"<div>\n"
|
||||
"<style scoped=''>\n"
|
||||
" .dataframe tbody tr th:only-of-type {\n"
|
||||
" vertical-align: middle;\n"
|
||||
" }\n"
|
||||
" .dataframe tbody tr th {\n"
|
||||
" vertical-align: top;\n"
|
||||
" }\n"
|
||||
" .dataframe thead th {\n"
|
||||
" text-align: right;\n"
|
||||
" }\n"
|
||||
"</style>\n"
|
||||
"<table border='1' class='dataframe'>\n"
|
||||
"<table class='DecisionTreeFactor'>\n"
|
||||
" <thead>\n"
|
||||
" <tr style='text-align: "
|
||||
"right;'><th>A</th><th>B</th><th>value</th></tr>\n"
|
||||
" <tr><th>A</th><th>B</th><th>value</th></tr>\n"
|
||||
" </thead>\n"
|
||||
" <tbody>\n"
|
||||
" <tr><th>Zero</th><th>-</th><td>1</td></tr>\n"
|
||||
|
@ -191,11 +179,6 @@ TEST(DecisionTreeFactor, htmlWithValueFormatter) {
|
|||
DecisionTreeFactor::Names names{{12, {"Zero", "One", "Two"}},
|
||||
{5, {"-", "+"}}};
|
||||
string actual = f.html(keyFormatter, names);
|
||||
cout << expected << endl;
|
||||
cout << actual << endl;
|
||||
ofstream ef("expected=html.txt"), af("actual-html.txt");
|
||||
ef << expected << endl;
|
||||
af << actual << endl;
|
||||
EXPECT(actual == expected);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue