un-fao / calipseo-shiny

Calipseo is FAO web- based platform for national Fisheries Authorities to streamline management of fisheries data and the production, analysis and reporting of fishery statistics.
1 stars 0 forks source link

[CALR-24] Vessels Details module - Apply generic function to display advanced species linechart #24

Closed eblondel closed 6 months ago

eblondel commented 6 months ago

Issue migrated from JIRA: https://sdlc.review.fao.org/jira/browse/CALR-24 Creator/Reporter: Emmanuel Blondel @eblondel Assignee: Brian Ojok @brianandy Priority: Medium Status: Done Date of creation: 2021-11-25T11:08:35.000+0000

The purpose of this improvement will be to extend the work done in CALR-15 with the work of [~alexandre.bennici@fao.org] on CALR-23, where advanced statistics chart handling is done with shinydashboardPlus.

 

eblondel commented 6 months ago

Author: Alexandre Bennici @abennici Date of creation: 2021-12-03T15:18:41.573+0000 Last update: 2021-12-03T15:18:41.573+0000

Globally to use the line_chart module, you have 2 thinks to manage (you can show an example below:


in UI part :

line_chart_ui(ns("sp"),sliderWidth =25)

-dont forget to include your id in ns()

-sideWidth provide you capacity to adjust width of sidebar include in the box


in server part:

line_chart_server(id="sp", df=data_logbooks, label="Species",colDate = "date",colTarget="species_desc",colValue="quantity",colText="text", rank=TRUE,nbToShow=5,rankLabel="Display x most caught species:",mode='plot+table')

id :should be the same of the ui part, do not include it in ns() in server part

data: it is you raw data to execute analysis, it must contain column information about date (ISO format), variables to project in x, y and legend (target)

label: it is the name use to rename target column in final table (if you include a table view)

colDate: column name for x axis

colValue: column name for y axis

colTarget:coumn name use to split and color in legend (here Species)

colText : is optional,you can use that to display other information in markers e.g for species concatenate english name, scientific name and asfis code

rank, is booleen if you want add capacity to have a button in sidebar to rank value and selecte a max number to display

nbToShow :is the max number to dislay if rank =T

 rankLabel could be use to change the default label link to nbToShow

mode :allow capacity to dislay plot('plot'), table('table') or both('plot+table','table+plot'),if this case plot and table are wrap in a tabset ,order of element indicate order of tab

eblondel commented 6 months ago

Author: Alexandre Bennici @abennici Date of creation: 2021-12-03T15:20:39.816+0000 Last update: 2021-12-03T15:20:39.816+0000

You have an example in core module 'logbook_overview', concretely you can do the same with a previous step with filter data with a specific vessel registration number