Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
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
gargantext
gargantext-ihaskell
Commits
86f343b6
Commit
86f343b6
authored
Mar 19, 2014
by
Andrew Gibiansky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding beginnings of widget library.
parent
e193ee47
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
245 additions
and
0 deletions
+245
-0
Widgets.hs
...kell-display/ihaskell-widgets/IHaskell/Display/Widgets.hs
+55
-0
Widgets.hs
ihaskell-display/ihaskell-widgets/IHaskell/Widgets.hs
+5
-0
LICENSE
ihaskell-display/ihaskell-widgets/LICENSE
+20
-0
Setup.hs
ihaskell-display/ihaskell-widgets/Setup.hs
+2
-0
ihaskell-widgets.cabal
ihaskell-display/ihaskell-widgets/ihaskell-widgets.cabal
+71
-0
Diagrams.ipynb
notebooks/Diagrams.ipynb
+92
-0
No files found.
ihaskell-display/ihaskell-widgets/IHaskell/Display/Widgets.hs
0 → 100644
View file @
86f343b6
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-}
module
IHaskell.Display.Widgets
()
where
import
ClassyPrelude
import
Data.Aeson
import
IHaskell.Widgets
import
IHaskell.Display
data
WidgetName
=
ButtonWidget
data
WidgetMessage
=
DisplayWidget
|
InitialState
WidgetName
instance
ToJSON
WidgetName
where
toJSON
ButtonWidget
=
"ButtonView"
instance
ToJSON
WidgetMessage
where
toJSON
DisplayWidget
=
object
[
"method"
.=
str
"display"
]
toJSON
(
InitialState
name
)
=
object
[
"method"
.=
str
"update"
,
"state"
.=
object
[
"_view_name"
.=
name
,
"visible"
.=
True
,
"_css"
.=
object
[]
,
"msg_throttle"
.=
(
3
::
Int
),
"disabled"
.=
False
,
"description"
.=
str
"Button"
]
]
str
::
String
->
String
str
=
id
instance
IHaskellDisplay
Slider
where
display
_
=
return
$
Display
[]
-- | Text to parse.
data
ParseText
=
ParseText
String
instance
FromJSON
ParseText
where
parseJSON
(
Object
v
)
=
ParseText
<$>
v
.:
"text"
parseJSON
_
=
fail
"Expecting object"
instance
IHaskellWidget
Slider
where
-- Name for this widget.
targetName
_
=
"WidgetModel"
-- Start by sending messages to set up the widget.
open
widget
send
=
do
putStrLn
"Sending widgets!"
send
$
toJSON
$
InitialState
ButtonWidget
send
$
toJSON
DisplayWidget
ihaskell-display/ihaskell-widgets/IHaskell/Widgets.hs
0 → 100644
View file @
86f343b6
module
IHaskell.Widgets
(
Slider
(
..
)
)
where
data
Slider
=
Slider
ihaskell-display/ihaskell-widgets/LICENSE
0 → 100644
View file @
86f343b6
The MIT License (MIT)
Copyright (c) 2013 Andrew Gibiansky
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ihaskell-display/ihaskell-widgets/Setup.hs
0 → 100644
View file @
86f343b6
import
Distribution.Simple
main
=
defaultMain
ihaskell-display/ihaskell-widgets/ihaskell-widgets.cabal
0 → 100644
View file @
86f343b6
-- The name of the package.
name: ihaskell-widgets
-- The package version. See the Haskell package versioning policy (PVP)
-- for standards guiding when and how versions should be incremented.
-- http://www.haskell.org/haskellwiki/Package_versioning_policy
-- PVP summary: +-+------- breaking API changes
-- | | +----- non-breaking API additions
-- | | | +--- code changes with no API change
version: 0.1.0.0
-- A short (one-line) description of the package.
synopsis: IHaskell display instances for displayable widgets
-- A longer description of the package.
-- description:
-- URL for the project homepage or repository.
homepage: http://www.github.com/gibiansky/ihaskell
-- The license under which the package is released.
license: MIT
-- The file containing the license text.
license-file: LICENSE
-- The package author(s).
author: Andrew Gibiansky
-- An email address to which users can send suggestions, bug reports, and
-- patches.
maintainer: andrew.gibiansky@gmail.com
-- A copyright notice.
-- copyright:
category: Development
build-type: Simple
-- Extra files to be distributed with the package, such as examples or a
-- README.
-- extra-source-files:
-- Constraint on the version of Cabal needed to build this package.
cabal-version: >=1.16
library
-- Modules exported by the library.
exposed-modules: IHaskell.Display.Widgets,
IHaskell.Widgets
-- Modules included in this library but not exported.
-- other-modules:
-- Language extensions.
default-extensions: DoAndIfThenElse
OverloadedStrings
-- Other library packages from which modules are imported.
build-depends: base ==4.6.*,
aeson ==0.7.*,
classy-prelude,
here,
ihaskell >= 0.3
-- Directories containing source files.
-- hs-source-dirs:
-- Base language which the package is written in.
default-language: Haskell2010
notebooks/Diagrams.ipynb
0 → 100644
View file @
86f343b6
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