From d2b20be85480db89a058048f8ac2dabd12a4cbe5 Mon Sep 17 00:00:00 2001 From: AntonMrt <104432560+AntonMrt@users.noreply.github.com> Date: Wed, 8 May 2024 10:40:09 +0300 Subject: [PATCH] Davis to 'dv' and 'dvs' (#72) * WIP (DAVIS to DVS) * separate namespaces for davis --------- Co-authored-by: Valery --- Tests/ArrayCoreTest.cpp | 30 ++-- Tests/PlotlyLibTest.cpp | 18 +-- array_core/array_core.h | 86 +++++------ common_utils/common_constants.cpp | 6 +- common_utils/common_constants.h | 6 +- common_utils/common_utils.cpp | 8 +- common_utils/common_utils.h | 8 +- davis.h | 24 +-- davis_files.txt | 2 +- davis_launcher.cpp | 6 +- davis_one/davis.cpp | 247 +++++++++++++++--------------- davis_one/davis.h | 93 +++++------ davis_one_maker.py | 29 +++- main.cpp | 44 +++--- plotly_maker/html_parts.cpp | 8 +- plotly_maker/html_parts.h | 6 +- plotly_maker/plotly_maker.cpp | 25 +-- plotly_maker/plotly_maker.h | 8 +- 18 files changed, 338 insertions(+), 316 deletions(-) diff --git a/Tests/ArrayCoreTest.cpp b/Tests/ArrayCoreTest.cpp index 814e4ad..e077dce 100644 --- a/Tests/ArrayCoreTest.cpp +++ b/Tests/ArrayCoreTest.cpp @@ -8,25 +8,25 @@ using std::string; using std::vector; TEST(ArrayCore, showDefaultSettings) { - EXPECT_EQ(davis::isPlotlyScriptExists(), true); + EXPECT_EQ(dvs::isPlotlyScriptExists(), true); vector> values = {{30.3, 400, 400, 76}, {99, 45, 20, 1}, {5, 56, 93, 25}, {45, 23, 90, 2}}; - bool result = davis::show(values, "testDefaultSettings"); + bool result = dv::show(values, "testDefaultSettings"); EXPECT_EQ(result, true); } TEST(ArrayCore, showHeatMap1) { - EXPECT_EQ(davis::isPlotlyScriptExists(), true); + EXPECT_EQ(dvs::isPlotlyScriptExists(), true); vector> values = {{30.3, 40, 98, 76}, {99, 45, 20, 1}, {5, 56, 93, 25}, {45, 23, 90, 2}}; - auto settings = davis::createShowSettingsHeatMap(davis::colorscales::GLAMOUR); - bool result = davis::show(values, "showHeatMap1", settings.get()); + auto settings = dvs::createShowSettingsHeatMap(dvs::colorscales::GLAMOUR); + bool result = dv::show(values, "showHeatMap1", settings.get()); EXPECT_EQ(result, true); } TEST(ArrayCore, showSurface1) { - EXPECT_EQ(davis::isPlotlyScriptExists(), true); + EXPECT_EQ(dvs::isPlotlyScriptExists(), true); vector> values = {{30.3, 40, 98, 76}, {99, 45, 20, 1}, {5, 56, 93, 25}, {45, 23, 90, 2}}; - auto settings = davis::createShowSettingsSurface(); - bool result = davis::show(values, "showSurface1", settings.get()); + auto settings = dvs::createShowSettingsSurface(); + bool result = dv::show(values, "showSurface1", settings.get()); EXPECT_EQ(result, true); } @@ -39,7 +39,7 @@ TEST(ArrayCore, showPseudo2D) { vals4[i * cols + j] = i * cols + j; } } - bool result = davis::show(vals4, rows, cols, "showPseudo2D"); + bool result = dv::show(vals4, rows, cols, "showPseudo2D"); EXPECT_EQ(result, true); } @@ -53,28 +53,28 @@ TEST(ArrayCore, showArray2D) { vals5[i][j] = i * cols2 + j; } } - bool result = davis::show(vals5, rows2, cols2); + bool result = dv::show(vals5, rows2, cols2); EXPECT_EQ(result, true); } TEST(ArrayCore, testChartDefault) { vector vec = {-5, -3, -1, 0, 2, 4, 8, 15, 16}; - bool result = davis::show(vec, "testChartDefault"); + bool result = dv::show(vec, "testChartDefault"); EXPECT_EQ(result, true); } TEST(ArrayCore, showChart) { int vals3[] = {2, 6, 4, -34, 56, 33, 2, 15}; - bool result = davis::show(vals3, sizeof(vals3) / sizeof(vals3[0]), "showChart"); + bool result = dv::show(vals3, sizeof(vals3) / sizeof(vals3[0]), "showChart"); EXPECT_EQ(result, true); } TEST(ArrayCore, readAndShowMatrixFromFile) { - EXPECT_EQ(davis::isPlotlyScriptExists(), true); + EXPECT_EQ(dvs::isPlotlyScriptExists(), true); vector> values; - bool readRes = davis::readMatrix(values, "./data/2023_07_19-12_59_31_379_Baumer2_text.csv", ';'); + bool readRes = dvs::readMatrix(values, "./data/2023_07_19-12_59_31_379_Baumer2_text.csv", ';'); EXPECT_EQ(readRes, true); - bool result = davis::show(values, "readAndShowMatrixFromFile"); + bool result = dv::show(values, "readAndShowMatrixFromFile"); EXPECT_EQ(result, true); } diff --git a/Tests/PlotlyLibTest.cpp b/Tests/PlotlyLibTest.cpp index eab0223..90a39ab 100644 --- a/Tests/PlotlyLibTest.cpp +++ b/Tests/PlotlyLibTest.cpp @@ -7,7 +7,7 @@ using std::string; TEST(PlotlyMaker, CreateDefaultHeatMapHtmlPageTest) { std::vector>testValues = {{43, 400, 54, 980}, {200, 36, 400, 55}, {120, 4, 650, 5}}; std::string str_page = "test_page"; - bool result = davis::createHtmlPageWithPlotlyJS(testValues, str_page, davis::visualizationTypes::HEATMAP, davis::colorscales::GLAMOUR); + bool result = dvs::createHtmlPageWithPlotlyJS(testValues, str_page, dvs::visualizationTypes::HEATMAP, dvs::colorscales::GLAMOUR); std::ofstream out("example.html"); if (out.is_open()) { out << str_page.c_str(); @@ -22,32 +22,32 @@ TEST(PlotlyMaker, CreateDefaultHeatMapHtmlPageTest) { TEST(PlotlyMaker, ShowGlamourHeatMapHtmlPageTest) { std::vector>testValues = {{43, 400, 54, 980}, {200, 36, 400, 55}, {120, 4, 650, 5}}; std::string str_page = "veryGlamourPage"; - auto settings = std::make_unique(davis::colorscales::GLAMOUR); - bool result = davis::showHeatMapInBrowser(testValues, str_page, settings.get()); + auto settings = std::make_unique(dvs::colorscales::GLAMOUR); + bool result = dvs::showHeatMapInBrowser(testValues, str_page, settings.get()); EXPECT_EQ(result, true); } TEST(PlotlyMaker, ShowThermalHeatMapHtmlPageTest) { std::vector>testValues = {{43, 400, 54, 980}, {200, 36, 400, 55}, {120, 4, 650, 5}}; std::string str_page = "veryHotPage"; - auto settings = std::make_unique(davis::colorscales::THERMAL); - bool result = davis::showHeatMapInBrowser(testValues, str_page, settings.get()); + auto settings = std::make_unique(dvs::colorscales::THERMAL); + bool result = dvs::showHeatMapInBrowser(testValues, str_page, settings.get()); EXPECT_EQ(result, true); } TEST(PlotlyMaker, ShowSunnyHeatMapHtmlPageTest) { std::vector>testValues = {{43, 400, 54, 980}, {200, 36, 400, 55}, {120, 4, 650, 5}}; std::string str_page = "SunnyPage"; - auto settings = std::make_unique(davis::colorscales::SUNNY); - bool result = davis::showHeatMapInBrowser(testValues, str_page, settings.get()); + auto settings = std::make_unique(dvs::colorscales::SUNNY); + bool result = dvs::showHeatMapInBrowser(testValues, str_page, settings.get()); EXPECT_EQ(result, true); } TEST(PlotlyMaker, ShowThermalSurfaceHtmlPageTest) { std::vector>testValues = {{43, 400, 54, 980}, {200, 36, 400, 55}, {120, 4, 650, 5}}; std::string str_page = "ThermalSurfacePage"; - auto settings = std::make_unique(davis::colorscales::THERMAL); - bool result = davis::showSurfaceInBrowser(testValues, str_page, settings.get()); + auto settings = std::make_unique(dvs::colorscales::THERMAL); + bool result = dvs::showSurfaceInBrowser(testValues, str_page, settings.get()); EXPECT_EQ(result, true); } diff --git a/array_core/array_core.h b/array_core/array_core.h index d8825d8..71d8805 100644 --- a/array_core/array_core.h +++ b/array_core/array_core.h @@ -8,8 +8,8 @@ #include "common_utils/common_utils.h" #include "common_utils/common_constants.h" -namespace davis { -//#START_GRAB_TO_DAVIS_NAMESPACE +namespace dv { +//#START_GRAB_TO_DV_NAMESPACE using std::vector; using std::string; @@ -17,28 +17,28 @@ using std::string; //! two-dimensional vector template -bool show(const vector>& data, const string& title = kAppName, - ShowSettings* settings = nullptr); +bool show(const vector>& data, const string& title = dvs::kAppName, + dvs::ShowSettings* settings = nullptr); //! two-dimensional array template bool show(T** data, uint64_t arrRows, uint64_t arrCols, - const string& title = kAppName, ShowSettings* settings = nullptr); + const string& title = dvs::kAppName, dvs::ShowSettings* settings = nullptr); //! a one-dimensional array that simulates a two-dimensional one (element access [i*cols+j]) template bool show(const T* data, uint64_t arrRows, uint64_t arrCols, - const string& title = kAppName, ShowSettings* settings = nullptr); + const string& title = dvs::kAppName, dvs::ShowSettings* settings = nullptr); //! one-dimensional vector template -bool show(const vector& data, const string& title = kAppName, - ShowSettings* settings = nullptr); +bool show(const vector& data, const string& title = dvs::kAppName, + dvs::ShowSettings* settings = nullptr); //! one-dimensional array template -bool show(const T* data, uint64_t count, const string& title = kAppName, - ShowSettings* settings = nullptr); +bool show(const T* data, uint64_t count, const string& title = dvs::kAppName, + dvs::ShowSettings* settings = nullptr); // *********************************** // template functions implementations: @@ -46,7 +46,7 @@ bool show(const T* data, uint64_t count, const string& title = kAppName, template bool show(const vector>& data, const string& title, - ShowSettings* settings) { + dvs::ShowSettings *settings) { vector> vecVecDbl; vecVecDbl.reserve(data.size()); for (vector row : data) { @@ -54,21 +54,21 @@ bool show(const vector>& data, const string& title, vecVecDbl.emplace_back(dblRow); } bool res = false; - std::unique_ptr smartP; //Smart pointer for auto deleting settings if it will be created bellow via NEW + std::unique_ptr smartP; //Smart pointer for auto deleting settings if it will be created bellow via NEW if (settings == nullptr) { - settings = new ShowSettingsHeatMap(); + settings = new dvs::ShowSettingsHeatMap(); smartP.reset(settings); } - if (settings->getVisualType() == davis::visualizationTypes::HEATMAP) - res = davis::showHeatMapInBrowser(vecVecDbl, title, static_cast(settings)); - else if (settings->getVisualType() == davis::visualizationTypes::SURFACE) - res = davis::showSurfaceInBrowser(vecVecDbl, title, static_cast(settings)); + if (settings->getVisualType() == dvs::visualizationTypes::HEATMAP) + res = dvs::showHeatMapInBrowser(vecVecDbl, title, static_cast(settings)); + else if (settings->getVisualType() == dvs::visualizationTypes::SURFACE) + res = dvs::showSurfaceInBrowser(vecVecDbl, title, static_cast(settings)); return res; } template bool show(T** data, uint64_t arrRows, uint64_t arrCols, const string& title, - ShowSettings* settings) { + dvs::ShowSettings *settings) { vector> vecVecDbl; vecVecDbl.reserve(arrRows); for (uint64_t i = 0; i < arrRows; ++i) { @@ -76,21 +76,21 @@ bool show(T** data, uint64_t arrRows, uint64_t arrCols, const string& title, vecVecDbl.emplace_back(dblRow); } bool res = false; - std::unique_ptr smartP; //Smart pointer for auto deleting settings if it will be created bellow via NEW + std::unique_ptr smartP; //Smart pointer for auto deleting settings if it will be created bellow via NEW if (settings == nullptr) { - settings = new ShowSettingsHeatMap(); + settings = new dvs::ShowSettingsHeatMap(); smartP.reset(settings); } - if (settings->getVisualType() == davis::visualizationTypes::HEATMAP) - res = davis::showHeatMapInBrowser(vecVecDbl, title, static_cast(settings)); - else if (settings->getVisualType() == davis::visualizationTypes::SURFACE) - res = davis::showSurfaceInBrowser(vecVecDbl, title, static_cast(settings)); + if (settings->getVisualType() == dvs::visualizationTypes::HEATMAP) + res = dvs::showHeatMapInBrowser(vecVecDbl, title, static_cast(settings)); + else if (settings->getVisualType() == dvs::visualizationTypes::SURFACE) + res = dvs::showSurfaceInBrowser(vecVecDbl, title, static_cast(settings)); return res; } template bool show(const T* data, uint64_t arrRows, uint64_t arrCols, const string& title, - ShowSettings* settings) { + dvs::ShowSettings *settings) { vector> vecVecDbl; vecVecDbl.reserve(arrRows); for (uint64_t i = 0; i < arrRows; ++i) { @@ -98,48 +98,48 @@ bool show(const T* data, uint64_t arrRows, uint64_t arrCols, const string& title vecVecDbl.emplace_back(dblRow); } bool res = false; - std::unique_ptr smartP; //Smart pointer for auto deleting settings if it will be created bellow via NEW + std::unique_ptr smartP; //Smart pointer for auto deleting settings if it will be created bellow via NEW if (settings == nullptr) { - settings = new ShowSettingsHeatMap(); + settings = new dvs::ShowSettingsHeatMap(); smartP.reset(settings); } - if (settings->getVisualType() == davis::visualizationTypes::HEATMAP) - res = davis::showHeatMapInBrowser(vecVecDbl, title, static_cast(settings)); - else if (settings->getVisualType() == davis::visualizationTypes::SURFACE) - res = davis::showSurfaceInBrowser(vecVecDbl, title, static_cast(settings)); + if (settings->getVisualType() == dvs::visualizationTypes::HEATMAP) + res = dvs::showHeatMapInBrowser(vecVecDbl, title, static_cast(settings)); + else if (settings->getVisualType() == dvs::visualizationTypes::SURFACE) + res = dvs::showSurfaceInBrowser(vecVecDbl, title, static_cast(settings)); return res; } template bool show(const vector& data, const string& title, - ShowSettings* settings) { + dvs::ShowSettings* settings) { vector dblRow(data.begin(), data.end()); bool res = false; - std::unique_ptr smartP; //Smart pointer for auto deleting settings if it will be created bellow via NEW + std::unique_ptr smartP; //Smart pointer for auto deleting settings if it will be created bellow via NEW if (settings == nullptr) { - settings = new ShowSettingsChart(); + settings = new dvs::ShowSettingsChart(); smartP.reset(settings); } - if (settings->getVisualType() == davis::visualizationTypes::CHART) - res = davis::showLineChartInBrowser(dblRow, title, static_cast(settings)); + if (settings->getVisualType() == dvs::visualizationTypes::CHART) + res = dvs::showLineChartInBrowser(dblRow, title, static_cast(settings)); return res; } template bool show(const T* data, uint64_t count, const string& title, - ShowSettings* settings) { + dvs::ShowSettings *settings) { vector dblRow(data, data + count); bool res = false; - std::unique_ptr smartP; //Smart pointer for auto deleting settings if it will be created bellow via NEW + std::unique_ptr smartP; //Smart pointer for auto deleting settings if it will be created bellow via NEW if (settings == nullptr) { - settings = new ShowSettingsChart(); + settings = new dvs::ShowSettingsChart(); smartP.reset(settings); } - if (settings->getVisualType() == davis::visualizationTypes::CHART) - res = davis::showLineChartInBrowser(dblRow, title, static_cast(settings)); + if (settings->getVisualType() == dvs::visualizationTypes::CHART) + res = dvs::showLineChartInBrowser(dblRow, title, static_cast(settings)); return res; } -//#STOP_GRAB_TO_DAVIS_NAMESPACE -} // end namespace davis +//#STOP_GRAB_TO_DV_NAMESPACE +} // end namespace dvs #endif //ARRAY_CORE_ARRAY_CORE_H_ diff --git a/common_utils/common_constants.cpp b/common_utils/common_constants.cpp index e9d0434..17f92b6 100644 --- a/common_utils/common_constants.cpp +++ b/common_utils/common_constants.cpp @@ -1,11 +1,11 @@ #include "common_constants.h" -namespace davis { -//#START_GRAB_TO_DAVIS_NAMESPACE +namespace dvs { +//#START_GRAB_TO_NAMESPACE const char kAppName[] = "davis"; const char kOutFolderName[] = "davis_htmls/"; const char kPlotlyJsWorkPath[] = "./davis_htmls/plotly-2.27.0.min.js"; const char kPlotlyJsName[] = "plotly-2.27.0.min.js"; const char kPlotlyJsResourcePath[] = "plotly_maker/plotly-2.27.0.min.js"; -//#STOP_GRAB_TO_DAVIS_NAMESPACE +//#STOP_GRAB_TO_NAMESPACE } diff --git a/common_utils/common_constants.h b/common_utils/common_constants.h index 0d8a1e7..9caeb45 100644 --- a/common_utils/common_constants.h +++ b/common_utils/common_constants.h @@ -1,14 +1,14 @@ #ifndef COMMON_UTILS_COMMON_CONSTANTS_H #define COMMON_UTILS_COMMON_CONSTANTS_H -namespace davis { -//#START_GRAB_TO_DAVIS_NAMESPACE +namespace dvs { +//#START_GRAB_TO_NAMESPACE extern const char kAppName[]; extern const char kOutFolderName[]; extern const char kPlotlyJsName[]; extern const char kPlotlyJsResourcePath[]; extern const char kPlotlyJsWorkPath[]; -//#STOP_GRAB_TO_DAVIS_NAMESPACE +//#STOP_GRAB_TO_NAMESPACE } #endif // COMMON_UTILS_COMMON_CONSTANTS_H diff --git a/common_utils/common_utils.cpp b/common_utils/common_utils.cpp index 45838b5..edb355c 100644 --- a/common_utils/common_utils.cpp +++ b/common_utils/common_utils.cpp @@ -45,8 +45,8 @@ void openFileBySystem(const string& file_name) { //#STOP_GRAB_TO_NAMESPACE } // namespace -namespace davis { -//#START_GRAB_TO_DAVIS_NAMESPACE +namespace dvs { +//#START_GRAB_TO_NAMESPACE string getCurrentPath() { #if defined (_WIN32) || (__linux__) char buffer[1024]; @@ -170,5 +170,5 @@ vector split(const string& target, char c) { return result; } -//#STOP_GRAB_TO_DAVIS_NAMESPACE -}; // namespace davis +//#STOP_GRAB_TO_NAMESPACE +}; // namespace dvs diff --git a/common_utils/common_utils.h b/common_utils/common_utils.h index 3e6b23e..2034568 100644 --- a/common_utils/common_utils.h +++ b/common_utils/common_utils.h @@ -5,8 +5,8 @@ #include //#STOP_GRAB_TO_INCLUDES_LIST -namespace davis { -//#START_GRAB_TO_DAVIS_NAMESPACE +namespace dvs { +//#START_GRAB_TO_NAMESPACE using std::string; using std::vector; @@ -33,7 +33,7 @@ bool readMatrix(vector>& outMatrix, const string& path, char dlmt // Now it doesn't work. bool deleteFolder(const char* fname); -//#STOP_GRAB_TO_DAVIS_NAMESPACE -}; // namespace davis +//#STOP_GRAB_TO_NAMESPACE +}; // namespace dvs #endif // COMMON_UTILS_COMMON_UTILS_H_ diff --git a/davis.h b/davis.h index e0c42fe..2023763 100644 --- a/davis.h +++ b/davis.h @@ -32,12 +32,12 @@ void makeStringFromValues(const vector in_values, } } -void makeArgs(const davis::ShowSettings* settings, +void makeArgs(const dvs::ShowSettings* settings, const vector>& values, string& out) { switch (settings->getVisualType()) { - case davis::visualizationTypes::CHART: + case dvs::visualizationTypes::CHART: break; - case davis::visualizationTypes::HEATMAP: + case dvs::visualizationTypes::HEATMAP: //duplicated code out.append(davis); out.append(command_heatmap); @@ -49,7 +49,7 @@ void makeArgs(const davis::ShowSettings* settings, } out.append(postfix); break; - case davis::visualizationTypes::SURFACE: + case dvs::visualizationTypes::SURFACE: //duplicated code out.append(davis); out.append(command_surface); @@ -64,20 +64,20 @@ void makeArgs(const davis::ShowSettings* settings, } } -void makeArgs(const davis::ShowSettings* settings, +void makeArgs(const dvs::ShowSettings* settings, vector& values, string& out) { switch (settings->getVisualType()) { - case davis::visualizationTypes::CHART: + case dvs::visualizationTypes::CHART: out.append(davis); out.append(command_line_chart); out.append(prefix); makeStringFromValues(values, out); out.append(postfix); break; - case davis::visualizationTypes::HEATMAP: + case dvs::visualizationTypes::HEATMAP: break; - case davis::visualizationTypes::SURFACE: + case dvs::visualizationTypes::SURFACE: break; } } @@ -86,16 +86,16 @@ void makeArgs(const davis::ShowSettings* settings, namespace dv { -void show(vector>& values, const davis::ShowSettings* settings); -void show(vector& values, const davis::ShowSettings* settings); +void show(vector>& values, const dvs::ShowSettings* settings); +void show(vector& values, const dvs::ShowSettings* settings); -void show(vector>& values, const davis::ShowSettings* settings) { +void show(vector>& values, const dvs::ShowSettings* settings) { string args; makeArgs(settings, values, args); runDavisBySystem(args); } -void show(vector& values, const davis::ShowSettings* settings) { +void show(vector& values, const dvs::ShowSettings* settings) { string args; makeArgs(settings, values, args); runDavisBySystem(args); diff --git a/davis_files.txt b/davis_files.txt index 02d14f1..517d7e8 100644 --- a/davis_files.txt +++ b/davis_files.txt @@ -2,8 +2,8 @@ common_utils/common_constants.cpp common_utils/common_constants.h plotly_maker/html_parts.h plotly_maker/html_parts.cpp -common_utils/common_utils.cpp common_utils/common_utils.h +common_utils/common_utils.cpp plotly_maker/plotly_maker.h plotly_maker/plotly_maker.cpp array_core/array_core.h diff --git a/davis_launcher.cpp b/davis_launcher.cpp index f27b540..2412067 100644 --- a/davis_launcher.cpp +++ b/davis_launcher.cpp @@ -4,9 +4,9 @@ int main(int argc, char* argv[]) { vectorv = {8.0, 8.0, 9, 0, 55}; vector>hm = {{8.0, 8.0, 9, 0, 55}, {5.0, 18.0, 0.9, 50, 15}}; - auto settings1 = davis::createShowSettingsChart(); - auto settings2 = davis::createShowSettingsHeatMap(); - auto settings3 = davis::createShowSettingsSurface(); + auto settings1 = dvs::createShowSettingsChart(); + auto settings2 = dvs::createShowSettingsHeatMap(); + auto settings3 = dvs::createShowSettingsSurface(); dv::show(v, settings1.get()); dv::show(hm, settings2.get()); diff --git a/davis_one/davis.cpp b/davis_one/davis.cpp index 622c2d3..83bc4d5 100644 --- a/davis_one/davis.cpp +++ b/davis_one/davis.cpp @@ -4,129 +4,12 @@ #include "davis.h" -#include -#include #include #include +#include #include +#include namespace { -using std::string; - -#ifdef _WIN32 - #include - #include - #define getcwd _getcwd // stupid MSFT "deprecation" warning -#elif __linux__ - #include -#endif - -inline bool is_file_exists(const string& file_name) { - std::ifstream file(file_name.c_str()); - if (!file) { - return false; - } - return true; -} - -void openFileBySystem(const string& file_name) { - string command; -#ifdef _WIN32 - command = "start "; -#elif __APPLE__ - command = "open "; -#elif __linux__ - command = "xdg-open "; -#else -#error "Unknown compiler" -#endif - command.append(file_name); - system(command.c_str()); -} -using std::vector; -using std::string; - - - -bool checkThatSizesAreTheSame(const vector>& values) { - size_t size = 0; - if (!values.empty()) { - size = values[0].size(); - }; - for (size_t i = 0; i < values.size(); ++i) { - - if (values[i].size() != size) - return false; - } - return true; -} - -bool createStringHeatMapValues(const vector>& values, - string& str_values) { - if (!checkThatSizesAreTheSame(values)) - return false; - if (!str_values.empty()) - str_values.clear(); - str_values.append(R"(var data = [{z: )"); - str_values.append(R"([)"); - for (size_t i = 0; i < values.size(); ++i) { - str_values.append("["); - for (size_t j = 0; j < values[i].size(); ++j) { - str_values.append(std::to_string(values[i][j])); - if (j != values[i].size() - 1) { - str_values.append(","); - } - } - str_values.append("]"); - if (i != values.size() - 1) { - str_values.append(","); - } - } - str_values.append(R"(],)"); - return true; -} - - -bool createStringLineChartValues(const vector& values, - string& str_values) { - if (!str_values.empty()) { - str_values.clear(); - } - str_values = R"(var trace = {x: [)"; - for (size_t i = 0; i < values.size(); ++i) { - str_values.append(std::to_string(i)); - if (i != values.size() - 1) { - str_values.append(","); - } - } - str_values.append("], y: ["); - for (size_t j = 0; j < values.size(); ++j) { - str_values.append(std::to_string(values[j])); - if (j != values.size() - 1) { - str_values.append(","); - } - } - str_values.append("], mode: 'lines+markers'};var data = [trace];"); - return true; -} - -inline bool heatmap_and_surface(const vector>& values, - const std::string& title, - const davis::visualizationTypes& visualType, - const davis::colorscales& colorscale) { - std::string page; - if (!createHtmlPageWithPlotlyJS(values, page, visualType, colorscale)) { - return false; - } - string pageName; - davis::mayBeCreateJsWorkingFolder(); - pageName.append("./").append(davis::kOutFolderName).append(title).append(".html"); - davis::saveStringToFile(pageName, page); - davis::openPlotlyHtml(pageName); - return true;// TODO handle different exceptions -}; - -}// namespace end -namespace davis { const char kAppName[] = "davis"; const char kOutFolderName[] = "davis_htmls/"; const char kPlotlyJsWorkPath[] = "./davis_htmls/plotly-2.27.0.min.js"; @@ -205,6 +88,38 @@ Plotly.newPlot('gd', data); )"; // *INDENT-ON* +using std::string; + +#ifdef _WIN32 + #include + #include + #define getcwd _getcwd // stupid MSFT "deprecation" warning +#elif __linux__ + #include +#endif + +inline bool is_file_exists(const string& file_name) { + std::ifstream file(file_name.c_str()); + if (!file) { + return false; + } + return true; +} + +void openFileBySystem(const string& file_name) { + string command; +#ifdef _WIN32 + command = "start "; +#elif __APPLE__ + command = "open "; +#elif __linux__ + command = "xdg-open "; +#else +#error "Unknown compiler" +#endif + command.append(file_name); + system(command.c_str()); +} string getCurrentPath() { #if defined (_WIN32) || (__linux__) char buffer[1024]; @@ -328,6 +243,91 @@ vector split(const string& target, char c) { return result; } +using std::vector; +using std::string; + + + +bool checkThatSizesAreTheSame(const vector>& values) { + size_t size = 0; + if (!values.empty()) { + size = values[0].size(); + }; + for (size_t i = 0; i < values.size(); ++i) { + + if (values[i].size() != size) + return false; + } + return true; +} + +bool createStringHeatMapValues(const vector>& values, + string& str_values) { + if (!checkThatSizesAreTheSame(values)) + return false; + if (!str_values.empty()) + str_values.clear(); + str_values.append(R"(var data = [{z: )"); + str_values.append(R"([)"); + for (size_t i = 0; i < values.size(); ++i) { + str_values.append("["); + for (size_t j = 0; j < values[i].size(); ++j) { + str_values.append(std::to_string(values[i][j])); + if (j != values[i].size() - 1) { + str_values.append(","); + } + } + str_values.append("]"); + if (i != values.size() - 1) { + str_values.append(","); + } + } + str_values.append(R"(],)"); + return true; +} + + +bool createStringLineChartValues(const vector& values, + string& str_values) { + if (!str_values.empty()) { + str_values.clear(); + } + str_values = R"(var trace = {x: [)"; + for (size_t i = 0; i < values.size(); ++i) { + str_values.append(std::to_string(i)); + if (i != values.size() - 1) { + str_values.append(","); + } + } + str_values.append("], y: ["); + for (size_t j = 0; j < values.size(); ++j) { + str_values.append(std::to_string(values[j])); + if (j != values.size() - 1) { + str_values.append(","); + } + } + str_values.append("], mode: 'lines+markers'};var data = [trace];"); + return true; +} + +inline bool heatmap_and_surface(const vector>& values, + const std::string& title, + const dvs::visualizationTypes& visualType, + const dvs::colorscales& colorscale) { + std::string page; + if (!createHtmlPageWithPlotlyJS(values, page, visualType, colorscale)) { + return false; + } + string pageName; + mayBeCreateJsWorkingFolder(); + pageName.append("./").append(kOutFolderName).append(title).append(".html"); + saveStringToFile(pageName, page); + openPlotlyHtml(pageName); + return true;// TODO handle different exceptions +}; + +}// namespace end +namespace dvs { using std::string; using std::vector; using std::istringstream; @@ -415,7 +415,7 @@ bool showLineChartInBrowser(const vector& values, string pageName; mayBeCreateJsWorkingFolder(); pageName.append("./").append(kOutFolderName).append(title).append(".html"); - davis::saveStringToFile(pageName, page); + saveStringToFile(pageName, page); openPlotlyHtml(pageName); return true; } @@ -460,7 +460,7 @@ bool showLineChartInBrowser(const vector& values, std::string pageName; mayBeCreateJsWorkingFolder(); pageName.append("./").append(kOutFolderName).append(title).append(".html"); - davis::saveStringToFile(pageName, page); + saveStringToFile(pageName, page); openPlotlyHtml(pageName); return true; } @@ -499,4 +499,7 @@ visualizationTypes ShowSettings::getVisualType() const { return visualType; } -} // namespace davis end \ No newline at end of file +} // namespace dvs end +namespace dv { + +} // namespace dv end \ No newline at end of file diff --git a/davis_one/davis.h b/davis_one/davis.h index 72382b4..6a8c777 100644 --- a/davis_one/davis.h +++ b/davis_one/davis.h @@ -5,14 +5,11 @@ #ifndef DAVIS_H_ #define DAVIS_H_ +#include #include -#include #include -#include +#include namespace { - -}// namespace end -namespace davis { extern const char kAppName[]; extern const char kOutFolderName[]; extern const char kPlotlyJsName[]; @@ -54,6 +51,9 @@ bool readMatrix(vector>& outMatrix, const string& path, char dlmt bool deleteFolder(const char* fname); +}// namespace end +namespace dvs { + using std::vector; enum class visualizationTypes { @@ -130,34 +130,37 @@ bool showSurfaceInBrowser(const vector>& values, const std::strin bool showSurfaceInBrowser(const std::string& values, const std::string& title, const ShowSettingsSurface* settings); +} // namespace dvs end +namespace dv { + using std::vector; using std::string; //! two-dimensional vector template -bool show(const vector>& data, const string& title = kAppName, - ShowSettings* settings = nullptr); +bool show(const vector>& data, const string& title = dvs::kAppName, + dvs::ShowSettings* settings = nullptr); //! two-dimensional array template bool show(T** data, uint64_t arrRows, uint64_t arrCols, - const string& title = kAppName, ShowSettings* settings = nullptr); + const string& title = dvs::kAppName, dvs::ShowSettings* settings = nullptr); //! a one-dimensional array that simulates a two-dimensional one (element access [i*cols+j]) template bool show(const T* data, uint64_t arrRows, uint64_t arrCols, - const string& title = kAppName, ShowSettings* settings = nullptr); + const string& title = dvs::kAppName, dvs::ShowSettings* settings = nullptr); //! one-dimensional vector template -bool show(const vector& data, const string& title = kAppName, - ShowSettings* settings = nullptr); +bool show(const vector& data, const string& title = dvs::kAppName, + dvs::ShowSettings* settings = nullptr); //! one-dimensional array template -bool show(const T* data, uint64_t count, const string& title = kAppName, - ShowSettings* settings = nullptr); +bool show(const T* data, uint64_t count, const string& title = dvs::kAppName, + dvs::ShowSettings* settings = nullptr); // *********************************** // template functions implementations: @@ -165,7 +168,7 @@ bool show(const T* data, uint64_t count, const string& title = kAppName, template bool show(const vector>& data, const string& title, - ShowSettings* settings) { + dvs::ShowSettings *settings) { vector> vecVecDbl; vecVecDbl.reserve(data.size()); for (vector row : data) { @@ -173,21 +176,21 @@ bool show(const vector>& data, const string& title, vecVecDbl.emplace_back(dblRow); } bool res = false; - std::unique_ptr smartP; //Smart pointer for auto deleting settings if it will be created bellow via NEW + std::unique_ptr smartP; //Smart pointer for auto deleting settings if it will be created bellow via NEW if (settings == nullptr) { - settings = new ShowSettingsHeatMap(); + settings = new dvs::ShowSettingsHeatMap(); smartP.reset(settings); } - if (settings->getVisualType() == davis::visualizationTypes::HEATMAP) - res = davis::showHeatMapInBrowser(vecVecDbl, title, static_cast(settings)); - else if (settings->getVisualType() == davis::visualizationTypes::SURFACE) - res = davis::showSurfaceInBrowser(vecVecDbl, title, static_cast(settings)); + if (settings->getVisualType() == dvs::visualizationTypes::HEATMAP) + res = dvs::showHeatMapInBrowser(vecVecDbl, title, static_cast(settings)); + else if (settings->getVisualType() == dvs::visualizationTypes::SURFACE) + res = dvs::showSurfaceInBrowser(vecVecDbl, title, static_cast(settings)); return res; } template bool show(T** data, uint64_t arrRows, uint64_t arrCols, const string& title, - ShowSettings* settings) { + dvs::ShowSettings *settings) { vector> vecVecDbl; vecVecDbl.reserve(arrRows); for (uint64_t i = 0; i < arrRows; ++i) { @@ -195,21 +198,21 @@ bool show(T** data, uint64_t arrRows, uint64_t arrCols, const string& title, vecVecDbl.emplace_back(dblRow); } bool res = false; - std::unique_ptr smartP; //Smart pointer for auto deleting settings if it will be created bellow via NEW + std::unique_ptr smartP; //Smart pointer for auto deleting settings if it will be created bellow via NEW if (settings == nullptr) { - settings = new ShowSettingsHeatMap(); + settings = new dvs::ShowSettingsHeatMap(); smartP.reset(settings); } - if (settings->getVisualType() == davis::visualizationTypes::HEATMAP) - res = davis::showHeatMapInBrowser(vecVecDbl, title, static_cast(settings)); - else if (settings->getVisualType() == davis::visualizationTypes::SURFACE) - res = davis::showSurfaceInBrowser(vecVecDbl, title, static_cast(settings)); + if (settings->getVisualType() == dvs::visualizationTypes::HEATMAP) + res = dvs::showHeatMapInBrowser(vecVecDbl, title, static_cast(settings)); + else if (settings->getVisualType() == dvs::visualizationTypes::SURFACE) + res = dvs::showSurfaceInBrowser(vecVecDbl, title, static_cast(settings)); return res; } template bool show(const T* data, uint64_t arrRows, uint64_t arrCols, const string& title, - ShowSettings* settings) { + dvs::ShowSettings *settings) { vector> vecVecDbl; vecVecDbl.reserve(arrRows); for (uint64_t i = 0; i < arrRows; ++i) { @@ -217,47 +220,47 @@ bool show(const T* data, uint64_t arrRows, uint64_t arrCols, const string& title vecVecDbl.emplace_back(dblRow); } bool res = false; - std::unique_ptr smartP; //Smart pointer for auto deleting settings if it will be created bellow via NEW + std::unique_ptr smartP; //Smart pointer for auto deleting settings if it will be created bellow via NEW if (settings == nullptr) { - settings = new ShowSettingsHeatMap(); + settings = new dvs::ShowSettingsHeatMap(); smartP.reset(settings); } - if (settings->getVisualType() == davis::visualizationTypes::HEATMAP) - res = davis::showHeatMapInBrowser(vecVecDbl, title, static_cast(settings)); - else if (settings->getVisualType() == davis::visualizationTypes::SURFACE) - res = davis::showSurfaceInBrowser(vecVecDbl, title, static_cast(settings)); + if (settings->getVisualType() == dvs::visualizationTypes::HEATMAP) + res = dvs::showHeatMapInBrowser(vecVecDbl, title, static_cast(settings)); + else if (settings->getVisualType() == dvs::visualizationTypes::SURFACE) + res = dvs::showSurfaceInBrowser(vecVecDbl, title, static_cast(settings)); return res; } template bool show(const vector& data, const string& title, - ShowSettings* settings) { + dvs::ShowSettings* settings) { vector dblRow(data.begin(), data.end()); bool res = false; - std::unique_ptr smartP; //Smart pointer for auto deleting settings if it will be created bellow via NEW + std::unique_ptr smartP; //Smart pointer for auto deleting settings if it will be created bellow via NEW if (settings == nullptr) { - settings = new ShowSettingsChart(); + settings = new dvs::ShowSettingsChart(); smartP.reset(settings); } - if (settings->getVisualType() == davis::visualizationTypes::CHART) - res = davis::showLineChartInBrowser(dblRow, title, static_cast(settings)); + if (settings->getVisualType() == dvs::visualizationTypes::CHART) + res = dvs::showLineChartInBrowser(dblRow, title, static_cast(settings)); return res; } template bool show(const T* data, uint64_t count, const string& title, - ShowSettings* settings) { + dvs::ShowSettings *settings) { vector dblRow(data, data + count); bool res = false; - std::unique_ptr smartP; //Smart pointer for auto deleting settings if it will be created bellow via NEW + std::unique_ptr smartP; //Smart pointer for auto deleting settings if it will be created bellow via NEW if (settings == nullptr) { - settings = new ShowSettingsChart(); + settings = new dvs::ShowSettingsChart(); smartP.reset(settings); } - if (settings->getVisualType() == davis::visualizationTypes::CHART) - res = davis::showLineChartInBrowser(dblRow, title, static_cast(settings)); + if (settings->getVisualType() == dvs::visualizationTypes::CHART) + res = dvs::showLineChartInBrowser(dblRow, title, static_cast(settings)); return res; } -} // namespace davis end +} // namespace dv end #endif // DAVIS_H_ \ No newline at end of file diff --git a/davis_one_maker.py b/davis_one_maker.py index 336837d..c58f66c 100644 --- a/davis_one_maker.py +++ b/davis_one_maker.py @@ -17,10 +17,16 @@ START_DAVIS_CPP = """#include "davis.h" """ -START_NAME_SPACE_DAVIS = """namespace davis { +START_NAME_SPACE_DAVIS = """namespace dvs { """ END_NAME_SPACE_DAVIS = """ -} // namespace davis end""" +} // namespace dvs end +""" + +START_NAME_SPACE_PUBLIC_DAVIS = """namespace dv { +""" +END_NAME_SPACE_PUBLIC_DAVIS = """ +} // namespace dv end""" START_NAME_SPACE = """namespace { """ @@ -32,8 +38,10 @@ SRC_LIST_FILE = "davis_files.txt" START_GRAB_INCLUDES = """#START_GRAB_TO_INCLUDES_LIST""" STOP_GRAB_INCLUDES = """#STOP_GRAB_TO_INCLUDES_LIST""" -START_GRAB_DAVIS_NAMESPACE = """#START_GRAB_TO_DAVIS_NAMESPACE""" -STOP_GRAB_DAVIS_NAMESPACE = """#STOP_GRAB_TO_DAVIS_NAMESPACE""" +START_GRAB_DAVIS_NAMESPACE = """#START_GRAB_TO_DVS_NAMESPACE""" +STOP_GRAB_DAVIS_NAMESPACE = """#STOP_GRAB_TO_DVS_NAMESPACE""" +START_GRAB_PUBLIC_DAVIS_NAMESPACE = """#START_GRAB_TO_DV_NAMESPACE""" +STOP_GRAB_PUBLIC_DAVIS_NAMESPACE = """#STOP_GRAB_TO_DV_NAMESPACE""" START_GRAB_NAMESPACE = """#START_GRAB_TO_NAMESPACE""" STOP_GRAB_NAMESPACE = """#STOP_GRAB_TO_NAMESPACE""" @@ -108,14 +116,15 @@ def grab_namespace_code(namespace_text_start, includes_cpp_set.add(f) #print('cpp: -->',f) - +sorted_h_includes = sorted(includes_h_set) +sorted_cpp_includes = sorted(includes_cpp_set) print("ALL H INCLUDES: ") -for hs in includes_h_set: +for hs in sorted_h_includes: print(hs) file_h.write(hs+"\n") print("ALL CPP INCLUDES: ") -for cpps in includes_cpp_set: +for cpps in sorted_cpp_includes: print(cpps) file_cpp.write(cpps+"\n") @@ -131,6 +140,12 @@ def grab_namespace_code(namespace_text_start, STOP_GRAB_DAVIS_NAMESPACE, file_src_list) +grab_namespace_code(START_NAME_SPACE_PUBLIC_DAVIS, + END_NAME_SPACE_PUBLIC_DAVIS, + START_GRAB_PUBLIC_DAVIS_NAMESPACE, + STOP_GRAB_PUBLIC_DAVIS_NAMESPACE, + file_src_list) + file_h.write(END_DAVIS_H) #DAVIS HEADER_GUARD END file_h.close() diff --git a/main.cpp b/main.cpp index 158f9a4..cc13938 100644 --- a/main.cpp +++ b/main.cpp @@ -26,53 +26,53 @@ int main(int argc, char* argv[]) { exit(0); } // here we have to copy plotly js to current dir if it doesn't exist - ResourceHandle resource_handle(davis::kPlotlyJsResourcePath); - if (!davis::isPlotlyScriptExists()) { - davis::mayBeCreateJsWorkingFolder(); - davis::saveStringToFile(davis::kPlotlyJsWorkPath, resource_handle.c_str()); + ResourceHandle resource_handle(dvs::kPlotlyJsResourcePath); + if (!dvs::isPlotlyScriptExists()) { + dvs::mayBeCreateJsWorkingFolder(); + dvs::saveStringToFile(dvs::kPlotlyJsWorkPath, resource_handle.c_str()); } vector> values = {{30.3, 40, 98, 76}, {99, 45, 20, 1}, {5, 56, 93, 25}, {45, 23, 90, 2}}; - auto setHeatM = davis::createShowSettingsHeatMap(); - setHeatM->colorScale = davis::colorscales::GLAMOUR; - davis::show(values, "testHeat1", setHeatM.get()); + auto setHeatM = dvs::createShowSettingsHeatMap(); + setHeatM->colorScale = dvs::colorscales::GLAMOUR; + dv::show(values, "testHeat1", setHeatM.get()); if (result.count("linechart")) { auto data = result["linechart"].as(); - auto set = davis::createShowSettingsChart(); - davis::showLineChartInBrowser(data, "comand_line_linechart", set.get()); + auto set = dvs::createShowSettingsChart(); + dvs::showLineChartInBrowser(data, "comand_line_linechart", set.get()); return EXIT_SUCCESS; } else if (result.count("heatmap")) { auto data = result["heatmap"].as(); - auto set = davis::createShowSettingsHeatMap(); - davis::showHeatMapInBrowser(data, "comand_line_heatmap", set.get()); + auto set = dvs::createShowSettingsHeatMap(); + dvs::showHeatMapInBrowser(data, "comand_line_heatmap", set.get()); return EXIT_SUCCESS; } else if (result.count("surface")) { auto data = result["surface"].as(); - auto settings = davis::createShowSettingsSurface(); - settings->colorScale = davis::colorscales::GLAMOUR; - davis::showSurfaceInBrowser(data, "comand_line_surface", settings.get()); + auto settings = dvs::createShowSettingsSurface(); + settings->colorScale = dvs::colorscales::GLAMOUR; + dvs::showSurfaceInBrowser(data, "comand_line_surface", settings.get()); return EXIT_SUCCESS; } else if (result.count("datapath")) { auto data_path = result["datapath"].as(); std::string str_data; - if (davis::getDataFromFile(data_path, str_data)) { + if (dvs::getDataFromFile(data_path, str_data)) { if (result.count("charttype")) { auto chart_type = result["charttype"].as(); if (chart_type == "l" || chart_type == "linechart") { - auto settings = davis::createShowSettingsChart(); - davis::showLineChartInBrowser(str_data, "file_data", settings.get()); + auto settings = dvs::createShowSettingsChart(); + dvs::showLineChartInBrowser(str_data, "file_data", settings.get()); } else if (chart_type == "s" || chart_type == "surface") { - auto settings = davis::createShowSettingsSurface(); - settings->colorScale = davis::colorscales::GLAMOUR; - davis::showSurfaceInBrowser(str_data, "surface", settings.get()); + auto settings = dvs::createShowSettingsSurface(); + settings->colorScale = dvs::colorscales::GLAMOUR; + dvs::showSurfaceInBrowser(str_data, "surface", settings.get()); } else if (chart_type == "m" || chart_type == "heatmap") { } } else { - auto settings = davis::createShowSettingsHeatMap(); - davis::showHeatMapInBrowser(str_data, "file_data", settings.get()); + auto settings = dvs::createShowSettingsHeatMap(); + dvs::showHeatMapInBrowser(str_data, "file_data", settings.get()); } } } diff --git a/plotly_maker/html_parts.cpp b/plotly_maker/html_parts.cpp index bd3d353..ec019c8 100644 --- a/plotly_maker/html_parts.cpp +++ b/plotly_maker/html_parts.cpp @@ -1,7 +1,7 @@ #include "html_parts.h" -namespace davis { -//#START_GRAB_TO_DAVIS_NAMESPACE +namespace dvs { +//#START_GRAB_TO_NAMESPACE // *INDENT-OFF* const char kDivSizePart[] = R"(
& values, inline bool heatmap_and_surface(const vector>& values, const std::string& title, - const davis::visualizationTypes& visualType, - const davis::colorscales& colorscale) { + const dvs::visualizationTypes& visualType, + const dvs::colorscales& colorscale) { std::string page; if (!createHtmlPageWithPlotlyJS(values, page, visualType, colorscale)) { return false; } string pageName; - davis::mayBeCreateJsWorkingFolder(); - pageName.append("./").append(davis::kOutFolderName).append(title).append(".html"); - davis::saveStringToFile(pageName, page); - davis::openPlotlyHtml(pageName); + mayBeCreateJsWorkingFolder(); + pageName.append("./").append(kOutFolderName).append(title).append(".html"); + saveStringToFile(pageName, page); + openPlotlyHtml(pageName); return true;// TODO handle different exceptions }; //#STOP_GRAB_TO_NAMESPACE } // namespace -namespace davis { -//#START_GRAB_TO_DAVIS_NAMESPACE +namespace dvs { +//#START_GRAB_TO_DVS_NAMESPACE using std::string; using std::vector; using std::istringstream; @@ -189,7 +190,7 @@ bool showLineChartInBrowser(const vector& values, string pageName; mayBeCreateJsWorkingFolder(); pageName.append("./").append(kOutFolderName).append(title).append(".html"); - davis::saveStringToFile(pageName, page); + saveStringToFile(pageName, page); openPlotlyHtml(pageName); return true; } @@ -234,7 +235,7 @@ bool showLineChartInBrowser(const vector& values, std::string pageName; mayBeCreateJsWorkingFolder(); pageName.append("./").append(kOutFolderName).append(title).append(".html"); - davis::saveStringToFile(pageName, page); + saveStringToFile(pageName, page); openPlotlyHtml(pageName); return true; } @@ -272,6 +273,6 @@ std::unique_ptr createShowSettingsChart() { visualizationTypes ShowSettings::getVisualType() const { return visualType; } -//#STOP_GRAB_TO_DAVIS_NAMESPACE -}; // namespace davis +//#STOP_GRAB_TO_DVS_NAMESPACE +}; // namespace dvs diff --git a/plotly_maker/plotly_maker.h b/plotly_maker/plotly_maker.h index d4d4f46..9792e3f 100644 --- a/plotly_maker/plotly_maker.h +++ b/plotly_maker/plotly_maker.h @@ -8,8 +8,8 @@ #include //#STOP_GRAB_TO_INCLUDES_LIST -namespace davis { -//#START_GRAB_TO_DAVIS_NAMESPACE +namespace dvs { +//#START_GRAB_TO_DVS_NAMESPACE using std::vector; @@ -86,8 +86,8 @@ bool showSurfaceInBrowser(const vector>& values, const std::strin bool showSurfaceInBrowser(const std::string& values, const std::string& title, const ShowSettingsSurface* settings); -//#STOP_GRAB_TO_DAVIS_NAMESPACE -}; // namespace davis +//#STOP_GRAB_TO_DVS_NAMESPACE +}; // namespace dvs #endif // PLOTLY_MAKER_PLOTLY_MAKER_H_