Skip to content

Commit bd2520e

Browse files
Merge branch 'master' into dash-wind-streaming
2 parents 4bc4c0a + 30fc6f6 commit bd2520e

File tree

13 files changed

+5967
-0
lines changed

13 files changed

+5967
-0
lines changed

apps/dash-lastodash/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
venv/
2+
.DS_Store

apps/dash-lastodash/Procfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web:gunicorn --pythonpath apps/dash-lastodash lastodash:server

apps/dash-lastodash/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# LAStoDash
2+
3+
## About this app
4+
5+
LAStoDash is a sample Dash project that takes a [Log ASCII Standard (LAS) file](http://www.cwls.org/las/) and builds a web app to view its content and print in PDF format.
6+
7+
As indicated in the [LAS 2.0 Specifications](http://www.cwls.org/wp-content/uploads/2017/02/Las2_Update_Feb2017.pdf), LAS files contain sections that are marked by a ~. The [LAS file](alcor1.las) used for this app contains four of these sections, including version and wrap mode information (~V), well identification (~W), curve information (~C), and ASCII log data (~A), all of which are displayed in some format (e.g. graph, table) in the demo app and the [printable report in PDF format](alcor1.pdf).
8+
9+
## How to run this app locally
10+
11+
## Installation
12+
13+
Clone the repository:
14+
15+
```
16+
$ git clone https://github.com/plotly/dash-sample-apps.git
17+
```
18+
19+
Redirect to the respective app directory:
20+
21+
```
22+
$ cd dash-sample-apps/apps/dash-lastodash
23+
```
24+
25+
Install the requirements:
26+
```
27+
$ pip3 install -r requirements.txt
28+
```
29+
30+
Find out how to run the app:
31+
```
32+
$ Python3 lastodash.py -h
33+
usage: lastodash.py [-h] [--debug] lasfile
34+
35+
Launch a Dash app to view a LAS log.
36+
37+
positional arguments:
38+
lasfile Log ASCII Standard (LAS) file
39+
40+
optional arguments:
41+
-h, --help show this help message and exit
42+
--debug, -d enable debug mode
43+
```
44+
45+
Run the app for the LAS file `alcor1.las`:
46+
```
47+
$ Python3 lastodash.py alcor1.las
48+
```
49+
50+
View in your browser at http://127.0.0.1:8050.
51+
52+
## Screenshots
53+
54+
![Screencast](alcor1.gif)
55+
56+
See [here](alcor1.pdf) the report printed in PDF format.
57+
58+
## Resources
59+
60+
* [Dash documentation for Python](https://dash.plot.ly/)
61+
* [Log ASCII Standard (LAS) file](http://www.cwls.org/las/)

apps/dash-lastodash/alcor1.gif

29 MB
Loading

apps/dash-lastodash/alcor1.las

Lines changed: 5100 additions & 0 deletions
Large diffs are not rendered by default.

apps/dash-lastodash/alcor1.pdf

1.04 MB
Binary file not shown.
9.13 KB
Loading
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Copyright 2018 Nicolas Riesco
3+
*
4+
* Redistribution and use in source and binary forms, with or without
5+
* modification, are permitted provided that the following conditions are met:
6+
*
7+
* 1. Redistributions of source code must retain the above copyright notice,
8+
* this list of conditions and the following disclaimer.
9+
*
10+
* 2. Redistributions in binary form must reproduce the above copyright notice,
11+
* this list of conditions and the following disclaimer in the documentation
12+
* and/or other materials provided with the distribution.
13+
*
14+
* 3. Neither the name of the copyright holder nor the names of its contributors
15+
* may be used to endorse or promote products derived from this software without
16+
* specific prior written permission.
17+
*
18+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28+
* POSSIBILITY OF SUCH DAMAGE.
29+
*/
30+
31+
(function() {
32+
registerPrintButtonHandler();
33+
return;
34+
35+
function registerPrintButtonHandler() {
36+
var button = document.getElementById("las-print");
37+
38+
if (!button || button.onclick === onPrintButtonClick) {
39+
setTimeout(registerPrintButtonHandler, 200);
40+
return;
41+
}
42+
43+
button.onclick = onPrintButtonClick;
44+
}
45+
46+
function onPrintButtonClick() {
47+
window.print();
48+
}
49+
})();
203 KB
Loading

0 commit comments

Comments
 (0)