diff --git a/Contracts.jl b/Contracts.jl index 857f4a7..f5708b8 100644 --- a/Contracts.jl +++ b/Contracts.jl @@ -6,23 +6,31 @@ using Main.ContractAnalysis const results = analyze_contracts("data/contracts-data.csv") const _columns = names(results.data) const _treemap_data = prepare_treemap_data(results.hierarchical_premium) +const N = size(results.data)[1] @app begin # Main table - @out data_table_page = DataTable(results.data[1:10, :]) - @out pagination = DataTablePagination(rows_per_page=10, rows_number=size(results.data)[1]) - - @event request begin - # the process_request function will select the portion of df to be displayed as table_page - state = StippleUI.Tables.process_request(results.data, data_table_page, pagination, "") - data_table_page = state.datatable # the selected portion of df - pagination = state.pagination # update the pagination state in the backend and the browser + @out data_table_page = DataTable(results.data) + #=@out pagination = DataTablePagination(rows_per_page=10, rows_number=size(results.data)[1])=# + @out pagination = DataTablePagination(rows_per_page=10, rows_number=N) + @in filter = "" + @onchange filter begin + @show filter end + #==# + #=@event request begin=# + #= # the process_request function will select the portion of df to be displayed as table_page=# + #= state = StippleUI.Tables.process_request(results.data, data_table_page, pagination, "")=# + #= data_table_page = state.datatable # the selected portion of df=# + #= pagination = state.pagination # update the pagination state in the backend and the browser=# + #=end=# + # Data aggregation @in metrics_options = _columns @in target = :AdjustedPremium @in selected_metrics = [:ClientName, :Year] @out aggregated_data = DataTable(aggregate_data(results.premium_by_client_year, [:ClientName, :Year], :AdjustedPremium)) + @in filter_agg = "" @onchange selected_metrics, target begin aggregated_data = DataTable(aggregate_data(results.data, selected_metrics, target)) diff --git a/Yelt.jl b/Yelt.jl index 759a1ce..522b3b1 100644 --- a/Yelt.jl +++ b/Yelt.jl @@ -14,18 +14,18 @@ const _return_periods = [5, 10, 20, 50, 100] const rp_analysis = calculate_return_periods(yearly_losses, _return_periods) @app begin - @out yelt_data_table = DataTable(first(yelt_data, 10)) + @out yelt_data_table = DataTable(first(yelt_data, 20)) @out yearly_losses_table = DataTable(yearly_losses) @out yearly_losses_pagination = DataTablePagination(rows_per_page=_data_years, rows_number=_data_years) @out return_periods_table = DataTable(rp_analysis) @out specific_rp_analysis_table = DataTable() @out data_years = _data_years @out return_periods = _return_periods - @out pagination = DataTablePagination(rows_per_page=10, rows_number=size(yelt_data)[1]) + @out pagination = DataTablePagination(rows_per_page=20, rows_number=size(yelt_data)[1]) @event request begin # the process_request function will select the portion of df to be displayed as table_page - state = StippleUI.Tables.process_request(yelt_data, data_table_page, pagination, "") + state = StippleUI.Tables.process_request(yelt_data, yelt_data_table, pagination, "") data_table_page = state.datatable # the selected portion of df pagination = state.pagination # update the pagination state in the backend and the browser end diff --git a/contracts.jl.html b/contracts.jl.html index 9e6dd06..164271b 100644 --- a/contracts.jl.html +++ b/contracts.jl.html @@ -5,31 +5,45 @@ Yelt -
Table display and pagination
- + + + +
-
Data aggregation
- -
-
- - + + +
-
Data grouping
- -
-
- - + + +
-
-
Data hierarchy
+ + +

Premium per business entity - unit - segment

diff --git a/public/css/genieapp.css b/public/css/genieapp.css index 10b23ac..be681da 100644 --- a/public/css/genieapp.css +++ b/public/css/genieapp.css @@ -1,3 +1,36 @@ #idphq{ height:600px; -} \ No newline at end of file +} + +.sticky-header { + /* height or max-height is important */ + height: 310px; +} + +.sticky-header .q-table__top, +.sticky-header .q-table__bottom, +.sticky-header thead tr:first-child th { + /* bg color is important for th; just specify one */ + background-color: #FFFFFF; +} + +.sticky-header thead tr th { + position: sticky; + z-index: 1; +} + +.sticky-header thead tr:first-child th { + top: 0; +} + +/* this is when the loading indicator appears */ +.sticky-header.q-table--loading thead tr:last-child th { + /* height of all previous header rows */ + top: 48px; +} + +/* prevent scrolling behind sticky top row on focus */ +.sticky-header tbody { + /* height of all previous header rows */ + scroll-margin-top: 48px; +} diff --git a/yelt.jl.html b/yelt.jl.html index 121f11b..c65d4bc 100755 --- a/yelt.jl.html +++ b/yelt.jl.html @@ -9,27 +9,24 @@
YELT
- + + +

pagination is not working yet

Yearly losses
- +
Return periods
- +

Click an entry in the ReturnPeriod column to view its perils on the right table.

Top perils for RP {{selected_return_period}}
- -
-
-
-
- +