Skip to content

Commit

Permalink
114 plotly version constant (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
valvals authored Jul 22, 2024
1 parent ca11d32 commit 8d889df
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 11 deletions.
8 changes: 4 additions & 4 deletions common_utils/common_constants.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include "common_constants.h"

#include "string"
namespace dvs {
//#START_GRAB_TO_DVS_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";
const char kPlotlyJsWorkPath[] = "./davis_htmls/plotly-2.32.0.min.js";
const char kPlotlyJsName[] = "plotly-2.32.0.min.js";
const char kPlotlyJsResourcePath[] = "plotly_maker/plotly-2.32.0.min.js";
const char kWarningPagePath[] = "./davis_htmls/warning_js_absent.html";
//#STOP_GRAB_TO_DVS_NAMESPACE
}
12 changes: 7 additions & 5 deletions davis_one/davis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
namespace dvs {
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";
const char kPlotlyJsWorkPath[] = "./davis_htmls/plotly-2.32.0.min.js";
const char kPlotlyJsName[] = "plotly-2.32.0.min.js";
const char kPlotlyJsResourcePath[] = "plotly_maker/plotly-2.32.0.min.js";
const char kWarningPagePath[] = "./davis_htmls/warning_js_absent.html";

} // namespace dvs end
Expand Down Expand Up @@ -270,7 +270,7 @@ viewBox="0 0 11237.16 8236.39"
</svg>
</div>
<div class ="dont_worry">
<p class="worry_text">If you see this page it means that plotly-2.27.0.min.js
<p class="worry_text">If you see this page it means that %2
<br>file is absent...</br>
</p>
<div class="worry_text">But don't worry!</div>
Expand Down Expand Up @@ -776,7 +776,9 @@ void showWarningJsAbsentPage() {
#elif __linux__
davis_dir = "/davis_htmls";
#endif
vector<string>args = {getCurrentPath() + davis_dir};
vector<string>args{ARGS_WARNING_PAGE_SIZE,""};
args[ARG_WORKING_FOLDER] = getCurrentPath() + davis_dir;
args[ARG_JS_VERSION] = kPlotlyJsName;
make_string(kWarningJSLibAbsentPage, args, out);
saveStringToFile(kWarningPagePath, out);
openFileBySystem(kWarningPagePath);
Expand Down
8 changes: 8 additions & 0 deletions davis_one/davis.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,14 @@ enum ARGS_INDEX {
// ADD NEW ENUM BEFORE THIS COMMENT
ARGS_SIZE
};

enum ARGS_WARNING_PAGE_INDEX {
ARG_WORKING_FOLDER,
ARG_JS_VERSION,
// ADD NEW ENUM BEFORE THIS COMMENT
ARGS_WARNING_PAGE_SIZE
};

extern const char kHtmlModel[];
extern const char kColorMapDefaultPart[];
extern const char kColorMapSunnyPart[];
Expand Down
2 changes: 1 addition & 1 deletion plotly_maker/html_parts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ viewBox="0 0 11237.16 8236.39"
</svg>
</div>
<div class ="dont_worry">
<p class="worry_text">If you see this page it means that plotly-2.27.0.min.js
<p class="worry_text">If you see this page it means that %2
<br>file is absent...</br>
</p>
<div class="worry_text">But don't worry!</div>
Expand Down
8 changes: 8 additions & 0 deletions plotly_maker/html_parts.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ enum ARGS_INDEX {
// ADD NEW ENUM BEFORE THIS COMMENT
ARGS_SIZE
};

enum ARGS_WARNING_PAGE_INDEX {
ARG_WORKING_FOLDER,
ARG_JS_VERSION,
// ADD NEW ENUM BEFORE THIS COMMENT
ARGS_WARNING_PAGE_SIZE
};

extern const char kHtmlModel[];
extern const char kColorMapDefaultPart[];
extern const char kColorMapSunnyPart[];
Expand Down
4 changes: 3 additions & 1 deletion plotly_maker/plotly_maker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,9 @@ void showWarningJsAbsentPage() {
#elif __linux__
davis_dir = "/davis_htmls";
#endif
vector<string>args = {getCurrentPath() + davis_dir};
vector<string>args{ARGS_WARNING_PAGE_SIZE,""};
args[ARG_WORKING_FOLDER] = getCurrentPath() + davis_dir;
args[ARG_JS_VERSION] = kPlotlyJsName;
make_string(kWarningJSLibAbsentPage, args, out);
saveStringToFile(kWarningPagePath, out);
openFileBySystem(kWarningPagePath);
Expand Down

0 comments on commit 8d889df

Please sign in to comment.