Skip to content

Commit 9294907

Browse files
committed
docs
1 parent f68f4ca commit 9294907

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+3065
-0
lines changed

docs/.nojekyll

Whitespace-only changes.

docs/FAQ.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# ❓ FAQ
2+
3+
### Generated html page is empty in browser
4+
Check you building folder, find folder **davis_htmls** and check if **plotly-2.32.0.min.js** exists.
5+
If it not exists copy this file manualy to this place.<br>
6+
And create bug issue :)
7+
8+
### Can I use newer Plotly .js file?
9+
All our test are made for plotly .js file which is placed at our last [release](https://github.com/valvals/devtools/releases) <br>
10+
But probably newer version will also work. So download newer .js file [at plotly page](https://plotly.com/javascript/), rename it to **plotly-2.32.0.min.js** and test by yorself.
11+
12+
### Which containers can I use in show() function?
13+
Containers must support implementation of `begin()` and `end()` methods. Content of containers must be convertable to `double`
14+
15+
### What if my data contains NaN / inf values?
16+
Data with NaN / inf values ​is not visualized
17+
18+
<img src="_media/faq1.png" width="200"> <img src="_media/faq2.png" width="200">

docs/LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# 📝 MIT License
2+
3+
Copyright (c) 2024 Anton Martinov, Valery Stanchyk
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

docs/README.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Introduction
2+
3+
## 💡 About
4+
DAVIS (Data Visualisation tool) is utility for data visualization. The visualization is based on [Plotly javascript](https://plotly.com/).
5+
DAVIS generate html page with injected data from code and after that launch browser to show it.
6+
DAVIS is available like C++ one-header library for quick matrix debugging/visualization, GUI- and CMD- application for text files visualization.
7+
8+
9+
## 📜 Background
10+
In our work, we often had to visualize data arrays while programming in C++. We tried a huge number of visualization tools, but none of them met
11+
our following requirements:
12+
- no need to use heavy libraries, which also require compilation. Preferably a one-header library;
13+
- only pure C++ 14 functionality, no frameworks and dependencies;
14+
- intuitively simple use without a long study of the documentation. Data visualization from code should be called with just one line of code - one function;
15+
- cross-platform;
16+
- working offline without using online visualization platforms.
17+
18+
All these requirements were embodied in DAVIS.
19+
20+
Also, applications with a command line interface and a graphical interface were created on C++ DAVIS library basis, which allow you to display
21+
numeric data in text files, automatically selecting the desired type of visualization and conducting semantic analysis of the file contents.
22+
23+
<style>
24+
td, th {
25+
border: none!important;
26+
}
27+
</style>
28+
29+
<table>
30+
<tbody>
31+
<tr style="height: 68px; border: 1px">
32+
<td style="width: 15%; height: 68px; text-align: left; vertical-align: top;">
33+
<p><br /><br /><br /><br /><br /><br /><br /></p>
34+
<p><a href="/matrix-data-visualization-DAVIS/#/c++_intro.md">Documentation С++</a></p>
35+
<p><br /><br /><br /><br /><br /></p>
36+
<p><a href="/matrix-data-visualization-DAVIS/#/gui_intro.md">Documentation GUI</a></p>
37+
<p><br /><br /><br /><br /></p>
38+
<p><a href="/matrix-data-visualization-DAVIS/#/cmd_intro.md">Documentation CMD</a></p>
39+
<p><br /></p>
40+
</td>
41+
<td style="width: 85%; height: 177px;">
42+
<p>&nbsp;</p>
43+
<h1 style="color: #5e9ca0;"><img src="_media//DAVIS-components.png" width="720"></h1>
44+
</td>
45+
</tr>
46+
</tbody>
47+
</table>
48+
49+
50+
51+
52+
53+
## ⭐ Used By
54+
This project is used by the following companies:
55+
- A. N. Sevchenko Institute of Applied Physical Problems of Belarusian State University
56+
<br>
57+
58+
## 🐝 Authors
59+
60+
<style>
61+
td, th {
62+
border: 1px solid black;
63+
}
64+
</style>
65+
<table>
66+
<tbody>
67+
<tr style="border: 1px">
68+
<td align="center" >
69+
<a href="https://www.github.com/AntonMrt"><img width="100 height="100"
70+
src="https://avatars.githubusercontent.com/u/104432560?v=4"></a>
71+
</br>
72+
Anton
73+
</td>
74+
<td align="center">
75+
<a href="https://www.github.com/ValeryStk"><img width="100 height="100"
76+
src="https://avatars.githubusercontent.com/u/73784374?v=4"></a>
77+
</br>
78+
Valery
79+
</td>
80+
81+
</tr>
82+
<tbody>
83+
</table>
84+
85+
## 📞 Contacts
86+
For any questions please contact<br>
87+
devtools.public@gmail.com
88+

docs/_archieve/README.md

Lines changed: 254 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,254 @@
1+
![C++](https://img.shields.io/badge/c++-%2300599C.svg?style=Plastic&logo=c%2B%2B&logoColor=white)
2+
![Workflow](https://github.com/valvals/devtools/actions/workflows/cmake-multi-platform.yml/badge.svg?branch=main)
3+
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)
4+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=DevToolsOrganization_matrix-data-visualization-DAVIS&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=DevToolsOrganization_matrix-data-visualization-DAVIS)
5+
[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=DevToolsOrganization_matrix-data-visualization-DAVIS&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=DevToolsOrganization_matrix-data-visualization-DAVIS)
6+
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=DevToolsOrganization_matrix-data-visualization-DAVIS&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=DevToolsOrganization_matrix-data-visualization-DAVIS)
7+
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=DevToolsOrganization_matrix-data-visualization-DAVIS&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=DevToolsOrganization_matrix-data-visualization-DAVIS)
8+
[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=DevToolsOrganization_matrix-data-visualization-DAVIS&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=DevToolsOrganization_matrix-data-visualization-DAVIS)
9+
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=DevToolsOrganization_matrix-data-visualization-DAVIS&metric=bugs)](https://sonarcloud.io/summary/new_code?id=DevToolsOrganization_matrix-data-visualization-DAVIS)
10+
[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=DevToolsOrganization_matrix-data-visualization-DAVIS&metric=sqale_index)](https://sonarcloud.io/summary/new_code?id=DevToolsOrganization_matrix-data-visualization-DAVIS)
11+
12+
[<img src="https://github.com/user-attachments/assets/7425ddb9-8b6e-4303-8e29-f1144cc79acb" width="220">](https://github.com/DevToolsOrganization)
13+
14+
![Logo](https://github.com/valvals/devtools/assets/104432560/27f28dde-27bc-47f6-8696-f80fb7b4661b)
15+
16+
17+
## Table of Contents
18+
19+
* [💡 About](#-about)
20+
* [🔍 Examples](#-examples)
21+
* [💻 Usage](#-usage)
22+
* [⚒️ Setup](#-setup)
23+
* [❓ FAQ](#-faq)
24+
* [🚀 Room for Improvement](#-room-for-improvement)
25+
* [⭐ Used By](#-used-by)
26+
* [🐝 Authors](#-authors)
27+
* [📞 Contacts](#-contacts)
28+
* [📝 Licence](#-license)
29+
30+
31+
# 💡 About
32+
DAVIS (Data Visualisation tool) is utility for data visualization. The visualization is based on [Plotly javascript](https://plotly.com/) So DAVIS generate html page with injected data from code and after that launch browser to show it.
33+
34+
One of the main tasks we solve is to make it easier to debug your application. With Davis you can easy visualize your one- and two-dimensional data variables.
35+
36+
Davis is easy-to-use tool:
37+
* one .h file, one .cpp file, one .js file
38+
* only native c++11 functions, zero external dependences
39+
* simple short syntaxis for minimize code you need to write
40+
41+
# 🔍 Examples
42+
43+
<details>
44+
<summary>Example 1</summary>
45+
46+
```cpp
47+
#include "davis.h"
48+
49+
// vals - is user's 2d array
50+
int rows = 20;
51+
int cols = 20;
52+
int** vals = new int* [rows];
53+
for (int i = 0; i < rows; ++i) {
54+
vals[i] = new int[cols];
55+
for (int j = 0; j < cols; ++j) {
56+
vals[i][j] = i * cols + j;
57+
}
58+
}
59+
dv::show(vals, rows, cols); // pass varible and dimensions of 2d array
60+
```
61+
![2d](https://github.com/valvals/devtools/assets/104432560/16832af7-d8c4-4af9-b4b1-60b0d6027478)
62+
</details>
63+
64+
<details>
65+
<summary>Example 2</summary>
66+
67+
```cpp
68+
#include "davis.h"
69+
70+
//it possible and std::list<std::vector<double>> values = ...
71+
// std::vector<std::list<double>> values = ...
72+
std::vector<std::vector<double>> values = {{30.3, 40, 98, 76}
73+
, {99, 45, 20, 1}
74+
, {5, 56, 93, 25}
75+
, {45, 23, 90, 2}};
76+
auto config = dv::Config();
77+
config.typeVisual = dv::VISUALTYPE_SURFACE; // select surface visual mode
78+
config.surf.colorSc = dv::COLORSCALE_THERMAL; // change colorscale
79+
bool result = dv::show(values, "testSurfacePage", config); // pass 2d data, html page name, configuration structure
80+
```
81+
![surf](https://github.com/valvals/devtools/assets/104432560/8d1c5488-049f-4471-9e58-1e97b59c03e7)
82+
</details>
83+
84+
<details>
85+
<summary>Example 3</summary>
86+
87+
```cpp
88+
#include "davis.h"
89+
90+
int vals[] = {2, 6, 4, -34, 56, 33, 2, 15 };
91+
auto config = dv::Config();
92+
config.heatmap.title = "Custom title"; // change default settings to custom for heatmap
93+
config.heatmap.xLabel = "Custom xLabel"; // change default settings to custom for heatmap
94+
config.heatmap.yLabel = "Custom yLabel"; // change default settings to custom for heatmap
95+
bool result = dv::show(vals, sizeof(vals) / sizeof(vals[0]), "htmlPageName", config);
96+
```
97+
![chart](https://github.com/valvals/devtools/assets/104432560/43903324-f49c-42f3-9ef1-3cb7e95a786d)
98+
</details>
99+
100+
# 💻 Usage
101+
All user's functions, structs, etc. are placed in `dv::` namespace.
102+
103+
<details>
104+
<summary>Show(...) function</summary>
105+
106+
## Show(...) function
107+
There is one template overload function for visualization different types of data:
108+
109+
```cpp
110+
template <typename T>
111+
dv::show(...)
112+
```
113+
114+
First arguments of `dv::show(...)` could be either pointer to array:
115+
| Arguments | Description |
116+
| ------------ | ------------ |
117+
| ` T** data, uint64_t arrRows, uint64_t arrCols` | 2d array with arrRows × arrCols size. Data placed inside array of arrays |
118+
| ` const T* data, uint64_t arrRows, uint64_t arrCols` | 2d array with arrRows × arrCols size. Data placed inside pseudo 2d array (element access [i*arrCols + j]) |
119+
| ` const T* data, uint64_t count` | 1d array. Data placed inside array |
120+
121+
or container:
122+
| Arguments | Description |
123+
| ------------ | ------------ |
124+
| ` C const& container_of_containers ` | 2d array. Data placed inside container of containers. Containers can be `std::vector`, `std::list`, `std::array`, etc. Content of containers must be convertable to `double` |
125+
| ` C const& container` | 1d array. Data placed inside container. Сontainer requirements are the same |
126+
127+
128+
Two last arguments of `dv::show(...)` are also the same: `const std::string& htmlPageName` and `const dv::Config& configuration`. Theese arguments have default values.
129+
* `htmlPageName` - name of html page will be generated
130+
* `configuration` - configuration structure with custom settings
131+
132+
</br>
133+
134+
```cpp
135+
using std::vector;
136+
using std::string;
137+
138+
//! 2-dimensional array
139+
template <typename T>
140+
bool show(T** data, uint64_t arrRows, uint64_t arrCols,
141+
const string& htmlPageName = dvs::kAppName, const Config& configuration = Config());
142+
143+
//! 1-dimensional array that simulates a 2-dimensional one (element access [i*cols+j])
144+
template <typename T>
145+
bool show(const T* data, uint64_t arrRows, uint64_t arrCols,
146+
const string& htmlPageName = dvs::kAppName, const Config& configuration = Config());
147+
148+
//! 1-dimensional array
149+
template <typename T>
150+
bool show(const T* data, uint64_t count, const string& htmlPageName = dvs::kAppName, const Config& configuration = Config());
151+
152+
//! 1-dimensional container
153+
template<typename C,
154+
typename T = std::decay_t<decltype(*begin(std::declval<C>()))>,
155+
typename = std::enable_if_t<std::is_convertible_v<T, double>> >
156+
bool show(C const& container, const string& htmlPageName = dvs::kAppName, const Config& configuration = Config());
157+
158+
//! 2-dimensional container
159+
template<typename C,
160+
typename T = std::decay_t<decltype(*begin(std::declval<C>()))>,
161+
typename E = std::decay_t<decltype(*begin(std::declval<T>()))>,
162+
typename = std::enable_if_t<std::is_convertible_v<E, double>> >
163+
bool show(C const& container_of_containers, const string& htmlPageName = dvs::kAppName, const Config& configuration = Config());
164+
```
165+
</details>
166+
167+
<details>
168+
<summary>Configuration structure</summary>
169+
170+
## Configuration structure
171+
Data vizuailisation can be tunned with using custom configuration `dv::Config`.
172+
Configuration storred 3 structures and 1 enumeration.
173+
174+
1. Create `dv::Config` object;
175+
176+
2. Change it's type (or not, so it will be `VISUALTYPE_AUTO`)
177+
```cpp
178+
enum config_visualizationTypes {
179+
VISUALTYPE_AUTO, //if user not forces some specific type it will be recognized by context
180+
VISUALTYPE_CHART,
181+
VISUALTYPE_HEATMAP,
182+
VISUALTYPE_SURFACE
183+
};
184+
```
185+
186+
3. Change fields of neaded visualisation type
187+
188+
| Name of structure | Description |
189+
| ------------ | ------------ |
190+
|chart |for chart settings|
191+
|heatmap |for heatmap settings |
192+
|surf |for surface settings|
193+
194+
Settings fields can be
195+
* `title` - title at top of image
196+
* `xLabel` - title of X axis
197+
* `yLabel` - title of Y axis
198+
* `zLabel` - title of Z axis
199+
* `colorScale` - type of colorscale from enum `config_colorscales`
200+
201+
4. Pass it to `dv::show(...)`;
202+
</details>
203+
204+
205+
206+
207+
# ⚒️ Setup
208+
1. Download **davis.cpp**, **davis.h** and **plotly-2.27.0.min.js** from our last [release](https://github.com/valvals/devtools/releases)
209+
2. Put them in one folder in your project
210+
3. Include **davis.h** to your project
211+
4. Now you can use Davis functionality
212+
213+
# ❓ FAQ
214+
### Generated html page is empty in browser
215+
Check you building folder, find folder **davis_htmls** and check if **plotly-2.27.0.min.js** exists.
216+
If it not exists copy this file manualy to this place.<br>
217+
And create bug issue :)
218+
219+
### Can I use newer Plotly .js file?
220+
All our test are made for plotly .js file which is placed at our last [release](https://github.com/valvals/devtools/releases) <br>
221+
But probably newer version will also work. So download newer .js file [at plotly page](https://plotly.com/javascript/), rename it to **plotly-2.27.0.min.js** and test by yorself.
222+
223+
### Which containers can I use in show() function?
224+
Containers must support implementation of `begin()` and `end()` methods. Content of containers must be convertable to `double`
225+
226+
227+
# 🚀 Room for Improvement
228+
Our next steps will involve:
229+
* template functions for saving arrays like text files with separators
230+
* compiling Davis to exe-file which provide command line interface for visualisation text files or copypasted data
231+
* adding some evaluated statistic information abou data to generated html page
232+
233+
# ⭐ Used By
234+
This project is used by the following companies:
235+
- A. N. Sevchenko Institute of Applied Physical Problems of Belarusian State University
236+
237+
# 🐝 Authors
238+
[AntonMrt](https://www.github.com/AntonMrt), [ValeryStk](https://www.github.com/ValeryStk)\
239+
You are welcome to our team!
240+
241+
# 📞 Contacts
242+
For any questions please contact<br>
243+
devtools.public@gmail.com
244+
245+
# 📝 License
246+
License is [MIT](https://opensource.org/license/mit)
247+
248+
Copyright 2024 Anton Martinov & Valery Stanchyk
249+
250+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
251+
252+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
253+
254+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

docs/_archieve/_navbar.md

Whitespace-only changes.

0 commit comments

Comments
 (0)