Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonMrt committed Sep 27, 2024
1 parent 7a24ee2 commit 6b46016
Show file tree
Hide file tree
Showing 16 changed files with 2,109 additions and 111 deletions.
Binary file added docs/_media/error_page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,044 changes: 2,044 additions & 0 deletions docs/_media/gui/bigFile.csv

Large diffs are not rendered by default.

Binary file added docs/_media/gui/bigFile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions docs/_media/gui/column.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
5.42342452
6
-7.234234
2e2
2e-2
5
6
7
Binary file added docs/_media/gui/column.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_media/gui/gui-all.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_media/gui/gui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions docs/_media/gui/xy.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-3;9
-2.5;6.25
-2;4
-1.5;2.25
-1;1
-0.5;0.25
0;0
0.5;0.25
1;1
1.5;2.25
2;4
2.5;6.25
3;9
Binary file added docs/_media/gui/xy_square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_media/logo_coverPage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion docs/c++_installation.md
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
Installation
# ⚒️ Installation

1. Download **davis.cpp**, **davis.h** and **plotly-2.32.0.min.js** from our last [release](https://github.com/valvals/devtools/releases)
2. Put **davis.cpp**, **davis.h** in one folder in your project
3. Put **plotly-2.32.0.min.js** to folder *your build_folder/davis_htmls*
4. Include **davis.h** to your project
5. Now you can use Davis functionality

> [!Note]
> If you are lazy to find folder at **step №3** you can skip this step. While running Davis you will be shown error page where you will see path you need
> <img src="_media//error_page.png" width="600">
1 change: 1 addition & 0 deletions docs/c++_usages.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ There is one template overload function to visualize different types of data:

<img src="_media//dv_show.png" width="1110">


<a name="arguments"></a>
First argument(s) of `dv::show(...)` is data we want to visualize. They are could be either pointer to template array with type `T` with array sizes:

Expand Down
74 changes: 22 additions & 52 deletions docs/gui_examples.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,26 @@
# 🔍 Examples

<!-- tabs:start -->

# **Large 2D matrix**

bigFile.csv - [download example](_media/gui/bigFile.csv ':ignore')

<img src="_media/gui/bigFile.png" width="500">

# **XY chart**

xy.csv - [download example](_media/gui/xy.csv ':ignore')

<img src="_media/gui/xy_square.png" width="500">

# ** 1 column data**

column.csv - [download example](_media/gui/column.csv ':ignore')

<img src="_media/gui/column.png" width="500">


<!-- tabs:end -->

## Heatmap

```cpp
#include "davis.h"

// vals - is user's 2d array
int rows = 20;
int cols = 20;
int** vals = new int* [rows];
for (int i = 0; i < rows; ++i) {
vals[i] = new int[cols];
for (int j = 0; j < cols; ++j) {
vals[i][j] = i * cols + j;
}
}
dv::show(vals, rows, cols); // pass varible and dimensions of 2d array
```
![2d](https://github.com/valvals/devtools/assets/104432560/16832af7-d8c4-4af9-b4b1-60b0d6027478)
## Surface
```cpp
#include "davis.h"
//it possible and std::list<std::vector<double>> values = ...
// std::vector<std::list<double>> values = ...
std::vector<std::vector<double>> values = {{30.3, 40, 98, 76}
, {99, 45, 20, 1}
, {5, 56, 93, 25}
, {45, 23, 90, 2}};
auto config = dv::Config();
config.typeVisual = dv::VISUALTYPE_SURFACE; // select surface visual mode
config.surf.colorSc = dv::COLORSCALE_THERMAL; // change colorscale
bool result = dv::show(values, "testSurfacePage", config); // pass 2d data, html page name, configuration structure
```
![surf](https://github.com/valvals/devtools/assets/104432560/8d1c5488-049f-4471-9e58-1e97b59c03e7)


## Chart

```cpp
#include "davis.h"

int vals[] = {2, 6, 4, -34, 56, 33, 2, 15 };
auto config = dv::Config();
config.heatmap.title = "Custom title"; // change default settings to custom for heatmap
config.heatmap.xLabel = "Custom xLabel"; // change default settings to custom for heatmap
config.heatmap.yLabel = "Custom yLabel"; // change default settings to custom for heatmap
bool result = dv::show(vals, sizeof(vals) / sizeof(vals[0]), "htmlPageName", config);
```
![chart](https://github.com/valvals/devtools/assets/104432560/43903324-f49c-42f3-9ef1-3cb7e95a786d)

2 changes: 1 addition & 1 deletion docs/gui_installation.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Installation
# ⚒️ Installation
62 changes: 8 additions & 54 deletions docs/gui_usages.md
Original file line number Diff line number Diff line change
@@ -1,60 +1,14 @@
# 💻 Usages
All user's functions, structs, etc. are placed in `dv::` namespace.

## Show(...) function
There is one template overload function for visualization different types of data:
1. Run davis.exe file
2. Drag and drop your text files to application window
3. Wait for vizualization data in browser

<img src="_media//dv_show.png" width="1110">
<img src="_media//gui-all.png" width="800">

First arguments of `dv::show(...)` could be either pointer to array:
We are using smart recognising of:
* column & line separators
* where is number data and where is text headers
* what type of data visualization is more appropriate

| Arguments | Description |
| ------------ | ------------ |
| ` T** data, uint64_t arrRows, uint64_t arrCols` | 2d array with arrRows × arrCols size. Data placed inside array of arrays |
| ` 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]) |
| ` const T* data, uint64_t count` | 1d array. Data placed inside array |

or container:

| Arguments | Description |
| ------------ | ------------ |
| ` 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` |
| ` C const& container` | 1d array. Data placed inside container. Сontainer requirements are the same |

</br>


## Configuration structure
Data vizuailisation can be tunned with using custom configuration `dv::Config`.
Configuration storred 3 structures and 1 enumeration.

1. Create `dv::Config` object;
```cpp
auto config = dv::Config();
```

2. Change it's type (or leave it default, so it will be `VISUALTYPE_AUTO`)
```cpp
config.typeVisual = dv::VISUALTYPE_SURFACE;
```

3. Change fields of neaded visualisation type

| Name of structure | Description |
| ------------ | ------------ |
|chart |for chart settings|
|heatmap |for heatmap settings |
|surf |for surface settings|

```cpp
config.surf.colorSc = dv::COLORSCALE_THERMAL;
config.surf.title = "Custom title";
config.surf.xLabel = "Custom xLabel";
config.surf.yLabel = "Custom yLabel";
config.surf.zLabel = "Custom zLabel";
```

4. Pass it to `dv::show(...)`;
```cpp
dv::show(yourData, "yourName", config);
```
4 changes: 1 addition & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
window.$docsify = {
name: 'DAVIS',
repo: 'https://github.com/DevToolsOrganization/matrix-data-visualization-DAVIS.git',
logo: '/_media/DevToolsDavis-updown-curves.svg',
logo: '/_media/logo_coverPage.png',
coverpage: true,

loadSidebar: true,
Expand Down Expand Up @@ -73,6 +73,4 @@
<script src="//unpkg.com/[email protected]/dist/docsify-mermaid.js"></script>
<script src="https://cdn.jsdelivr.net/npm/docsify-tabs@1"></script>
<script src="https://unpkg.com/docsify-plugin-flexible-alerts"></script>


</html>

0 comments on commit 6b46016

Please sign in to comment.