Conversation
…rtly, some tweaking needs to be performed.
|
@rpkyle PR for Ternary app to be merged into master! |
rpkyle
left a comment
There was a problem hiding this comment.
The app looks great, and is very responsive, which is fantastic. Awesome work!
Just a few comments to address before moving ahead. One thing that we should sort out is the clipping for the ternary axis label on the left side. Compare the R version:
with the Python version:
There's a bit more space between the figures in the Python version -- it looks like the "Carbonate" label is being clipped -- i.e. the first letter looks slightly chopped off.
Not sure, but this might be a CSS issue?
|
|
||
| ``` | ||
| git clone https://github.com/plotly/dash-sample-apps.git | ||
| Run app.R in R Studio |
There was a problem hiding this comment.
We should either make this statement a valid command or remove it from the monospaced code block (to avoid confusion for new users).
| @@ -0,0 +1,50 @@ | |||
| ## dashr-oil-gas-ternary | |||
|
|
|||
| `dash-oil-gas-ternary` creates a dashboard for mineral composition evaluations from natural gas wells. | |||
| git clone https://github.com/plotly/dash-sample-apps.git | ||
| Run app.R in R Studio | ||
| ``` | ||
| In UNIX system: |
There was a problem hiding this comment.
I'd 🔪 lines 19-37, these are Python-related.
| df = read.csv("data/test_compositionR.csv") | ||
| df_prod = read.csv("data/YearlyProduction_table_1.csv") | ||
|
|
||
| colormap = list() |
There was a problem hiding this comment.
You could replace lines 28-33 with the following:
colormap <- setNames(colors[1:length(unique(df$fm_name))], unique(df$fm_name))
| ), | ||
| showlegend=TRUE | ||
| ) | ||
| data = list.append(data,new_trace) |
There was a problem hiding this comment.
We should rename the data object here, because data is an exported function from the namespace of the utils package in R.
Now, as for list.append ... ahem 🙂
Not a criticism of your code at all, but I find this to be a very silly function. Given x <- list(a=1,b=2,c=3):
> list.append(x,d=4,e=5)
$a
[1] 1
$b
[1] 2
$c
[1] 3
$d
[1] 4
$e
[1] 5
compare ☝️ with
> c(x, d=4, e=5)
$a
[1] 1
$b
[1] 2
$c
[1] 3
$d
[1] 4
$e
[1] 5
😄
| input("operator-select", "value")), | ||
| function(map_selected_data, tern_selected_data, op_select){ | ||
| dff = df[df$op %in% op_select,] | ||
| #browser() |
| state("ternary-map", "figure")), | ||
| function(map_selected_data, bar_selected_data, bar_click_data, op_select, | ||
| layer_select, curr_fig){ | ||
| #browser() |
| input("operator-select", "value"), | ||
| input("mapbox-view-selector", "value")), | ||
| function(tern_selected_data, bar_selected_data, bar_click_data, op_select, mapbox_view){ | ||
| #browser() |
| input("form-by-bar", "selectedData"), | ||
| input("operator-select", "value")), | ||
| function(map_select, tern_select, bar_select, op_select){ | ||
| #browser() |
| if(length(tern_select) > 0){ | ||
| processed_data = list('well_id' = list(), 'formation' = list()) | ||
| for (point in tern_select[['points']]) { | ||
| #if('customdata' %in% point){ |
|
@rpkyle i believe everything is corrected. As per the css issue, i did not notice it when i ran it on my system. |
| df_fm <- df_fm[-c(1),] | ||
|
|
||
| formation_name <- list() | ||
| i <- 1 |
There was a problem hiding this comment.
I found this interesting, looping using an index counter, I see that a lot in Python but not in R. It works fine, and I think it's more of a stylistic choice, personally I would iteratively loop through the range of elements in R, but I think it's your call how you do it. 👍
There was a problem hiding this comment.
for now, will stick with an index counter as it seems to work. definitely will use range or seq later on
HammadTheOne
left a comment
There was a problem hiding this comment.
Hi Kevin, the app code looks pretty solid, and it runs great as Ryan mentioned. The only issue I found was that if I select the "satellite-street" view on the 'Well Map', it seems to break Mapbox and sends a few errors in the browser console and I can no longer return to the other views. Aside from that error, seems like 💃 to me.
|
@HammadTheOne hmm that is very weird indeed. Ill look into that later today. If all the other options work properly and this one doesn't, then it may not be a problem with the code |
|
@rpkyle @HammadTheOne Fixed the satellite street view. Was a silly filtering where the |


Issue for app: #[issue number here]
App pull request
About
Workflow
elements necessary for successful deployment are in place.
existing gallery app, I've summarized the changes requested in the
appropriate Streambed issue and confirm that they have been applied.
the GitHub repository for the source code in the portal description.
DashR gallery, the app in this PR mimics, as closely as possible,
the style and functionality of the existing app.=
assets/folder.The pre-review review
I have addressed all of the following questions:
any dead and/or irrelevant code.)
readable and, where it isn't, it has been commented appropriately.)]
lessen the volume of code that needs to be maintained.)