cms/app-client/README.md
author ymh <ymh.work@gmail.com>
Tue, 08 Nov 2016 14:20:48 +0100
changeset 402 e182294ca4ae
parent 319 78990a8a069b
child 537 d2e6ee099125
permissions -rw-r--r--
set new version 0.0.8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     1
# App-client
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     2
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     3
This README outlines the details of collaborating on this Ember application.
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     4
A short introduction of this app could easily go here.
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     5
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     6
## Prerequisites
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     7
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     8
You will need the following things properly installed on your computer.
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
     9
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    10
* [Node.js](http://nodejs.org/) (with NPM)
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    11
* [PhantomJS](http://phantomjs.org/)
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    12
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    13
## Installation
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    14
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    15
* `npm install`
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    16
* `bower install`
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    17
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    18
## Running / Development
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    19
104
bd3747a1cd5f update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents: 5
diff changeset
    20
* `npm start` (shortcut for `ember serve --environment=development` which serve the application)
5
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    21
* Visit your app at [http://localhost:4200](http://localhost:4200).
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    22
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    23
### Code Generators
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    24
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    25
Make use of the many generators for code, try `ember help generate` for more details
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    26
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    27
### Running Tests
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    28
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    29
* `ember test`
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    30
* `ember test --server`
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    31
104
bd3747a1cd5f update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents: 5
diff changeset
    32
## Build / Production
5
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    33
104
bd3747a1cd5f update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents: 5
diff changeset
    34
* `npm build` (shortcut for `ember build --environment=production` which serve the application)
bd3747a1cd5f update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents: 5
diff changeset
    35
* Visit /dist to check the built files
5
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    36
104
bd3747a1cd5f update Readme and change baseStatic value with php function in corpus.module
nowmad@23.1.168.192.in-addr.arpa
parents: 5
diff changeset
    37
## Api configuration
5
d4b3da0dadc9 init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff changeset
    38
105
63b9014bb58b some more specification about API config in ember adapters
nowmad@23.1.168.192.in-addr.arpa
parents: 104
diff changeset
    39
* As Ember advices, all the logic of the api (host, namespace), is located in `adapters/application.js`.
63b9014bb58b some more specification about API config in ember adapters
nowmad@23.1.168.192.in-addr.arpa
parents: 104
diff changeset
    40
* Two ways are provided:    
63b9014bb58b some more specification about API config in ember adapters
nowmad@23.1.168.192.in-addr.arpa
parents: 104
diff changeset
    41
  * `Fixture`: deprecated in Ember and have been move out. We know use `ember-data-fixture-adapter` which provides the same behavior.
63b9014bb58b some more specification about API config in ember adapters
nowmad@23.1.168.192.in-addr.arpa
parents: 104
diff changeset
    42
**However** it doesn't allow the use of `this.store.findRecord(...)` function. In our case it won't trigger the api request for the full document information (therefore doesn't get the sound urls). --> **Only use for testing**
63b9014bb58b some more specification about API config in ember adapters
nowmad@23.1.168.192.in-addr.arpa
parents: 104
diff changeset
    43
63b9014bb58b some more specification about API config in ember adapters
nowmad@23.1.168.192.in-addr.arpa
parents: 104
diff changeset
    44
  * `RESTAdapter`: The Common way of plugging in Ember with a Rest server.
106
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    45
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    46
## visualizations
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    47
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    48
### "Langues"
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    49
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    50
It use D3js and the implementation by [Mike Bostock](http://bost.ocks.org/mike/treemap/) customized to fit our needs.
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    51
The json used to build the treemap follows this example (can be find in `public/langues.json`):
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    52
```json
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    53
{
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    54
 "name": "Global",
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    55
 "children": [
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    56
  {
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    57
    "id": "id de langue (code Lexvo de la langues)",
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    58
    "name": "Français",
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    59
    "color": "lightblue",
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    60
    "value": 859
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    61
  },
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    62
  {
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    63
    "name": "Wallis et Futuna",
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    64
    "value": 43,
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    65
    "children": [
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    66
      {
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    67
        "name": "LanEast Futuna (fud)",
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    68
        "value": 23
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    69
      },
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    70
      {
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    71
        "name": "Wallisian (wls)",
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    72
        "value": 20
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    73
      }
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    74
    ]
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    75
  }
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    76
 ]
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    77
}
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    78
```
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    79
A `color` attribute can be add to each node.
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    80
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    81
### "Carthographie"
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    82
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    83
It use the [Ammap](https://www.amcharts.com/javascript-maps/) library.
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    84
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    85
It also uses a JSON to describe the areas. It is possible to get the bounding box of the country clicked, however it is a rectangle and isn't as precise as the SVG path.
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    86
30de363937ce add doc about visualization
nowmad@nowmads-macbook-pro.local
parents: 105
diff changeset
    87
It seems to use the `ISO 3166-1` country naming convention ("US", "FR", "BZ", etc.)