author | ymh <ymh.work@gmail.com> |
Fri, 08 Apr 2016 19:30:17 +0200 | |
changeset 149 | 3ace15523e6b |
parent 106 | 30de363937ce |
child 319 | 78990a8a069b |
permissions | -rw-r--r-- |
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 |
* [Git](http://git-scm.com/) |
d4b3da0dadc9
init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
11 |
* [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
|
12 |
* [Bower](http://bower.io/) |
d4b3da0dadc9
init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
13 |
* [Ember CLI](http://www.ember-cli.com/) |
d4b3da0dadc9
init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
14 |
* [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
|
15 |
|
d4b3da0dadc9
init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
16 |
## Installation |
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 |
* `git clone <repository-url>` this repository |
d4b3da0dadc9
init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
19 |
* change into the new directory |
d4b3da0dadc9
init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
20 |
* `npm install` |
d4b3da0dadc9
init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
21 |
* `bower install` |
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 |
## Running / Development |
d4b3da0dadc9
init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
24 |
|
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
|
25 |
* `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
|
26 |
* 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
|
27 |
|
d4b3da0dadc9
init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
28 |
### Code Generators |
d4b3da0dadc9
init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
29 |
|
d4b3da0dadc9
init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
30 |
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
|
31 |
|
d4b3da0dadc9
init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
32 |
### Running Tests |
d4b3da0dadc9
init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
33 |
|
d4b3da0dadc9
init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
34 |
* `ember test` |
d4b3da0dadc9
init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
35 |
* `ember test --server` |
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 |
## Build / Production |
5
d4b3da0dadc9
init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
38 |
|
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
|
39 |
* `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
|
40 |
* 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
|
41 |
|
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
|
42 |
## Api configuration |
5
d4b3da0dadc9
init ember app with 2 pages and an images
nowmad@23.1.168.192.in-addr.arpa
parents:
diff
changeset
|
43 |
|
105
63b9014bb58b
some more specification about API config in ember adapters
nowmad@23.1.168.192.in-addr.arpa
parents:
104
diff
changeset
|
44 |
* 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
|
45 |
* 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
|
46 |
* `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
|
47 |
**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
|
48 |
|
63b9014bb58b
some more specification about API config in ember adapters
nowmad@23.1.168.192.in-addr.arpa
parents:
104
diff
changeset
|
49 |
* `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
|
50 |
|
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
51 |
## visualizations |
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
52 |
|
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
53 |
### "Langues" |
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
54 |
|
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
55 |
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
|
56 |
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
|
57 |
```json |
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
58 |
{ |
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
59 |
"name": "Global", |
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
60 |
"children": [ |
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 |
"id": "id de langue (code Lexvo de la langues)", |
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
63 |
"name": "Français", |
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
64 |
"color": "lightblue", |
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
65 |
"value": 859 |
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 |
{ |
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
68 |
"name": "Wallis et Futuna", |
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
69 |
"value": 43, |
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
70 |
"children": [ |
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
71 |
{ |
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
72 |
"name": "LanEast Futuna (fud)", |
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
73 |
"value": 23 |
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 |
"name": "Wallisian (wls)", |
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
77 |
"value": 20 |
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 |
] |
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 |
] |
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 |
``` |
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
84 |
A `color` attribute can be add to each node. |
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
85 |
|
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
86 |
### "Carthographie" |
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
87 |
|
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
88 |
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
|
89 |
|
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
90 |
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
|
91 |
|
30de363937ce
add doc about visualization
nowmad@nowmads-macbook-pro.local
parents:
105
diff
changeset
|
92 |
It seems to use the `ISO 3166-1` country naming convention ("US", "FR", "BZ", etc.) |