Commit 99dbdfd6 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[DEMO] dashboard + userpage + documents view

parent ee617d7c
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -11,6 +11,9 @@ import React.DOM.Props (className, style) ...@@ -11,6 +11,9 @@ import React.DOM.Props (className, style)
import Tabview as Tab import Tabview as Tab
import Thermite (PerformAction, Render, Spec, defaultPerformAction, modifyState, simpleSpec) import Thermite (PerformAction, Render, Spec, defaultPerformAction, modifyState, simpleSpec)
import Gargantext.Charts.ECharts (chart)
import Gargantext.Dashboard (globalPublis)
type State = Tab.State type State = Tab.State
type Action = Tab.Action type Action = Tab.Action
...@@ -57,4 +60,5 @@ corpusAnalysisSpec = simpleSpec defaultPerformAction render ...@@ -57,4 +60,5 @@ corpusAnalysisSpec = simpleSpec defaultPerformAction render
] ]
] ]
] ]
, chart globalPublis
] ]
...@@ -250,7 +250,14 @@ sampleData' :: Corpus ...@@ -250,7 +250,14 @@ sampleData' :: Corpus
sampleData' = Corpus {_id : 1, url : "", date : "date3", title : "title", source : "source", fav : false, ngramCount : 1} sampleData' = Corpus {_id : 1, url : "", date : "date3", title : "title", source : "source", fav : false, ngramCount : 1}
-- --
sampleData :: Array Corpus sampleData :: Array Corpus
sampleData = replicate 10 sampleData' --sampleData = replicate 10 sampleData'
sampleData = map (\(Tuple t s) -> Corpus {_id : 1, url : "", date : "2017", title: t, source: s, fav : false, ngramCount : 10}) sampleDocuments
sampleDocuments :: Array (Tuple String String)
sampleDocuments = [Tuple "Macroscopic dynamics of the fusion process" "Journal de Physique Lettres",Tuple "Effects of static and cyclic fatigue at high temperature upon reaction bonded silicon nitride" "Journal de Physique Colloques",Tuple "Reliability of metal/glass-ceramic junctions made by solid state bonding" "Journal de Physique Colloques",Tuple "High temperature mechanical properties and intergranular structure of sialons" "Journal de Physique Colloques",Tuple "SOLUTIONS OF THE LANDAU-VLASOV EQUATION IN NUCLEAR PHYSICS" "Journal de Physique Colloques",Tuple "A STUDY ON THE FUSION REACTION 139La + 12C AT 50 MeV/u WITH THE VUU EQUATION" "Journal de Physique Colloques",Tuple "Atomic structure of \"vitreous\" interfacial films in sialon" "Journal de Physique Colloques",Tuple "MICROSTRUCTURAL AND ANALYTICAL CHARACTERIZATION OF Al2O3/Al-Mg COMPOSITE INTERFACES" "Journal de Physique Colloques",Tuple "Development of oxidation resistant high temperature NbTiAl alloys and intermetallics" "Journal de Physique IV Colloque",Tuple "Determination of brazed joint constitutive law by inverse method" "Journal de Physique IV Colloque",Tuple "Two dimensional estimates from ocean SAR images" "Nonlinear Processes in Geophysics",Tuple "Comparison Between New Carbon Nanostructures Produced by Plasma with Industrial Carbon Black Grades" "Journal de Physique III",Tuple "<i>Letter to the Editor:</i> SCIPION, a new flexible ionospheric sounder in Senegal" "Annales Geophysicae",Tuple "Is reducibility in nuclear multifragmentation related to thermal scaling?" "Physics Letters B",Tuple "Independence of fragment charge distributions of the size of heavy multifragmenting sources" "Physics Letters B",Tuple "Hard photons and neutral pions as probes of hot and dense nuclear matter" "Nuclear Physics A",Tuple "Surveying the nuclear caloric curve" "Physics Letters B",Tuple "A hot expanding source in 50 A MeV Xe+Sn central reactions" "Physics Letters B"]
data' :: Array Corpus -> Array {row :: Corpus, delete :: Boolean} data' :: Array Corpus -> Array {row :: Corpus, delete :: Boolean}
data' = map {row : _, delete : false} data' = map {row : _, delete : false}
...@@ -276,7 +283,7 @@ showRow {row : (Corpus c), delete} = ...@@ -276,7 +283,7 @@ showRow {row : (Corpus c), delete} =
[ td [] [div [className $ fa <> "fa-star"][]] [ td [] [div [className $ fa <> "fa-star"][]]
-- TODO show date: Year-Month-Day only -- TODO show date: Year-Month-Day only
, td [] [text c.date] , td [] [text c.date]
, td [] [ a [ href "#/userPage"] [ text c.title ] ] , td [] [ a [ if c.fav == true then href "#/userPage" else href "#/documentView/1" ] [ text c.title ] ]
, td [] [text c.source] , td [] [text c.source]
, td [] [input [ _type "checkbox"] []] , td [] [input [ _type "checkbox"] []]
] ]
......
...@@ -32,34 +32,18 @@ render dispatch _ state _ = [ ...@@ -32,34 +32,18 @@ render dispatch _ state _ = [
] ]
, chart distriBySchool , chart distriBySchool
, div [className "row"] (map (\school -> div [className "col-md-4 content"] [chart $ focus school]) , div [className "row"] (map (\school -> div [className "col-md-4 content"] [chart $ focus school])
[ "Telecom Paris Sud", "Telecom Bretagne", "Telecom ParisTech"] [ "Télécom Bretagne", "Mines Nantes", "Eurecom"]
) )
] ]
where where
distriBySchool :: Options
distriBySchool = Options { mainTitle : "School production in 2018"
, subTitle : "Distribution by school"
, xAxis : xAxis []
, yAxis : [ series Pie "Pie data" [{name: "Sud Paris", value: 50.0},
{name: "Eurecom", value: 45.0},
{name: "Telecom ParisTech", value: 65.0},
{name: "Telecom Bretagne", value: 15.0},
{name: "Telecom Saint-Etienne", value: 23.0}
]
]
, yAxisFormat : (YAxisFormat { position : ""
, visible : false
})
, addZoom : false
}
focus :: String -> Options focus :: String -> Options
focus school = Options { mainTitle : ("Focus " <> school) focus school = Options { mainTitle : ("Focus " <> school)
, subTitle : "Total scientific publications" , subTitle : "Total scientific publications"
, xAxis : xAxis ["Jan", "Feb", "Mar"] , xAxis : xAxis ["2015", "2016", "2017"]
, yAxis : [series Bar "Bar Data" [ {name: "val1", value: 50.0} , yAxis : [series Bar "Bar Data" [ {name: "val1", value: 50.0}
, {name: "val2", value: 20.0} , {name: "val2", value: 70.0}
, {name: "val5", value: 100.0} , {name: "val3", value: 80.0}
] ]
] ]
, yAxisFormat : (YAxisFormat { position : "left" , yAxisFormat : (YAxisFormat { position : "left"
...@@ -72,8 +56,8 @@ render dispatch _ state _ = [ ...@@ -72,8 +56,8 @@ render dispatch _ state _ = [
----------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------------
naturePublis_x = ["COMM","ART","COUV","THESE","REPORT","UNDEFINED","OTHER","POSTER","DOUV","OUV","PATENT","MEM","HDR","PRESCONF","LECTURE","VIDEO"] naturePublis_x = ["Com","Articles","Thèses","Reports"]
naturePublis_y' = [23901,17417,1585,1188,1176,895,473,393,323,246,108,43,36,26,9,1] naturePublis_y' = [23901,17417,1188,1176]
naturePublis_y = map (\(Tuple n v) -> {name: n, value: toNumber v }) (zip naturePublis_x naturePublis_y') naturePublis_y = map (\(Tuple n v) -> {name: n, value: toNumber v }) (zip naturePublis_x naturePublis_y')
...@@ -90,10 +74,10 @@ naturePublis = Options { mainTitle : "Nature of publications" ...@@ -90,10 +74,10 @@ naturePublis = Options { mainTitle : "Nature of publications"
----------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------------------------------------------
globalPublis_x = [1982,1986,1987,1988,1990,1993,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017] globalPublis_x = [1982,1986,1987,1988,1990,1993,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017]
globalPublis_y = [1,4,2,1,1,2,1,1,8,38,234,76,40,82,75,202,1475,1092,1827,2630,4978,3668,4764,5915,4602,5269,6814,4018] globalPublis_y = [1,4,2,1,1,2,1,1,8,38,234,76,40,82,75,202,1475,1092,1827,2630,4978,3668,4764,5915,4602,5269,6814,4018]
globalPublis :: Options globalPublis :: Options
globalPublis = (Options { mainTitle : "Global Scientific Publications" globalPublis = (Options { mainTitle : "Global Scientific Publications"
, subTitle : "Distribution of scientific publications by IMT's Schools over time" , subTitle : "Distribution of scientific publications by IMT's Schools over time"
...@@ -107,5 +91,19 @@ globalPublis = (Options { mainTitle : "Global Scientific Publications" ...@@ -107,5 +91,19 @@ globalPublis = (Options { mainTitle : "Global Scientific Publications"
distriBySchool_y = [(Tuple "Télécom Bretagne" 17383),(Tuple "Mines Nantes" 11055),(Tuple "Télécom SudParis" 7663),(Tuple "Télécom ParisTech" 3848),(Tuple "Mines Al\232s" 624),(Tuple "Télécom \201cole de Management" 539),(Tuple "IMT Atlantique" 241),(Tuple "Mines Albi-Carmaux" 125)]
distriBySchool :: Options
distriBySchool = Options { mainTitle : "School production in 2018"
, subTitle : "Distribution by school"
, xAxis : xAxis []
, yAxis : [ series Pie "Pie data" (map (\(Tuple n v) -> {name: n, value: toNumber v}) distriBySchool_y)]
, yAxisFormat : (YAxisFormat { position : ""
, visible : false
})
, addZoom : false
}
layoutDashboard :: forall props eff. Spec (dom :: DOM | eff) State props Action layoutDashboard :: forall props eff. Spec (dom :: DOM | eff) State props Action
layoutDashboard = simpleSpec performAction render layoutDashboard = simpleSpec performAction render
...@@ -15,7 +15,7 @@ import Thermite (Render) ...@@ -15,7 +15,7 @@ import Thermite (Render)
render :: forall props. Render State props Action render :: forall props. Render State props Action
render dispatch _ state _ = render dispatch _ state _ =
[ button [RP.onClick \_ -> dispatch $ FetchUser 452145] [ text "Fetch User"], [ button [RP.onClick \_ -> dispatch $ FetchUser 473593] [ text "Fetch User"],
div [className "col-md-12"] div [className "col-md-12"]
$ case state.user of $ case state.user of
(Just (User user)) -> display user.name [userInfos user.hyperdata] (Just (User user)) -> display user.name [userInfos user.hyperdata]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment