Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
76e18024
Commit
76e18024
authored
Mar 16, 2018
by
Abinaya Sudhir
Browse files
Options
Browse Files
Download
Plain Diff
pulled code
parents
ac67045d
dfb784a8
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
661 additions
and
662 deletions
+661
-662
AddCorpusview.purs
src/AddCorpusview.purs
+10
-5
Chart.purs
src/Chart.purs
+118
-114
DocView.purs
src/DocView.purs
+142
-118
Landing.purs
src/Landing.purs
+57
-176
Login.purs
src/Login.purs
+14
-9
Navigation.purs
src/Navigation.purs
+176
-118
PageRouter.purs
src/PageRouter.purs
+26
-16
SearchForm.purs
src/SearchForm.purs
+35
-36
UserPage.purs
src/UserPage.purs
+83
-70
No files found.
src/AddCorpusview.purs
View file @
76e18024
...
...
@@ -30,6 +30,7 @@ import Routing.Hash.Aff (setHash)
import Thermite (PerformAction, Render, Spec, _render, cotransform, focus, foreach, modifyState, simpleSpec, withState)
import Unsafe.Coerce (unsafeCoerce)
import Landing as L
type State =
...
...
@@ -61,7 +62,10 @@ data Action
| GO
performAction :: forall eff props. PerformAction (console :: CONSOLE, ajax :: AJAX,dom::DOM | eff) State props Action
performAction :: forall eff props. PerformAction ( console :: CONSOLE
, ajax :: AJAX
, dom :: DOM
| eff ) State props Action
performAction NoOp _ _ = void do
modifyState id
...
...
@@ -91,7 +95,8 @@ addcorpusviewSpec = simpleSpec performAction render
render :: Render State props Action
render dispatch _ state _ =
[
div [className "container"]
div [className "container"] [L.jumboTitle false]
, div [className "container"]
[
div [className "jumbotron"]
[ div [className "row"]
...
...
src/Chart.purs
View file @
76e18024
...
...
@@ -51,9 +51,9 @@ type EchartsProps eff =
option :: Option, -- PropTypes.object.isRequired,
initOpts :: String, -- PropTypes.object,
notMerge :: Boolean,
lazyUpdate:: Boolean,
lazyUpdate
:: Boolean,
loading :: Boolean,
optsLoading
::
OptsLoading, -- PropTypes.object,
optsLoading
::
OptsLoading, -- PropTypes.object,
onReady :: String, -- PropTypes.func,
resizable :: Boolean, -- PropTypes.bool,
onEvents :: String -- PropTypes.object
...
...
@@ -63,7 +63,7 @@ type OptsLoading =
{ text :: String,
color :: Color, --- color
textColor :: Color, --color
maskColor:: Color, --color
maskColor
:: Color, --color
zlevel :: Int
}
...
...
@@ -80,11 +80,11 @@ type Option =
type DataZoom =
{"type":: String
, xAxisIndex:: Int
, filterMode:: String
, start:: Int
, end:: Int
{"type"
:: String
, xAxisIndex
:: Int
, filterMode
:: String
, start
:: Int
, end
:: Int
}
type Grid =
...
...
@@ -116,7 +116,7 @@ type Legend =
}
type Data =
{
name
:: String
{
name
:: String
, icon :: String
, textStyle :: {}
}
...
...
@@ -173,7 +173,7 @@ type AxisLabel =
type Series =
{
name
:: String
{
name
:: String
, "type" :: String
, "data" :: Array Int
}
...
...
@@ -373,16 +373,20 @@ yAxisIndex = unsafeMkProps "yAxisIndex"
-- , p''
-- ]
ex1
:: ReactElement
ex1
= echarts
histogram
:: ReactElement
histogram
= echarts
[ option
[ tooltip [trigger "axis"]
, grid [containLabel true]
, legend [data' ["Query A", "Query B", "Query C"]]
, legend [data' ["Map terms coverage", "Favorites", "All"]]
-- , legend [data' ["Map Terms coverage", "Favorites", "All"]]
, xAxis
[ type' "category"
, axisTick [alignWithLabel true]
, data' ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "July", "Aug", "Sep", "Oct", "Nov", "Dec"]
, data' ["Jan" , "Feb", "Mar" , "Apr"
, "May", "Jun", "July", "Aug"
, "Sep", "Oct", "Nov" , "Dec"
]
]
, dataZoom [dz1,dz1,dz2,dz2]
, yAxis [ya1, ya2]
...
...
@@ -408,22 +412,22 @@ dz2 = unsafeFromPropsArray
ya1 = unsafeFromPropsArray
[ type' "value"
, name "
Publications (by year)
"
, name "
Score metric
"
, min 0
, position "
lef
t"
, position "
righ
t"
, axisLabel [formatter "{value}"]
]
ya2 = unsafeFromPropsArray
[ type' "value"
, name "
Score metric
"
, name "
Publications (by year)
"
, min 0
, position "
righ
t"
, position "
lef
t"
, axisLabel [formatter "{value}"]
]
sd1 = unsafeFromPropsArray
[ name "
Query A
"
[ name "
Map terms coverage
"
, type' "line"
, label [normal[showp true, position "top"]]
, lineStyle [ normal
...
...
@@ -432,26 +436,26 @@ sd1 = unsafeFromPropsArray
, shadowBlur 10
, shadowOffsetY 10
]]
, data' [
1, 13, 37, 35, 15, 13, 25, 21, 6, 45, 32, 2
]
, data' [
95, 80, 75, 35, 30, 50, 70, 80, 95, 95, 95, 99
]
]
sd
2
= unsafeFromPropsArray
[ name "
Query B
"
sd
3
= unsafeFromPropsArray
[ name "
All
"
, type' "bar"
, label [normal[showp true, position "top"]]
, yAxisIndex 1
, data' [2
2, 22, 23, 77, 24, 55, 55, 89, 98, 164, 106, 2
24]
, data' [2
01, 222, 223, 777, 244, 255, 555, 879, 938, 1364, 1806, 23
24]
]
sd3 = unsafeFromPropsArray
[ name "Query C"
sd2 = unsafeFromPropsArray
[ name "Favorites"
, type' "bar"
, label [normal[showp true, position "top"]]
, yAxisIndex 1
, data' [2
01, 222, 223, 777, 244, 255, 555, 879, 938, 1364, 1806, 23
24]
, data' [2
2, 22, 23, 77, 24, 55, 139, 350, 150, 164, 106, 2
24]
]
p'' :: ReactElement
p'' = p [] []
src/DocView.purs
View file @
76e18024
This diff is collapsed.
Click to expand it.
src/Landing.purs
View file @
76e18024
This diff is collapsed.
Click to expand it.
src/Login.purs
View file @
76e18024
...
...
@@ -26,6 +26,9 @@ import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import Unsafe.Coerce (unsafeCoerce)
-- TODO: ask for login (modal) or account creation after 15 mn when user is not logged and has made one search at least
newtype State = State
{ username :: String
, password :: String
...
...
@@ -49,7 +52,11 @@ data Action
| SetPassword String
performAction :: forall eff props. PerformAction (console :: CONSOLE, ajax :: AJAX,dom::DOM | eff) State props Action
performAction :: forall eff props. PerformAction ( console :: CONSOLE
, ajax :: AJAX
, dom :: DOM
| eff
) State props Action
performAction NoOp _ _ = void do
modifyState id
...
...
@@ -150,16 +157,14 @@ getDeviseID :: forall eff. Eff (dom :: DOM | eff) (Maybe String)
getDeviseID = do
w <- window
ls <- localStorage w
i <- getItem "token" ls
pure $ i
getItem "token" ls
setToken :: forall e . String -> Eff (dom :: DOM | e) Unit
setToken s = do
w <- window
ls <- localStorage w
liftEff $ setItem "token" s ls
pure unit
setItem "token" s ls
...
...
src/Navigation.purs
View file @
76e18024
This diff is collapsed.
Click to expand it.
src/PageRouter.purs
View file @
76e18024
...
...
@@ -53,7 +53,17 @@ routing =
home = Home <$ lit ""
route str = lit "" *> lit str
routeHandler :: forall e. (Maybe Routes -> Routes -> Eff ( dom :: DOM, console :: CONSOLE | e) Unit) -> Maybe Routes -> Routes -> Eff (dom :: DOM, console :: CONSOLE | e) Unit
routeHandler :: forall e. ( Maybe Routes -> Routes -> Eff
( dom :: DOM
, console :: CONSOLE
| e
) Unit
) -> Maybe Routes -> Routes -> Eff
( dom :: DOM
, console :: CONSOLE
| e
) Unit
routeHandler dispatchAction old new = do
liftEff $ log $ "change route : " <> show new
w <- window
...
...
src/SearchForm.purs
View file @
76e18024
...
...
@@ -6,11 +6,12 @@ import Control.Monad.Cont.Trans (lift)
import DOM (DOM)
import Network.HTTP.Affjax (AJAX)
import Prelude hiding (div)
import React.DOM (br', button, div, h3, input, text)
import React.DOM.Props (_id, _type, className, name, onClick, onInput, placeholder, value)
import React.DOM (br', button, div, h3, input, text
, i, span, img
)
import React.DOM.Props (_id, _type, className, name, onClick, onInput, placeholder, value
, aria, src, title
)
import Routing.Hash.Aff (setHash)
import Thermite (PerformAction, Render, Spec, modifyState, simpleSpec)
import Unsafe.Coerce (unsafeCoerce)
import Landing as L
type State =
{
...
...
@@ -47,43 +48,41 @@ performAction GO _ _ = void do
unsafeEventValue :: forall event. event -> String
unsafeEventValue e = (unsafeCoerce e).target.value
-- TODO: case loggedIn of True -> Just Tree ; False -> Nothing
-- TODO: put the search form in the center of the page
searchSpec :: forall props eff . Spec (console::CONSOLE, ajax::AJAX, dom::DOM | eff) State props Action
searchSpec :: forall props eff . Spec ( console :: CONSOLE
, ajax :: AJAX
, dom :: DOM
| eff
) State props Action
searchSpec = simpleSpec performAction render
where
render :: Render State props Action
render dispatch _ state _ =
[
div [className "container"]
[
div [className "jumbotron"]
[
div [className "row"]
[
div [className "col-md-10"]
[ div [className "container"] [L.jumboTitle false]
, div [className "container"]
[ div [className "jumbotron" ]
[ div [className "row" ]
[ div [className "col-md-10" ]
[ br' []
, br' []
, div [className "form-group"]
[
input [className "form-control",
_id "id_password",
name "query",
placeholder "Enter Query",
_type "text",
value state.query,
onInput \e -> dispatch (SetQuery (unsafeEventValue e))
, div [ className "form-group"]
[ input [ className "form-control"
, _id "id_password"
, name "query"
, placeholder "Query, URL or FILE (works best with Firefox or Chromium browsers)"
, _type "text"
, value state.query
, onInput \e -> dispatch (SetQuery (unsafeEventValue e))
] []
, br'[]
]
]
, div [
className "col-md-2"]
, div [
className "col-md-2"]
[ br' []
, br' []
-- TODO put Gargantext logo as search button
, button [onClick \_ -> dispatch GO] [text "GO"]
]
, br' []
]
]
]
...
...
src/UserPage.purs
View file @
76e18024
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment