diff --git a/CHANGELOG.md b/CHANGELOG.md
index ebe221311..69cbc0e95 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,8 @@
# Change log
+## [1.13.4.0]
+- Upgrade DKAN to version 1.13.2 PR#136
+
## [1.13.1.5]
- Added patch on DKAN to include modifications made on PR#1795.
diff --git a/build-dkan.make b/build-dkan.make
index 9b143c105..7dce3d116 100644
--- a/build-dkan.make
+++ b/build-dkan.make
@@ -8,12 +8,5 @@ includes[core] = dkan/drupal-org-core.make
projects[dkan][type] = profile
projects[dkan][download][type] = git
projects[dkan][download][url] = https://github.com/NuCivic/dkan.git
-projects[dkan][download][tag] = 7.x-1.13.1
-
-projects[dkan][patch][1] = https://patch-diff.githubusercontent.com/raw/NuCivic/dkan/pull/1769.diff
-projects[dkan][patch][2] = https://patch-diff.githubusercontent.com/raw/NuCivic/dkan/pull/1761.diff
-projects[dkan][patch][3] = https://patch-diff.githubusercontent.com/raw/NuCivic/dkan/pull/1763.diff
-projects[dkan][patch][4] = https://patch-diff.githubusercontent.com/raw/NuCivic/dkan/pull/1766.diff
-projects[dkan][patch][5] = https://patch-diff.githubusercontent.com/raw/NuCivic/dkan/pull/1788.diff
-projects[dkan][patch][6] = config/patches/add-customizable-tag.diff
+projects[dkan][download][tag] = 7.x-1.13.2
diff --git a/config/patches/add-customizable-tag.diff b/config/patches/add-customizable-tag.diff
deleted file mode 100644
index 80a718a64..000000000
--- a/config/patches/add-customizable-tag.diff
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/test/features/topics.feature b/test/features/topics.feature
-index 793217b..87d3669 100644
---- a/test/features/topics.feature
-+++ b/test/features/topics.feature
-@@ -13,7 +13,7 @@ Feature: Topics
- | name | url |
- | Add Topic | /admin/structure/taxonomy/dkan_topics/add |
-
-- @api @Topics @defaultHomepage
-+ @api @Topics @defaultHomepage @customizable
- Scenario: See topics on the homepage as anonymous user
- When I am on the homepage
- Then I should see "Topic1"
diff --git a/dkan/CHANGELOG.txt b/dkan/CHANGELOG.txt
index dc902bb7c..81e474ea9 100644
--- a/dkan/CHANGELOG.txt
+++ b/dkan/CHANGELOG.txt
@@ -1,27 +1,32 @@
7.x-1.13.x
---------------------------
+ - #1796 Fix Harvest support for contact name and contact email.
+ - #1795 Update front page test on topics.feature with @customizable.
+ - #1783 Update services to 3.19
+ - #1794 Update visualization_entity to 1.1
+ - #1781 Update views to 3.15 and remove patch 1388684.
+ - #1751 Add POD validation link to command center menu for site manager access.
+ - #1762 Re-number update hooks that were mixed up during release integration.
- #1709 Changed function dkan sitewide conversion homepage to fix problem with link entity attribute. This attribute need to be a boolean.
- #1742 Fix home page HTML
so that it's just the site name (not the node or panel title)
- #1747 Update DKAN API link to use the RTD documentation page.
- #1730 Fix logic error for front page in theme causing error messages on homepage
- #1728 Added a tag @defaultHomepage to a topic test which relies on homepage content.
- #5807 Fix panelizer permissions to hide 'Customize Display' button
+ - #1744 Grant Site Manager role Harvest Dashboard actions.
+ - #1776 Fix 500 errors when linking or uploading geojson files in resources.
+ - #1767 Better handling of empty values by datastore_api. Also see NuCivic/feeds_flatstore_processor#9
7.x-1.13
--------------------------
- #1719 Added site details to settings nuboot_radix to allow change site name, slogan, e-amail address for site manager.
- #1717 Upgrading Drupal to 7.54
- - #1712 Added a filter in the workflow.feature to avoid issues for the amount of already existing nodes.
- - #1707 Isolate dkan workflow tests related to emails.#1069
- #1705 Added css for chart visualizaitons, fixes issue in IE.
- #1695 Upgrade better_exposed_filters to v3.4.
- #1702 Update branding.
- #1369 Added ReadTheDocs integrations and docs folder for centralized documentation
- - #1696 Disable/uninstall dkan_dataset_api if enabled because it is deprecated in favor open_data_schema_map.
- #1701 Renamed test files.
- #1691 #1682 Update resource tests to work with client site variations.
- #1694 Moved functions from FeatureContext to DKANExtension.
- - #1690 Added patch for workbench_moderation: Invalid argument supplied for foreach() 2360973.
- #1687 Added a function in dkan_sitewide to check if a specific page is the front page.
- #1693 Improve module and user cleanup inside dkan workflow context after run tests
- #1669 Update leaflet library to v1.0.2 and leaflet markercluster to v1.0.0. Unift leaflet libraries (was using a separate version for recline module)
@@ -50,9 +55,9 @@
- #1297 Fix for relative paths to ensure links still work when a site is installed into a subdirectory.
- #1358 Removed field mapping warnings during import of default content.
- #1376 Removed conditional_fields from dkan_topics.
- - Upgrade Features to 7.x-2.9
- - Make date facet use "day" granularity.
- - Remove ARC2 library.
+ - #1387 Upgrade Features to 7.x-2.9
+ - #1387 Make date facet use "day" granularity.
+ - #1387 Remove ARC2 library.
- #1439 Disable pathauto for content created using dkan_fixtures.
- #1403 Removed warning message when try edit resource without dataset.
- #1468 Added PHP Unit tests configurations to make them run on DKAN.
@@ -67,7 +72,7 @@
- #1685 Moved front page search block from dkan_sitewide_demo_front to dkan_sitewide.
- #1562 Fixed link to group page on group node teaser when site has clean urls disabled.
- #1534 Added update hook to disable dkan_default_content on upgrades.
- - Updated visualization_entity.
+ - #1565 Updated visualization_entity.
- #1556 Added fix to display the 'Request membership' link only to users that are logged in.
- #1582 Remove content padding on data extent and social blocks.
- #1606 Added DKAN Extension.
@@ -99,7 +104,7 @@
- #1678 Add patch to fix panopoly_widgets overrides OOB.
DKAN Datastore:
- #1387 Added DKAN Datastore module into DKAN Core.
- - Greatly expand the datastore API to support aggregation functions, better joins, multiple queries. See dkan_datastore_api's README file.
+ - #1599 Greatly expand the datastore API to support aggregation functions, better joins, multiple queries. See dkan_datastore_api's README file.
- #1599 Fixed bugs when running the datastore via cron.
DKAN Harvest:
- #1676 Harvested content is published even if dkan_workflow is enabled.
@@ -121,10 +126,16 @@ DKAN Harvest:
- #1650 Removed links to Harvest Source nodes from main menu.
- #1672 Prevent harvest source machine name from containing forward slash character.
- Improved PHP Unit tests.
+ - #1468 Add support "Compound" fields on Filters/Overrides/Excludes/Default in DKAN Harvest.
+ - #1488 Replace field notes by field body in harvest source content type.
DKAN Migrate Base:
- #1387 Added DKAN Migrate Base module into DKAN Core.
- #1462 Removed row from migration map table when a dataset is deleted.
DKAN Workflow:
+ - Add patch for workbench_moderation to avoid php shutdown function errors.
+ - #1690 Added patch for workbench_moderation: Invalid argument supplied for foreach() 2360973.
+ - #1712 Added a filter in the workflow.feature to avoid issues for the amount of already existing nodes.
+ - #1707 Isolate dkan workflow tests related to emails.#1069
- #1715 Moved the update of the roleassign_roles variable from dkan_workflow_permissions to dkan_workflow.
- #1677 Fixed panels-related bug where, if a dataset had both a "published" and "draft" version, the published would show in the draft tab.
- #1438 Updated DKAN workflow vbo customizations to not affect other vbo forms.
@@ -132,8 +143,9 @@ DKAN Workflow:
- #1667 Fixed admin menu source when dkan_workflow is enabled.
- #1663 Moved workbench links from dkan_sitewide_menu to dkan_workflow.
DKAN Dataset:
+ - #1696 Disable/uninstall dkan_dataset_api if enabled because it is deprecated in favor open_data_schema_map.
- Leaflet draw widget usability improvements
- - Fix validation on resource forms when multiple resource type fields are populated
+ - #1636 Fix validation on resource forms when multiple resource type fields are populated
- #1626 Fix 508 compliance issues for leafleat draw widget
- #1387 Added DKAN Dataset module into DKAN Core.
- #1589 Fix geofield map button toggle function.
@@ -148,18 +160,15 @@ DKAN Dataset:
- #1301 Added hook update to migrate the content from field_odfe_category to field_pod_theme on Datasets.
- #1301 Added new option on DKAN Dataset Forms to enable POD based validation on Dataset form.
- #1301 Added new option on DKAN Dataset Forms to enable Groups field validation on Dataset form.
- - #1280 Fixes to groups UX: Group body field now labeled "Description," longer group descriptions do not get cut off after 200 characters on group page, and extraneous "about" tab on Group node edit form removed
+ - #1280 Fixes to groups UX: Group body field now labeled "Description," longer group descriptions do not get cut off after 200 characters on group page, and extraneous "about" tab on Group node edit form removed
- Add new "modified date" field, hidden in form, to datasets. This is for dkan_harvest compatibility; saves sources dates into a separate field so they aren't affected by node changes. ODSM mappings also updated.
- Fix keywords/tags creating broken links when containing spaces, and add missing keywords to default content.
- - #1468 Add support "Compound" fields on Filters/Overrides/Excludes/Default in DKAN Harvest.
- #1477 Fix ODSM permissions for non-admin roles.
- - #1488 Replace field notes by field body in harvest source content type.
- #1532 Fixed text on 'Download All' button to not display HTML.
- - Add patch for workbench_moderation to avoid php shutdown function errors.
- #1570 Removed 'Back to dataset' button on standalone resources.
- Better support of downloading remote files from the resource view page "Download" button.
- - Removed warning when a resource is created without title.
- - Add limit to proxy resources.
+ - #1553 Removed warning when a resource is created without title.
+ - #1591 Add limit to proxy resources.
- #1576 Improved download of remote files.
- #1670 Fix 508 compliance issues for visualization_entity_charts.
- #1669 Fix 508 compliance issues for leaflet draw widget.
@@ -169,8 +178,7 @@ DKAN Dataset:
DKAN Topics:
- #1159 Added a test for creating a topic term.
- #1486 Make the icon field required if the icon type is set to 'font'.
- - #1656 Fix topics icon selector functionality.
-
+ - #1656 Fix topics icon selector functionality.
7.x-1.12.13 2017-01-04
----------------------
diff --git a/dkan/PATCHES.txt b/dkan/PATCHES.txt
deleted file mode 100644
index 83db91f53..000000000
--- a/dkan/PATCHES.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-The following patches have been applied to this project:
-- https://patch-diff.githubusercontent.com/raw/NuCivic/dkan/pull/1769.diff
-- https://patch-diff.githubusercontent.com/raw/NuCivic/dkan/pull/1761.diff
-- https://patch-diff.githubusercontent.com/raw/NuCivic/dkan/pull/1763.diff
-- https://patch-diff.githubusercontent.com/raw/NuCivic/dkan/pull/1766.diff
-- https://patch-diff.githubusercontent.com/raw/NuCivic/dkan/pull/1788.diff
-- add-customizable-tag.diff
-
-This file was automatically generated by Drush Make (http://drupal.org/project/drush).
diff --git a/dkan/add-customizable-tag.diff b/dkan/add-customizable-tag.diff
deleted file mode 100644
index 80a718a64..000000000
--- a/dkan/add-customizable-tag.diff
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/test/features/topics.feature b/test/features/topics.feature
-index 793217b..87d3669 100644
---- a/test/features/topics.feature
-+++ b/test/features/topics.feature
-@@ -13,7 +13,7 @@ Feature: Topics
- | name | url |
- | Add Topic | /admin/structure/taxonomy/dkan_topics/add |
-
-- @api @Topics @defaultHomepage
-+ @api @Topics @defaultHomepage @customizable
- Scenario: See topics on the homepage as anonymous user
- When I am on the homepage
- Then I should see "Topic1"
diff --git a/dkan/dkan.info b/dkan/dkan.info
index 189a625b4..848d30b85 100644
--- a/dkan/dkan.info
+++ b/dkan/dkan.info
@@ -124,4 +124,4 @@ dependencies[] = dkan_datastore
dependencies[] = dkan_datastore_api
dependencies[] = open_data_schema_map_dkan
dependencies[] = visualization_entity_charts_dkan
-version = 7.x-1.13.1
+version = 7.x-1.13.2
diff --git a/dkan/dkan.install b/dkan/dkan.install
index 71efeffa3..34e2d863c 100644
--- a/dkan/dkan.install
+++ b/dkan/dkan.install
@@ -107,51 +107,6 @@ function dkan_update_7002() {
}
}
-/**
- * Remove modules on upgrade to 7.x-1.13.
- *
- * Conditional Fields, Entity RDF, RDF UI, RDF Extensions.
- */
-function dkan_update_7003() {
- $modules = array(
- 'conditional_fields',
- 'entity_rdf',
- 'rdfui',
- 'rdfx',
- );
- db_delete('system')
- ->condition('name', $modules, 'IN')
- ->condition('type', 'module')
- ->execute();
-
- db_drop_table('conditional_fields');
- db_drop_table('rdfx_namespaces');
- db_drop_table('rdfx_term_details');
- db_drop_table('rdfx_term_domains');
- db_drop_table('rdfx_term_inverses');
- db_drop_table('rdfx_term_ranges');
- db_drop_table('rdfx_term_superclasses');
- db_drop_table('rdfx_term_superproperties');
- db_drop_table('rdfx_term_types');
- db_drop_table('rdfx_terms');
- db_drop_table('rdfx_vocabulary_details');
- db_drop_table('rdfx_vocabulary_graphs');
-}
-
-/**
- * Remove deprecated test and theme directories.
- */
-function dkan_update_7004() {
- drush_delete_dir('profiles/dkan/modules/dkan/dkan_dataset/fonts');
- drush_delete_dir('profiles/dkan/modules/dkan/dkan_dataset/tests');
- drush_delete_dir('profiles/dkan/modules/dkan/dkan_datastore/tests');
- drush_delete_dir('profiles/dkan/modules/dkan/dkan_datastore/modules/dkan_datastore_api/tests');
- drush_delete_dir('profiles/dkan/modules/dkan/dkan_datastore/modules/dkan_datastore_fast_import/test');
- drush_delete_dir('profiles/dkan/modules/dkan/dkan_workflow/test');
- drush_delete_dir('profiles/dkan/themes/contrib/nuboot_radix');
- drush_delete_dir('profiles/dkan/themes/contrib/omega');
-}
-
/**
* Disable the dkan_default_content module.
*/
@@ -251,3 +206,48 @@ function dkan_update_7011() {
variable_set('theme_nuboot_radix_settings', $settings);
}
}
+
+/**
+ * Clean up db on upgrade to 7.x-1.13.
+ *
+ * Deprecated modules: Conditional Fields, Entity RDF, RDF UI, RDF Extensions.
+ */
+function dkan_update_7012() {
+ $modules = array(
+ 'conditional_fields',
+ 'entity_rdf',
+ 'rdfui',
+ 'rdfx',
+ );
+ db_delete('system')
+ ->condition('name', $modules, 'IN')
+ ->condition('type', 'module')
+ ->execute();
+
+ db_drop_table('conditional_fields');
+ db_drop_table('rdfx_namespaces');
+ db_drop_table('rdfx_term_details');
+ db_drop_table('rdfx_term_domains');
+ db_drop_table('rdfx_term_inverses');
+ db_drop_table('rdfx_term_ranges');
+ db_drop_table('rdfx_term_superclasses');
+ db_drop_table('rdfx_term_superproperties');
+ db_drop_table('rdfx_term_types');
+ db_drop_table('rdfx_terms');
+ db_drop_table('rdfx_vocabulary_details');
+ db_drop_table('rdfx_vocabulary_graphs');
+}
+
+/**
+ * Remove deprecated test and theme directories.
+ */
+function dkan_update_7013() {
+ drush_delete_dir('profiles/dkan/modules/dkan/dkan_dataset/fonts');
+ drush_delete_dir('profiles/dkan/modules/dkan/dkan_dataset/tests');
+ drush_delete_dir('profiles/dkan/modules/dkan/dkan_datastore/tests');
+ drush_delete_dir('profiles/dkan/modules/dkan/dkan_datastore/modules/dkan_datastore_api/tests');
+ drush_delete_dir('profiles/dkan/modules/dkan/dkan_datastore/modules/dkan_datastore_fast_import/test');
+ drush_delete_dir('profiles/dkan/modules/dkan/dkan_workflow/test');
+ drush_delete_dir('profiles/dkan/themes/contrib/nuboot_radix');
+ drush_delete_dir('profiles/dkan/themes/contrib/omega');
+}
diff --git a/dkan/docs/admin/addingfields.md b/dkan/docs/admin/addingfields.md
deleted file mode 100644
index 062f204c3..000000000
--- a/dkan/docs/admin/addingfields.md
+++ /dev/null
@@ -1,95 +0,0 @@
-# Adding Fields to DKAN
-
-The following will allow you to add new fields to DKAN content types like Dataset.
-
-The result will create a new field "MY NEW FIELD" as on the Dataset form:
-
-
-
-which will appear on the Dataset view when content is entered:
-
-
-
-## Adding the New Field
-
-Let's add a field to the **Dataset** content type as an example.
-
-+ Go to **/admin/structure/types/manage/dataset/fields** in your browser:
-
-
-
-+ Scroll down till you see the **Add new field** input row
-
-+ Let's add a **MY NEW FIELD** field as an example:
-
-
-
-+ Press **Save** and proceed with the field setup:
-
-
-
-
-
-## Adjust Where Field Appears on Form
-
-+ Adjust weight of field to control where it appears on the form:
-
-
-
-## Adjust Where Field Appears on Dataset Page
-
-+ Click "Manage Display" to adjust where it appears in the output
-
-+ To add to the "Dataset Info" table on the Dataset view drag to "Dataset Information" group
-+ Remember to hide the "Label" for display in the table:
-
-
-
-We provide hook implementations in order to add extra options or remove existing ones to/from the field_license options
-
-## Adding/Removing License Options to/From License Field
-
-In order to add options to the existing ones you need to implement `hook_license_subscribe` in the following fashion:
-
-```php
- // Let's asume we want to do this as part of the fictitious license_options_extra module
- function license_options_extra_subscribe() {
- return array(
- 'tcl' => array(
- 'label' => 'Talis Community License (TCL)',
- 'uri' => 'http://opendefinition.org/licenses/tcl/',
- ),
- );
- }
-```
-
-The code above add the **Talis Community License (TCL)** license referencing it to the **tcl** key. It also provides a link to the license (optional). You can provide as many options as you want through the array being returned.
-
-### Removing License Options
-
-In order to remove options from the existing ones you need to implement `hook_license_unsubscribe` in the following fashion:
-
-```php
- // Let's asume we want to do this as part of the fictitious license_options_extra module
- function license_options_extra_unsubscribe() {
- return array(
- 'notspecified',
- );
- }
-```
-
-The code above removes the **notspecified** option. You can provide as many options as you want through the array being returned.
-
-### Additional notes about the behavior of both hooks
-
-+ The options provided through the license drupal field configuration are **COMPLETELY** ignored.
-+ **hook_license_subscribe** implementations are of course called before **hook_license_unsubscribe** implementations.
-+ Options subscribed through **hook_license_subscribe** are processed as they come through the order of modules provided by the drupal registry.
-+ If multiple options are provided using the same key then it grabs the first one that comes in and ignores the rest
-+ If you want to **replace** and item that already exists, unsubscribe the existing key and provided an alternative one for your option
-
-### References to the code
-
-+ Hooks are invoked [here](https://github.com/NuCivic/dkan_dataset/blob/7.x-1.x/modules/dkan_dataset_content_types/dkan_dataset_content_types.license_field.inc#L22)
-+ Field formatter implementation for the license field is in [here](https://github.com/NuCivic/dkan_dataset/blob/7.x-1.x/modules/dkan_dataset_content_types/dkan_dataset_content_types.module#L28)
-
diff --git a/dkan/docs/admin/index.rst b/dkan/docs/admin/index.rst
deleted file mode 100644
index 6f9d65c94..000000000
--- a/dkan/docs/admin/index.rst
+++ /dev/null
@@ -1,16 +0,0 @@
-DKAN Site Administration
-----------------------
-
-.. toctree::
- :maxdepth: 1
-
- addingfields
- Appearance Options
- Content Management
- Exploring and Visualizing Your Data
- Groups
- Modifying the Front Page
- Panels and the In-Place Editor
- Roles and Permissions
- User Management
-
\ No newline at end of file
diff --git a/dkan/docs/admin/users.md b/dkan/docs/admin/users.md
deleted file mode 100644
index 00230ce92..000000000
--- a/dkan/docs/admin/users.md
+++ /dev/null
@@ -1 +0,0 @@
-../../modules/dkan/dkan_sitewide/modules/dkan_sitewide_user/README.md
\ No newline at end of file
diff --git a/dkan/docs/admin/users.rst b/dkan/docs/admin/users.rst
new file mode 100644
index 000000000..0c25fdecb
--- /dev/null
+++ b/dkan/docs/admin/users.rst
@@ -0,0 +1,27 @@
+DKAN User Management
+====================
+
+DKAN uses Drupal's build-in, powerful user account system, with some customizations captured in the DKAN Sitewide User module. Flexible combinations of permissions, restrictions, and authorization schema mean that you can design an open data system that meets the needs of all of your users -- from visitors to data publishers to developers -- securely and easily.
+
+Adding a new user
+------------------
+
+In this example we’ll add a new editor user to the site.
+
+* Login to your site as the administrative super-user. Note the thin black administration menu that appears at the top of each page once you’ve logged in. This “admin menu” contains shortcuts to all administrative tasks.
+* Visit your site’s User Management page by clicking “People” in the admin menu.
+* Select the “+ Add user” option at the top of the user management page to add a new user.
+* Complete the “add user” form as shown, adding the user to any roles such as “editor” as appropriate. Note the “notify user” option which will send an email with initial login instructions to the user’s email address.
+* Click the “Create new account” button when complete.
+
+.. figure:: ../images/new-user.png
+
+Managing, Editing, and Deleting Existing Users
+------------------------------------------------------
+
+* Visit your site’s User Management page by clicking “People” in the admin menu.
+* The displayed list of users on the User Management page can be filtered and sorted using the filters at the top of the page. Once you’ve found the user you wish to edit in the user table, click the “edit” link at the end of that user’s row.
+* On the resulting “edit user” page, you can edit the user’s username, email, or profile information. You can also set a new password for the user. Click the “Save” button at the bottom of the page to save your changes.
+* Use the “Cancel account” at the bottom of the edit user page to delete an account. You will be given the option to preserve or delete any website content added by that user before deletion.
+
+.. figure:: ../images/people.png
\ No newline at end of file
diff --git a/dkan/docs/admin/visualizations/carto.md b/dkan/docs/admin/visualizations/carto.md
deleted file mode 100644
index 848b54327..000000000
--- a/dkan/docs/admin/visualizations/carto.md
+++ /dev/null
@@ -1,51 +0,0 @@
-# Publishing maps with CartoDB and DKAN
-
-[The DKAN Datastore CartoDB module](https://github.com/NuCivic/dkan_datastore_cartodb) takes resources in [DKAN](https://github.com/NuCivic/dkan) and makes them editable in [CartoDB](http://cartodb.com/). The resulting visualizations can be displayed as previews for DKAN resources as well as to tell stories about your data elsewhere on your DKAN site.
-
-CartoDB’s visualizations are built on a powerful [SQL API](http://docs.cartodb.com/cartodb-platform/sql-api.html). Once resources are added to CartoDB, their contents can also be queried. This allows users to make applications from your data.
-
-## Install and configure DKAN Datastore CartoDB
-
-Download the DKAN Datastore CartoDB to your existing DKAN site: [https://github.com/NuCivic/dkan_datastore_cartodb](https://github.com/NuCivic/dkan_datastore_cartodb).
-
-The module requires the [CartoDB PHP Client](https://github.com/Vizzuality/cartodbclient-php). See “Installation” on the [README.md](https://github.com/NuCivic/dkan_datastore_cartodb#installation) for details.
-
-For general instructions on Drupal module installation see: [https://www.drupal.org/documentation/install/modules-themes](https://www.drupal.org/documentation/install/modules-themes)
-
-Once the module is enabled, go to /admin/dkan/cartodb. Here you will enter your CartoDB credentials:
-
-
-
-Once you’ve saved your credentials you should see “Successfully connected to CartoDB.”
-
-## Add a resource
-Next, add a resource with a file attached to it:
-
-
-
-Once the resource has been uploaded, click “Manage Datastore”:
-
-
-
-Click “Import” to start the process:
-
-
-
-When the uploading has finished, the “Data API” tab will now indicate that users can query the contents of your file:
-
-
-
-## Visualizing data from CartoDB
-Now that your resource has been added to CartoDB, it can be queried through CartoDB’s SQL API. It can also still be previewed by DKAN’s native [Recline](http://okfnlabs.org/recline/) data preview.
-
-CartoDB’s tools allow you to take your data and make rich interactive maps. To do so, go to CartoDB and create a visualization using your data. See [CartoDB’s Editor documentation](http://docs.cartodb.com/cartodb-editor.html) for details.
-
-Once a visualization has been created in CartoDB, it is available as the data preview for the resource.
-
-To access it click “Manage Datastore” once more. You should see a list of available visualizations:
-
-
-
-Once you have selected a visualization to represent a resource it will be displayed on the resource itself:
-
-
diff --git a/dkan/docs/admin/visualizations/creatingvisualizations.md b/dkan/docs/admin/visualizations/creatingvisualizations.md
deleted file mode 100644
index d27dddbff..000000000
--- a/dkan/docs/admin/visualizations/creatingvisualizations.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# Creating Internal Visualizations
-
-DKAN allows users to create stored visualizations with much more flexibility than the automatic previews that come with _resources_.
\ No newline at end of file
diff --git a/dkan/docs/admin/visualizations/datapreviews.md b/dkan/docs/admin/visualizations/datapreviews.md
deleted file mode 100644
index 3ed447cb2..000000000
--- a/dkan/docs/admin/visualizations/datapreviews.md
+++ /dev/null
@@ -1,81 +0,0 @@
-# DKAN Data Preview Features
-
-DKAN allows users to have a preview of their data uploaded to or linked to a _resource_. Which preview type is displayed for a particular _resource_ depends on the data format selected. If no data format is provided, DKAN will attempt to auto-detect the format from the file's metadata; re-editing the _resource_ and correcting the format may be necesarry if this is not successfull.
-
-## Recline.js
-DKAN, like CKAN, offers an integration with the [Recline](http://reclinejs.com) Javascript library. Recline allows site visitors to preview tabular data visually. The preview works for CSV and XLS files that are uploaded to the DKAN site or hosted remotely and linked to, as well as for data stored in DKAN's local SQL-based datastore.
-
-### Grid View
-
-All tabular data can be rendered as spreadsheet-style rows and columns:
-
-
-
-### Map View
-
-Visitors can preview data that contains either coordinates or GeoJSON on a [Leaflet.js](http://leafletjs.com/)-based map:
-
-
-
-### Graph View
-
-If enabled, visitors can chose one column of your data as an X-axis, one or more as Y-axis data, and preview your data as a bar, point or line graph.
-
-
-
-### File size limits
-
-Files can only be previewed if they are well formatted or small enough to render in the browser.
-
-If files are too large to preview within 1 second you will get the following message "File was too large or unavailable for preview."
-
-Files that are too large to preview in the browser can be previewed by adding them to the datastore. Once a file is in the datastore the preview is only asking for the first 25 rows of the data. Thus large datasets can be previewed.
-
-## Additional Preview Types
-
-Beginning with version 1.13, DKAN provides preview formats for several additional file types beyond what is supported by Recline.js. (These preview formatters are still defined in the [Recline](https://github.com/NuCivic/recline) module however.)
-
-### Zip files
-
-DKAN offers the ability to preview the files and folders locked in ZIP files. DKAN will display a list of contents for ZIP files uploaded as resources on datasets. (Unlike recline visual previews, the zip file preview does not work with remote linked files.)
-
-
-
-### Image files
-
-Image files (JPG, PNG or GIF) uploaded as resources will be displayed directly on the resource page.
-
-### Web Map Service (WMS)
-
-DKAN can use Leaflet to display a preview of a [WMS server](https://en.wikipedia.org/wiki/Web_Map_Service), provided an endpoint. The following screenshot comes from a North Dakota WMS endpoint at [http://ndgishub.nd.gov/arcgis/services/All_Communications/MapServer/WMSServer?](http://ndgishub.nd.gov/arcgis/services/All_Communications/MapServer/WMSServer?).
-
-
-
-WMS support in DKAN is still somewhat expiremental and your results may vary.
-
-### ArcGIS REST
-
-An ESRI/ArcGIS REST endpoint may also be displayed in a Leaflet preview.
-
-
-
-Make sure to select "arcgis" as the format when you create these resources.
-
-### JSON files
-
-### GeoJSON files
-
-### XML files
-
-### PDF files
-
-## External Previews
-
-Starting with version DKAN supports previewing/opening resources in external services that offer simple URL-based integrations. For instance, the CartoDB mapping service offers an [Open in CartoDB service](https://cartodb.com/open-in-cartodb). Enabling this for CSV files will result in a dataset display like this:
-
-
-
-## Configuration
-By default previews are available for resources with files below 3MB of size. However you can customize this limit in the recline configuration page (/admin/dkan/recline).
-
-
diff --git a/dkan/docs/admin/visualizations/index.rst b/dkan/docs/admin/visualizations/index.rst
deleted file mode 100644
index f1c1a98c2..000000000
--- a/dkan/docs/admin/visualizations/index.rst
+++ /dev/null
@@ -1,10 +0,0 @@
-Exploring and Visualizing Your Data
-=========================
-
-Table of Contents
-
-.. toctree::
- :maxdepth: 1
-
- datapreviews
- creatingvisualizations
diff --git a/dkan/docs/apis/open-data.rst b/dkan/docs/apis/open-data.rst
index c6c896a2b..917a9f11f 100644
--- a/dkan/docs/apis/open-data.rst
+++ b/dkan/docs/apis/open-data.rst
@@ -13,6 +13,8 @@ DCAT-AP
DKAN also provides endpoints and configurable field mappings for `DCAT-AP `_, the application profile for data portals in Europe, developed by the European Commission. DCAT-AP is of course based on the `Data Catalog Vocabulary (DCAT) `_, but provides stricter definitions of catalogs, datasets, distributions and other objects. Through `Open Data Schema Map`_, DKAN provides both a catalog endpoint (see `demo `_) and individual RDF endoints for each dataset (see by going to any dataset on ``_ and clicking the "RDF" link on the lefthand sidebar).
+.. _field_comparison:
+
Field Comparison
----------------
@@ -41,7 +43,7 @@ Dataset
"field_contact_name", "dcat:contactPoint.vcard:fn", `contactPoint `_
"field_contact_email", "dcat:contactPoint.vcard:hasEmail", `mbox `_
"field_public_access_level", `dct:accessRights `_, `accessLevel `_
- "field_additional_info", "", ""
+ "field_additional_info", "", ""
"field_resources", `dcat:distribution `_, `distribution `_
"field_related_content", "", `references `_
"uuid", `dct:identifier `_, `identifier `_
@@ -69,7 +71,7 @@ Resource / Distribution
"", "dcat:accessURL", "accessURL"
"", "dct:conformsTo", "conformsTo"
"", "", "describedBy",
- "", "", "describedByType"
+ "", "", "describedByType"
"body", "dct:description", "description"
"field_link_remote_file || field_upload", "dcat:downloadURL", "downloadURL"
"field_format", "", "format"
diff --git a/dkan/docs/components/dataset/datasetfeatures.md b/dkan/docs/components/dataset/datasetfeatures.md
deleted file mode 100644
index 4e7faed7e..000000000
--- a/dkan/docs/components/dataset/datasetfeatures.md
+++ /dev/null
@@ -1,53 +0,0 @@
-# Advanced Metadata Features
-
-A Dataset is a container for storing files, APIs, or other resources as well as the [metadata](http://en.wikipedia.org/wiki/Metadata) about those resources. The metadata in a DKAN Dataset is structured specifically for describing Open Data.
-
-The metadata in a DKAN Dataset module is culled from the DCAT standard as well as Project Open Data. The full list of default Dataset fields is [available in the developer section](/dkan-documentation/dkan-developers/dataset-technical-field-reference).
-
-The Dataset form allows users to create Datasets and add appropriate metadata:
-
-
-The DKAN Dataset API exposes Dataset metadata for individual datasets as well an entire catalog.
-
-
-## Custom metadata
-
-It is easy to add new fields to DKAN which will show up on the Dataset form, make available as search facets, and be available to output in one of the Dataset APIs.
-
-If there is information that only pertains to one or more datasets then it is possible to use the "Additional Info" field. This allows content editors to add unique field / value entries that exist only on a single dataset:
-
-
-
-Globally-available custom fields can also be added through [Drupal's Fields UI](https://www.drupal.org/documentation/modules/field-ui) and added to public APIs using the [Open Data Schema Mapper](http://docs.getdkan.com/dkan-documentation/dkan-developers/adding-or-update-fields-api-output).
-
-## Data Extent
-
-The "Data Extent" block is a visual representation of the "Spatial / Geographical Coverage Area".
-
-
-
-The "Spatial / Geographical Coverage Area" field is a geojson representation of the area a Dataset covers. This can be a point, box, or other representation.
DKAN provides a widget so that a spatial area can be drawn if desired:
-
-
-
-## Revision History
-
-DKAN Datasets and Resources track revisions in order to log and display changes, using Drupal's built-in revision system.
-
-### User Interface
-
-Revision log entries can be added through the user interface by clicking "Revision information" in the dataset or resource edit form and can be viewed by clicking "Revisions" on a Dataset or Resource page:
-
- 
-
-### Loading Revision information Programmatically
-
-Revision comments generated in code can be viewed by loading a Dataset or Resource and viewing the log: `$node = node_load('dataset node id'); echo $node->log`
-
-### Revision List API
-
-A list of recent revisions are available through the revision_list API at "/api/3/action/revision_list"
-
-### File Revisions
-
-Copies are kept of files from previous revisions that can be compared manually by a usuer. Diffs of individual files are not available by default, but could be implemented with some [custom code using Apache Solr and the Diff module](https://drupal.org/node/2101377), or a similar strategy.
\ No newline at end of file
diff --git a/dkan/docs/components/dataset/datasetfeatures.rst b/dkan/docs/components/dataset/datasetfeatures.rst
new file mode 100644
index 000000000..ad2ae2e5d
--- /dev/null
+++ b/dkan/docs/components/dataset/datasetfeatures.rst
@@ -0,0 +1,69 @@
+Advanced Metadata Features
+==========================
+
+A Dataset is a container for storing files, APIs, or other resources as well as the `metadata `_ about those resources. The metadata in a DKAN Dataset is structured specifically for describing Open Data.
+
+The metadata in a DKAN Dataset is culled from the DCAT standard as well as Project Open Data. For more information on the default Dataset fields view the :ref:`Open Data Field Comparison Tables `.
+
+The Dataset form allows users to create Datasets and add appropriate metadata:
+
+.. figure:: ../../images/add-dataset-screen-1.png
+
+The DKAN Dataset API exposes Dataset metadata for individual datasets as well an entire catalog.
+
+.. figure:: ../../images/data-json.png
+
+.. _custom_metadata:
+
+Custom metadata
+----------------
+
+It is easy to add new fields to DKAN which will show up on the Dataset form, make available as search facets, and be available to output in one of the Dataset APIs.
+
+If there is information that only pertains to one or more datasets then it is possible to use the "Additional Info" field. This allows content editors to add unique field / value entries that exist only on a single dataset:
+
+.. figure:: https://cloud.githubusercontent.com/assets/512243/4188796/57b53a52-3776-11e4-97f6-61e18e3cd90d.png
+
+Globally-available custom fields can also be added through `Drupal's Fields UI `_ and added to public APIs using the :doc:`Open Data Schema Mapper <../open-data-schema>`.
+
+.. _data_extent:
+
+Data Extent
+----------------
+
+The "Data Extent" block is a visual representation of the "Spatial / Geographical Coverage Area".
+
+.. figure:: ../../images/data-extent-block.png
+
+The "Spatial / Geographical Coverage Area" field is a geojson representation of the area a Dataset covers. This can be a point, box, or other representation.
+
+DKAN provides a widget so that a spatial area can be drawn if desired:
+
+.. figure:: ../../images/spacial-geographical.png
+
+Revision History
+----------------
+
+DKAN Datasets and Resources track revisions in order to log and display changes, using Drupal's built-in revision system.
+
+User Interface
+***************
+
+Revision log entries can be added through the user interface by clicking "Revision information" in the dataset or resource edit form and can be viewed by clicking "Revisions" on a Dataset or Resource page:
+
+.. figure:: ../../images/revision.png
+
+Loading Revision information Programmatically
+*********************************************
+
+Revision comments generated in code can be viewed by loading a Dataset or Resource and viewing the log: `$node = node_load('dataset node id'); echo $node->log`
+
+Revision List API
+*****************
+
+A list of recent revisions are available through the revision_list API at "/api/3/action/revision_list"
+
+File Revisions
+***************
+
+Copies are kept of files from previous revisions that can be compared manually by a user. Diffs of individual files are not available by default, but could be implemented with some `custom code using Apache Solr and the Diff module `_, or a similar strategy.
diff --git a/dkan/docs/components/dataset/groups.rst b/dkan/docs/components/dataset/groups.rst
index 8d746c978..5030685cd 100644
--- a/dkan/docs/components/dataset/groups.rst
+++ b/dkan/docs/components/dataset/groups.rst
@@ -1,7 +1,7 @@
Groups in DKAN
==============
-**Groups** allow you to group together datasets under a organization (i.e. Parks and Recreation Department, Department of Education) or category (e.g. Transport Data, Health Data) in order to make it easier for users to browse datasets by theme.
+**Groups** allow you to group together datasets under an organization (i.e. Parks and Recreation Department, Department of Education) or category (e.g. Transport Data, Health Data) in order to make it easier for users to browse datasets by theme.
As a best practice, datasets and resources that are added to a Group should share a common publisher.
@@ -20,14 +20,18 @@ When adding a new Group, the form has fields for basic information about the Gro
:Image: The image here acts like the logo for your Group. It appears on the overview Groups page as well as the individual page of the Group itself. It's best to choose a square image to fit the dimensions of the thumbnail. Whether you choose an image, a logo, or an icon you can use any image that meets the size and file type requirements. As a Site Manager, you may want to add generic icons to the Groups you add if a current logo is unavailable.
-:Body text: This text is the full description for your Group similar to an "About" page. The description includes details about the agency, its goals, and information about the data it publishes. While you want to include all the relevant information of the Group, the best descriptions are 1-2 paragraphs long and include a link to the agency's main web page for more details.
+:Description: This text is the full description for your Group similar to an "About" page. The description includes details about the agency, its goals, and information about the data it publishes. While you want to include all the relevant information of the Group, the best descriptions are 1-2 paragraphs long and include a link to the agency's main web page for more details.
:Summary text: You can use the Summary to create unique text for your Group. This text appears as a snippet under the Group image on the Group overview page. If left blank the first portion of the body text will be used (about 100 words). Including a summary can be useful in adding more key search terms or using a different tone to intrigue site visitors to learn more.
+.. figure:: ../../images/group.png
+
Managing Groups and Members
---------------------------
-Once you've added a new Group, you can assign Datasets (and their Resources) to that Group. You can also manage the members of a Group, adding new members and giving certain members different roles. Members of a Group are not bound by the permissions of their role and restricted to the content in their Group. As a Site Manager you have access to all Groups and are limited by the permissions of the Group.
+Once you've added a new Group, you can assign Datasets (and their Resources) to that Group. You can also manage the members of a Group, adding new members and giving certain members different roles. Members of a Group are bound by the permissions of their role and restricted to the content in their Group. As a Site Manager you have access to all Groups and are not limited by the permissions of the Group.
+
+.. _group_roles_permissions:
Roles and Permissions
`````````````````````
@@ -47,7 +51,7 @@ Within Groups there are different levels of access a user can have, which determ
Adding users
````````````
-Adding users to a Group is a straightforward process. Begin typing an existing user and select from the list of autocomplete options. A user must already have an account to be added to a Group, so if a person needs to be added you should first create an account for them with the appropriate role. By default a user will only have a Member role in the Group. To give the user an Administrator role and permissions, check the administrator member box.
+Adding users to a Group is a straightforward process. Click on the "Group" tab on the group page and click "Add people". Begin typing the username of an existing user into the "User name" field and select from the list of autocomplete options. A user must already have an account to be added to a Group, so if a person needs to be added you should first create an account for them with the appropriate role. By default a user will only have a Member role in the Group. To give the user an Administrator role and permissions, check the administrator member box.
Users may also request membership in a Group. If you or the Group Administrator directly add a user to the Group, then you don’t need to add any text in the Request message box. If the user requested membership, then their request message will appear here as part of the member profile (only visible to the Site Manager and Administrator).
@@ -65,6 +69,7 @@ Users may also request membership in a Group. If you or the Group Administrator
If you need to change a user’s role you can use the edit link in the far-right column next to the user’s profile details to access and change the details of their profile. Alternatively, you can change a Group member’s role for a group of users in the Group with a bulk action by checking off multiple users and selecting the Modify OG member roles option from the drop-down menu in the Operations box.
+.. figure:: ../../images/group-members.png
More on Group Membership
------------------------
@@ -74,7 +79,7 @@ Requesting membership and unsubscribing from a Group
In DKAN, “subscribing” to a Group is synonymous with becoming a member of the Group. Nonmembers can submit a membership request to the Group Administrator to become a Group member. Members have privileges to access and edit Datasets associated to the Group, so membership requires moderation. As a Site Manager, you can join any Group without moderation. Any other role must first submit a request to subscribe and then be approved by the Group Administrator.
-Active members, both Members and Administrators, can leave the Group by clicking the _Unsubscribe From Group_ link on the Group home page. Once members are removed or leave the Group they no longer have access to the Datasets associated with the Group.
+Active members, both Members and Administrators, can leave the Group by clicking the *Unsubscribe From Group* link on the Group home page. Once members are removed or leave the Group they no longer have access to the Datasets associated with the Group.
Associating Datasets only to your Group
***************************************
diff --git a/dkan/docs/components/dataset/previews.md b/dkan/docs/components/dataset/previews.md
deleted file mode 100644
index a257454d0..000000000
--- a/dkan/docs/components/dataset/previews.md
+++ /dev/null
@@ -1,51 +0,0 @@
-# Dataset Preview Features
-
-DKAN allows users to have a preview of their data uploaded to or linked to a Resource.
-
-## Recline.js
-DKAN, like CKAN, offers an integration with the [Recline](http://reclinejs.com) Javascript library. Recline allows site visitors to preview tabular data visually. The preview works for CSV and XLS files that are uploaded to the DKAN site or hosted remotely and linked to, as well as for data stored in DKAN's local SQL-based datastore.
-
-### Grid View
-
-All tabular data can be rendered as spreadsheet-style rows and columns:
-
-
-
-### Map View
-
-Visitors can preview data that contains either coordinates or GeoJSON on a [Leaflet.js](http://leafletjs.com/)-based map:
-
-
-
-### Graph View
-
-If enabled, visitors can chose one column of your data as an X-axis, one or more as Y-axis data, and preview your data as a bar, point or line graph.
-
-
-
-### File size limits
-
-Files can only be previewed if they are well formatted or small enough to render in the browser.
-
-If files are too large to preview within 1 second you will get the following message "File was too large or unavailable for preview."
-
-Files that are too large to preview in the browser can be previewed by adding them to the datastore. Once a file is in the datastore the preview is only asking for the first 25 rows of the data. Thus large datasets can be previewed.
-
-## Preview Zip files
-
-DKAN offers the ability to preview the files and folders locked in ZIP files. DKAN will display a list of contents for ZIP files uploaded as resources on datasets. (Unlike recline visual previews, the zip file preview does not work with remote linked files.)
-
-
-
-## Preview Configuration
-By default previews are available for resources with files below 3MB of size. However you can customize this limit in the recline configuration page (/admin/dkan/recline).
-
-
-
-## External Previews
-
-Starting with version 7.x-1.10, DKAN supports previewing/opening resources in external services that offer simple URL-based integrations. For instance, the CartoDB mapping service offers an [Open in CartoDB service](https://cartodb.com/open-in-cartodb). Enabling this for CSV files will result in a dataset display like this:
-
-
-
-External preview functionality can be enabled and configured in the "DKAN Dataset Previews" administration page (/admin/dkan/dataset_preview).
\ No newline at end of file
diff --git a/dkan/docs/components/dataset/previews.rst b/dkan/docs/components/dataset/previews.rst
new file mode 100644
index 000000000..510f2dd27
--- /dev/null
+++ b/dkan/docs/components/dataset/previews.rst
@@ -0,0 +1,4 @@
+Data Preview Features
+==========================
+
+Resources include powerful preview functionality via the `Recline `_ module. :doc:`See Visualizations/Data Previews<../visualizations/datapreviews>`
diff --git a/dkan/docs/components/dataset/usage.rst b/dkan/docs/components/dataset/usage.rst
index 771aec649..5d5f638e1 100644
--- a/dkan/docs/components/dataset/usage.rst
+++ b/dkan/docs/components/dataset/usage.rst
@@ -4,17 +4,16 @@ Usage
Creating Datasets and Resources
------------------------------------
+DKAN’s data publishing model is based on the concept of :ref:`datasets ` and :ref:`resources `. A dataset is a container for one or more resources; a resource is the actual “data” being published, such as a CSV table, a GeoJSON data file, or a TIFF aerial image.
-DKAN’s data publishing model is based on the [concept of datasets and resources](/dkan-documentation/dkan-overview/what-dataset-what-resource). A dataset is a container for one or more resources; a resource is the actual “data” being published, such as a CSV table, a GeoJSON data file, or a TIFF aerial image.
-
-The dataset and resource content types in DKAN are provided by the `DKAN Dataset module `_.
+The dataset and resource content types in DKAN are provided by the `DKAN Dataset module `_.
In our example, we’ll be adding a dataset with Wisconsin polling places to a DKAN site. The data may look familiar; it's one of the sample datasets provided with DKAN upon installation.
Step 1: Create the Dataset
**************************
-By default, only authenticated (“logged-in”) users can add new Datasets and Resources to a DKAN website. Once logged in, we can use the "Add Dataset" link in the main navigation bar. Depending on your user permissions, you may have access to the administration menu; in that case, you may also navigate to Content » Add Content » Dataset link to access the “Create Dataset” form.
+By default, only authenticated (“logged-in”) users can add new Datasets and Resources to a DKAN website.The default DKAN user permissions allows Site managers, Editors, and Content Creators access to the administration menu. From here a user may navigate to the Content » Add Content » Dataset link to access the “Create Dataset” form.
The Dataset is the container for the actual data resource files and contains basic information about the data, such as title, description, category tags, and license. Once we’ve entered information about the data, we can click the “Next: Add data” button to begin adding data.
@@ -27,19 +26,21 @@ After creating a dataset, we’re prompted to add one or more data resources to
:Link to an API: some data resources aren’t standalone files but queryable online databases; the interface to these databases is known as an API. Adding links to these types of online database interfaces to your DKAN data catalog can be very useful for developers interested in working with your data.
:Upload a file: this option allows publishers to upload data files to the DKAN site. As in the “link to a file” option, the data within the file will be imported into your DKAN site’s Datastore for preview and analysis by your users. See The DKAN Datastore for more information.
-To continue with our Wisconsin Polling Places example, we’ll add one resource file to the Dataset we created in Step 1. Our resource file is a CSVs that is, comma-separated values format; this is a popular file format for exchanging tabular data. Let’s explore the example resource shown here and the various fields within:
+To continue with our Wisconsin Polling Places example, we’ll add one resource file to the Dataset we created in Step 1. Our resource file is a CSV, that is, comma-separated values format; this is a popular file format for exchanging tabular data. Let’s explore the example resource shown here and the various fields within:
:Resource / Choose File: upload a file from your local hard drive.
:Resource / Recline Views: DKAN’s “Data Preview” feature allows visitors to preview published data in three views:
- * Map - data with latitude and longitude columns or GeoJSON files can be previewed in a map interface
- * Graph - tabular (spreadsheet) data can be graphed by users, letting them create their own meaningful visualizations
- * Grid - by default, tabular data is presented in a spreadsheet view, with filter, sort, and search capabilities
-:Title: this is the title of the individual data file, not the parent dataset container.
+
+ * **Map** - data with latitude and longitude columns or GeoJSON files can be previewed in a map interface
+ * **Graph** - tabular (spreadsheet) data can be graphed by users, letting them create their own meaningful visualizations
+ * **Grid** - by default, tabular data is presented in a spreadsheet view, with filter, sort, and search capabilities
+
+:Title: this is the title of the individual data file, not the parent dataset container.
:Description: a rich-text editor field is provided so publishers can offer detailed and useful descriptions
:Format: entering the file format here will allow users the ability to search for data by specific format
:Dataset: this is the parent dataset container; this field should already be populated if you’re adding a Resource subsequent to adding a Dataset
-At the bottom of the Add Resource page, we can choose:
+At the bottom of the *Add Resource* page, we can choose:
:Save: Save progress on this resource and immediately return to it for further editing
:Save and add another: Save this resource and add another resource to the same dataset
@@ -50,19 +51,19 @@ In our example, we’re only adding a single resource, so we’ll click “Next:
Step 3: Adding Metadata to a Dataset
**************************
-We now come to a third form which allows us to add additional metadata to the dataset. All these fields are optional, but provide valuable information about your dataset to both human visitors to the website and machines discovering your dataset through one of [DKAN's public APIs].
+We now come to a third form which allows us to add additional metadata to the dataset. All these fields are optional, but provide valuable information about your dataset to both human visitors to the website and machines discovering your dataset through one of :doc:`DKAN's public APIs <../../apis/index>`.
Let's take a closer look at some of the metadata fields available on this form:
:Author: The Dataset's author, in plain text.
-:Spatial / Geographical Coverage Area: Lets us define what region the data applies to. In this case, the US State of Wisconsin. You can use the map widget to draw an outline around the state borders, or, click the "Add data manually" button if you already have a [GeoJSON](http://geojson.org/) string you can paste in.
+:Spatial / Geographical Coverage Area: Lets us define what region the data applies to. In this case, the US State of Wisconsin. You can use the map widget to draw an outline around the state borders, or, click the "Add data manually" button if you already have a `GeoJSON `_ string you can paste in.
:Spatial / Geographical Coverage Location: The region the data applies to, written in plain text. This can be used instead of or in addition to the **Coverage Area** field.
:Frequency: How often is this dataset updated? We might expect our list of polling places to be updated every year, so we could select "annually." However, often we don't expect the data to be updated (even in this case, perhaps we plan to post the next version of the data as a _separate_ dataset), in which case we can leave this blank.
:Temporal Coverage: Like Geographic Coverage, this field lets us give some context to the data, but now for the relevant time period. Here we could enter the year or years for which our polling places data is accurate.
:Granularity: This is a somewhat open-ended metadata field that lets you describe the granularity or accuracy of your data. For instance: "Year". Note, this field is depreciated in DCAT and Project Open Data, and may be removed from DKAN.
-:Data Dictionary: Another open-ended field, this is a space for almost any kind of explanation for understanding the terminology/units/column names/etc. in our dataset. In most cases, this will be a simple URL to a Data Dictionary resource elsewhere on the web.
-:Additional Info: Lets us arbitrarily define other metadata fields. See [Additional Info field](dkan-documentation/dkan-features/additional-info-field) for more information.
-:Resources: This field is a reference to the resources you have already added. You should generally leave this field alone and use the workflows outlined here and in [Updating Datasets in DKAN](dkan-documentation/dkan-users/updating-datasets-dkan) to add, edit and remove resources from your Dataset.
+:Data Dictionary: This should be a URL to a resource that provides some sort of description that helps understanding the data. See `Project Open Data data dictionary `_ for more info.
+:Additional Info: Lets us arbitrarily define other metadata fields. See :ref:`Additional Info field ` for more information.
+:Resources: This field is a reference to the resources you have already added.
After you click "Save", the metadata we enter will appear on the page for this Dataset:
@@ -72,8 +73,8 @@ Configuration
Adding or Removing Allowed Resource File Types
**********************************************
-Any type of file can be uploaded to Resources (though only CSV files can be imported to the `Datastore <../datastore/index>`_.
+Any type of file can be uploaded to Resources (though only CSV files can be imported to the :doc:`Datastore <../datastore/index>`.
File types are controlled at "/admin/structure/types/manage/resource/fields/field_upload"
-To add or remove file types navigate as an 'administrator' and enter extensions into the "Allowed file extensions" field.
\ No newline at end of file
+To add or remove file types navigate as an 'administrator' and enter extensions into the "Allowed file extensions" field.
diff --git a/dkan/docs/components/index.rst b/dkan/docs/components/index.rst
index 888f6d2e6..b857b988f 100644
--- a/dkan/docs/components/index.rst
+++ b/dkan/docs/components/index.rst
@@ -2,15 +2,15 @@ Major Components
----------------------
This section contains the documentation for each of the major modules and other
-components that make up DKAN.
+components that make up DKAN.
With the exception of the modules described in the
-last two items in this table of contents
-(`Open Data Schema Map `_ and
-`Visualization Entity `_),
-and of the `Recline `_ module which is
-described inside the Datasets section, all this functionality is provided by the
-`modules that ship with the DKAN profile `_.
+last two items in this table of contents
+(`Open Data Schema Map `_ and
+`Visualization Entity `_),
+and of the `Recline `_ module which is
+described inside the Datasets section, all this functionality is provided by the
+`modules that ship with the DKAN profile `_.
.. toctree::
:maxdepth: 1
@@ -27,8 +27,8 @@ described inside the Datasets section, all this functionality is provided by the
Roles and Permissions
Storytelling
Open Data Schema Map
- Visualizations
+ Visualizations
.. note:: The three modules mentioned above that are not distributed with DKAN
- continue to be maintained in separate repositories because they work
- independently of DKAN and could be installed in non-DKAN Drupal sites.
\ No newline at end of file
+ continue to be maintained in separate repositories because they work
+ independently of DKAN and could be installed in non-DKAN Drupal sites.
diff --git a/dkan/docs/components/open-data-schema.md b/dkan/docs/components/open-data-schema.md
index c4c6aadad..1283ca1cc 100644
--- a/dkan/docs/components/open-data-schema.md
+++ b/dkan/docs/components/open-data-schema.md
@@ -1,48 +1,155 @@
# Open Data Schema Map
-DKAN includes the Open Data Schema Map module, which is distributed in its own github repo and can be used in non-DKAN Drupal projects. [Visit its homepage for full documentation](https://github.com/NuCivic/open_data_schema_map).
+This module provides a flexible way to expose your Drupal content via APIs following specific Open Data schemas. Currently, the [CKAN](http://docs.ckan.org/en/ckan-1.8/domain-model-dataset.html), [Project Open Data](http://project-open-data.github.io/schema/) and [DCAT-AP](https://joinup.ec.europa.eu/asset/dcat_application_profile/description) schemas are provided, but new schemas can be easily added through your own modules. A user interface is in place to create endpoints and map fields from the chosen schema to Drupal content using tokens.
-## Adding or Updating Fields to API Output
+This module was developed as part of the DKAN project, but will work on an Drupal 7 site. A [separate module exists for DKAN-specific implementation](https://github.com/NuCivic/open_data_schema_map_dkan).
-With DKAN it is easy to [add new fields](../admin/addingfields.md) which become part of the form and page view. To add the output from a field we'll call "MY NEW FIELD" to the package_show endpoint
+Note that serious performance issues can result if you do not follow recommendations in the [ODSM File Cache section](#the-odsm-file-cache).
-+ Go to ```/admin/config/services/odsm/edit/ckan_resource_show```
-+ Choose a field to add the output to:
+## Basic concepts
-
+### Schema
+A schema is a list of field definitions, usually representing a community specification for presenting machine-readable data. The core Open Data Schema Map module does not include any schemas; they are provided by additional modules. A schema module includes:
-+ Click or select the token for "MY NEW FIELD" under "Replacement Patterns"
+* a standard Drupal .module file -- with an implementation of ```hook_open_data_schema()``` to expose the schema to the core Open Data Schema Map module, plus _alter functions for any needed modifications of the UI form or the data output itself.
+* the schema itself, expressed as a .json file. For instance, see the [Project Open Data schema file](https://github.com/NuCivic/open_data_schema_map/blob/master/modules/open_data_schema_pod/data/single_entry.json) to see how these schema are defined in JSON
-
-+ Make sure token is placed in desired field:
+### API
+An API in this module is a configuration set that exposes a specific set of machine-readable data at a specific URL (known as the API's endpoint). This module allows you to create multiple APIs that you save as database records and/or export using [Features](http://drupal.org/project/features). An API record will contain:
-
+* an endpoint URL
+* a schema (chosen from the available schemas provided by the additional modules as described above)
+* a mapping of fields defined in that schema to Drupal tokens (usually referencing fields from a node)
+* optionally, one or more arguments passed through the URL to filter the result set
-+ Click **Save**
-+ Output from "MY NEW FIELD" should be visible in package_show endpoint:
+## Usage
-
+### Installation
-Note that the "position" field now has the value from a node we created with "MY NEW FIELD" in the Add New Fields example.
+Enable the main _Open Data Schema Map_ module as usual, and additionally enable any schema modules you will need to create your API.
-## File Cache Endpoints
+### Creating APIs
-The Open Data Schema Map module now defines a drush command called `odsm-filecache`. This command takes as its argument the machine name for an ODSM endpoint. For example:
+Navigate to admin/config/services/odsm and click "Add API."
+
+
+
+Give the API a title, machine name, choose which entity type (usually _node_) and bundle (in [DKAN](https://github.com/NuCivic/dkan), this is usually _Dataset_).
+
+
+
+You will need to create the API record before adding arguments and mappings.
+
+### Arguments
+
+The results of the API call can be filtered by a particular field via arguments in the URL. To add an argument, first choose the schema field then, if you are filtering by a custom field API field (ie, a field whose machine name begins with "field\_"), identify the database column that would contain the actual argument value. Leave off the field name prefix; for instance, if filtering by a DKAN tag (a term reference field), the correct column is field_tags_tid, so you would enter "tid". Which Drupal field to use will be extrapolated from the token you map to that schema field.
+
+
+
+### Field Mapping
+
+The API form presents you with a field for each field in your schema. Map the fields using Drupal's token system. Note: using more than one token in a single field may produce unexpected results and is not recommended.
+
+#### Multi-value fields
+
+For Drupal multi-value entity reference fields, the schema can use an array to instruct the API to iterate over each value and map the referenced data to multiple schema fields. For instance, in the CKAN schema, tags are described like this in schema_ckan.json:
```
-drush odsm-filecache data_json_1_1;
+ "tags": {
+ "title":"Tags",
+ "description":"",
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "title": "UUID",
+ "type": "string"
+ },
+ "vocabulary_id": {
+ "title": "Vocaulary ID",
+ "type": "string"
+ },
+ "name": {
+ "title": "Name",
+ "type": "string"
+ },
+ "revision_timestamp": {
+ "title": "Revision Timestamp",
+ "type": "string"
+ },
+ "state": {
+ "title": "state",
+ "description": "",
+ "type": "string",
+ "enum": ["uncomplete", "complete", "active"]
+ }
+ }
+ }
+ }
+ ]
+ },
```
-The above command triggers the processing for the endpoint defined for the data_json_1_1 ODSM API and results in the following cached file being generated on completion:
+You can choose which of the available multivalue fields on your selected bundle to map to the "tags" array, exposing all of the referenced "tag" entities (taxonomy terms in this example) to use as the context for your token mappings on the schema fields within that array. First, simply choose the multivalue field, leaving the individual field mappings blank, and save the form.
+
+
+
+When you return to the tags section of the form after saving, you will now see a special token navigator you can use to find tokens that will work with this iterative approach (using "Nth" in place of the standard delta value in the token):
+
+
+
+## Customizing
+
+### Adding new schemas
+
+You are not limited by the schemas included with this module; any Open Data schema may be defined in a custom module. Use the open_data_schema_ckan module as a model to get started.
+
+### Date format
+Date formats can be chanaged manually by changing the "Medium" date time format in "admin/config/regional/date-time" or in code by using one of the alter hooks:
+
+
+## A Note on XML Output
+
+Open Data Schema Map provides an XML output format. This is provided via a separate submodule in the `modules/` folder for historical reasons, but should be refactored into the main ODSM module in a future release.
+
+XML endpoints still require a _schema_ defined in JSON. Defining your own XML endpoint may be less than intuitive for the time beind, but take a look at the [DCAT schema module](https://github.com/NuCivic/open_data_schema_map/tree/master/modules/open_data_schema_dcat) for a model.
+
+## The ODSM File Cache
+
+Open Data Schema Map endpoints that list a large number of entities -- Project Open Data (`data.json`), the CKAN Package List (`/api/3/action/package_list`) and DCAT-AP Catalog (`catalog.xml`) -- perform a full entity load for each record listed in order to perform the token replacements. This can cause a major performance hit each time any of these URLs is hit on a site with more than a few dozen datasets, and on a site with thousands the response time can be two minutes or more.
+
+Open Data Schema Map includes a file caching function to save a snapshot of any endpoint as a static file to be served up quickly, with very few hits to the database.
+
+File caches at present can only be generated by a Drush command. The recommended usage on a production website is to set up a cron job or use a task runner like [Jenkins](https://jenkins.io/) to regenerate the file caches for your performance-intensive endpoints daily, at whatever time your site experiences the least amount of traffic. The trade-off of course is that any additions or changes to your site will not be reflected on these endpoints until they are regenerated.
+
+An administrative UI to regenerate a file cache manually may be included in a future release.
+
+### Use
+
+The Drush command supplied by Open Data Schema Map is `odsm-filecache` (also available simply as the alias `odsmfc`). This command takes as its argument the machine name for an ODSM endpoint. For example:
+
+```
+drush odsm-filecache data_json_1_1
+```
+
+This will render the full `data_json_1_1` endpoint (which is the `data.json` implementation that ships with DKAN) to the filesystem, saving it to:
```
public://odsm_cache_data_json_1_1
```
-In order to enable the cached version of an API endpoint you need to run the command above replacing `data_json_1_1` with
-the machine name of the ODSM endpoint to be cached.
+Now a hit to `/data.json` will be routed to this file, which in most cases will actually live at `/sites/default/files/odsm_cache_data_json_1_1`.
+
+## Schema Validation
+
+Both the Project Open Data and DCAT-AP schemas ship with validation tools you can access from the Drupal admin menu. More documentation on this feature coming soon...
+
+## Community
-In order to update this cache you need to re-run the command that generated it.
+We are accepting issues for Open Data Schema Map in the [DKAN issue queue](https://github.com/NuCivic/dkan/issues) only. Please label your issue as **"Component: ODSM"** after submitting so we can identify problems and feature requests faster.
-We recommend you set up a cron job to run the command on a regular schedule, perhaps in sync with your data harvesting schedule.
\ No newline at end of file
+If submitting a pull request to this project, please try to link your PR to the corresponding issue in the DKAN issue thread.
diff --git a/dkan/docs/components/permissions.md b/dkan/docs/components/permissions.md
deleted file mode 100644
index 66d24a523..000000000
--- a/dkan/docs/components/permissions.md
+++ /dev/null
@@ -1,87 +0,0 @@
-# DKAN Roles and Permissions
-
-## The DKAN Permissions module
-
-The DKAN Permissions module provides default roles and permissions for the DKAN distribution. It uses the alternative [Features](https://www.drupal.org/project/features) export method provided by the [Features Roles Permissions](https://www.drupal.org/project/features_roles_permissions) module, rather than Features' standard permissions and roles exports. Among other advantages, this produces very human-readable code; you can examine the specific roles and permissions provided by reviewing [`dkan_permissions.features.roles_permissions.inc`](https://github.com/NuCivic/dkan/blob/7.x-1.x/modules/dkan/dkan_permissions/dkan_permissions.features.roles_permissions.inc).
-
-## DKAN Core Roles
-
-Your website is a great resource for your stakeholders to see the hard work of your organization as well as access important, relevant information. Site visitors should be able to easily navigate the site to find what they are looking for as well as learn about your efforts. The balance between providing thorough information while promoting the most timely and pertinent is an ongoing consideration in managing web content. It takes a team of people working together by playing individual roles that contribute to a larger effort to have a successful site.
-
-On a website, roles categorize types of users and the associated permissions determine what that user type is allowed to do and see behind the scenes. It’s the site administrator who sets up a site initially. This role generally falls to a highly technical user, and site administrators have every permission possible. But this person won’t necessarily be involved in the daily management of a website. Another person will handle that management piece including adding new users as there are additions and subtractions from the team.
-
-Core roles are associated with permissions and those permissions represent functions the users can perform across the site. These permissions are user-level, meaning the role is set in the user’s specific record.
-
-Below is a detailed description of roles and the permissions included in the DKAN Permissions module to help show what different user types are able to do on the site and help site managers decide who should have what role. A few of these roles won’t affect the day-to-day of managing the website or the content. Larger text is used to emphasize the more relevant roles.
-
-Naturally users will need more than one role to fulfill the full scope of their job. There will also be cases where you need users to have different permissions in the context of a particular group (for instance, to be able to modify content belonging to their agency but not other agencies on the same website). Keep reading after the table to find out more about group permissions.
-
-A note about the new roles: If you are already operating on an older version of DKAN, updating won’t automatically enable this module or migrate your users over to these new roles. We recommend disabling the old “DKAN Sitewide Roles and Permissions” module and enabling the new “DKAN Permissions” module, but be aware that you will probably need to review all of your site’s users to make sure they have the appropriate role going forward.
-
-
-### Core Roles
-
-#### Anonymous User
-
-* General site visitors that are **not** logged in.
-* This user type has no profile information, hence it’s anonymous.
-* Can view and search content on public website.
-
-#### Authenticated User
-
-These users are logged on and have profile information that can be verified (and authenticated). This type has the **lowest** level of permissions; all users with login credentials have this role. This user type is a general site visitor but he or she has created an account.
-
-Permissions:
-
-* Have a profile and add/edit that profile.
-* Can leave comments on the data catalog, if comments are enabled.
-* DKAN can verify account information with a created profile so that the user is able to take limited actions and manage profile details.
-
-#### Content Creator
-
-Content Creators are focused simply on adding resources to the data catalogue under direction of a supervisor. At this level, the role **must** be assigned by a higher role; this role has access to the production side of the site. This will be someone working in your organization who helps by adding to the data catalogue but doesn’t need to worry about the whole site. This level of access takes users into the production side of the site, but gives little freedom to move outside of creating and adding certain content types. Limiting this role is critical for avoiding inadvertent damage to site content.
-
-Permissions:
-
-* Create most content types and edit **own** content.
-* View **own** unpublished content and revision history of all published content.
-* Add and view files to site library.
-
-#### Editor
-
-This will typically be a person handling the content on a frequent basis. Someone in your organization with expertise on the subject-matter that is expansive as well as in-depth. | An editor role is similar to a content creator role because the focus is content, however an editor will deal with multiple content authors and have the ability to manage and edit. An editor is responsible for managing content from a strategic perspective. The editor largely handles the quality and timeliness of the content that appears on the site. This role is able to make changes to content and where it appears, but it doesn’t go further into admin functions.
-
-Permissions:
-
-* Assign roles to lower-level users.
-* View, edit, delete most content types and manage versions of content.
-* Access and manage DKAN datastore
-
-#### Site Manager
-
-The highest level for *non-technical* users. A site manager is mostly concerned with admin functions of the site. Typically this will fall to someone in a supervisory role. The site manager takes a high-level view of the site, its content, and the users on the site. This person maintains the site and assigns roles and permissions to new users but doesn’t deal with the technical backend.
-
-Permissions:
-
-* Create, edit, delete **all** content types created by **any** user.
-* Change the types of content that lower-access roles can create.
-* Assigns roles to all user levels, but cannot create new roles/perms.
-* Create and manage groups.
-
-#### Administrator
-
-The administrator role holds every permission, and it requires high technical competency. This role has the ability to cause serious damage, so it’s generally reserved for a single web professional. The administrator handles the overall structure of the website for lower-access roles to plug content into and make changes as needed. Admins hold the **highest level** of all roles and permissions.
-
-Permissions:
-
-* Enable/disable DKAN modules and features.
-* Change the appearance of the site with views and themes.
-* Create and edit user roles and permissions.
-
-## Installation/upgrade notes
-
-On new DKAN installs, the DKAN Permissions module is enabled by default. The older ("sidewide"-namespaced) permissions module will still be included in the codebase to support existing sites, but will be disabled by default on new installs. For _existing_ sites, the opposite is true - updating your code will _not_ cause the newer module to be enabled automatically or disable the older permissions module.
-
-If you have been using the older DKAN Sitewide Roles and Permissions module on an existing site and do upgrade, we do recommend you disable it and enable the new DKAN Permissions module. The newer module has a better-thought-out set of roles and permissions designed around what we consider the most general use-cases. However, this will likely mean reviewing all of the user accounts on your site and ensuring that they have the roles that they should.
-
-You also of course have the option of disabling both modules, setting your own prefered roles and permissions and exporting those to a custom feature.
diff --git a/dkan/docs/components/permissions.rst b/dkan/docs/components/permissions.rst
new file mode 100644
index 000000000..548534f1f
--- /dev/null
+++ b/dkan/docs/components/permissions.rst
@@ -0,0 +1,91 @@
+DKAN Roles and Permissions
+===========================
+Roles categorize types of users. Permissions are assigned to these roles and represent functions the user can perform across the site.
+
+Below is a list of the roles and general permissions included in the **DKAN Permissions** module. The descriptions should help show what different user types are able to do on the site. Whan adding new users, site managers will assign the appropriate role(s) to match the tasks the user is expected to perform.
+
+There will also be cases where you need users to have different permissions in the context of a particular **group** (for instance, to be able to modify content belonging to their agency but not other agencies on the same website). Read more about :ref:`group permissions here `.
+
+The DKAN Permissions module
+---------------------------
+The DKAN Permissions module provides default roles and permissions for the DKAN distribution. It uses the export method provided by the `Features Roles Permissions `_ module so you can examine the specific roles and permissions provided by reviewing `dkan_permissions.features.roles_permissions.inc `_.
+
+Drupal Core Roles
+---------------------------
+
+Anonymous User
+^^^^^^^^^^^^^^
+* General site visitors that are **not** logged in.
+* Can view and search published content.
+
+Authenticated User
+^^^^^^^^^^^^^^^^^^^
+These users have an account on the site, can log in, and have profile information that can be verified (and authenticated). This type has the **lowest** level of permissions.
+
+**Permissions:**
+
+* Can log in.
+* Can edit their user profile.
+* Can view and search published content.
+
+Administrator
+^^^^^^^^^^^^^^^
+The administrator role holds **every** permission and requires high technical competency. This role has the ability to cause serious damage, so it’s generally reserved for a single web professional. Administrators hold the **highest level** of all roles and permissions.
+
+**Permissions:**
+
+* Enable/disable modules and features.
+* Change the appearance of the site with alternate themes.
+* Create and edit user roles and permissions.
+* Create views, blocks, features, content types.
+* Access any UI configuration.
+
+DKAN Core Roles
+---------------------------
+
+Content Creator
+^^^^^^^^^^^^^^^
+Content Creators can add content to the site. This will be someone working in your organization who helps by adding to the data catalogue but is not responsible for anything more. This level of access takes users into the production side of the site, but gives little freedom to move outside of creating and adding certain content types. Limiting this role is critical for avoiding inadvertent damage to site content.
+
+**Permissions:**
+
+* Create dataset, resource, data story, and data dashboard content.
+* Create chart visualizations.
+* Edit **own** content (can not edit content added by another user).
+* View **own** unpublished content and revision history of all published content.
+* Add and view files to site library.
+
+Editor
+^^^^^^^^^^^^^^^
+This will typically be a person handling the content on a frequent basis. Someone in your organization with expertise on the subject-matter that is expansive as well as in-depth. An editor role is similar to a content creator role because the focus is on content, however, an editor will have the ability to manage and edit content added by others. The editor role does not go further into administrative functions.
+
+**Permissions:**
+
+* Create page, dataset, resource, data story, and data dashboard content.
+* Create chart visualizations.
+* Edit, delete, and manage versions of content added by other users.
+* Add and view files to site library.
+
+Site Manager
+^^^^^^^^^^^^^^^
+The highest level for *non-technical* users. A site manager is mostly concerned with the admin functions of the site. Typically this will fall to someone in a supervisory role. The site manager takes a high-level view of the site, its content, and the users on the site. This person is able to make general configurations to the site and assigns roles to new users but does not deal with the technical configuration of the backend.
+
+**Permissions:**
+
+* Create, edit, delete **all** content types created by **any** user.
+* Create, edit and manage **Harvest Source** content.
+* Assigns roles to all user levels, but cannot create new roles/perms.
+* Create and manage groups.
+* Manage site logo, name, slogan, copyright, colors, fonts, main menu, recline config, open data schema mapper, dataset forms and previews.
+
+DKAN Workflow Roles
+--------------------
+If your organizaton needs an editorial workflow for managing content creation and editing, DKAN also includes a feature called DKAN Workflow that adds three more roles to establish a content approval process. :ref:`Read more about that here `.
+
+Installation/upgrade notes
+--------------------------
+On new DKAN installs, the DKAN Permissions module is enabled by default. The older ("sidewide"-namespaced) permissions module will still be included in the codebase to support existing sites, but will be disabled by default on new installs. For _existing_ sites, the opposite is true - updating your code will _not_ cause the newer module to be enabled automatically or disable the older permissions module.
+
+If you have been using the older DKAN Sitewide Roles and Permissions module on an existing site and do upgrade, we do recommend you disable it and enable the new DKAN Permissions module. The newer module has an improved set of roles and permissions designed around what we consider the most general use-cases. However, this will likely mean reviewing all of the user accounts on your site and ensuring that they have the roles that they should.
+
+You also of course have the option of disabling both modules, setting your own prefered roles and permissions and exporting those to a custom feature.
diff --git a/dkan/docs/components/theme.md b/dkan/docs/components/theme.rst
similarity index 57%
rename from dkan/docs/components/theme.md
rename to dkan/docs/components/theme.rst
index 86668e1fc..c1befb8fc 100644
--- a/dkan/docs/components/theme.md
+++ b/dkan/docs/components/theme.rst
@@ -1,4 +1,5 @@
-# Theme
+Theme
+==========
DKAN takes advantage of Drupal’s well-developed and flexible theming system,
allowing administrators complete graphical control over the entire DKAN site.
@@ -6,9 +7,11 @@ Features such as responsive page templates, accessible design elements, and
built-in media management provide the latest in design and presentation
technologies.
-## Default DKAN Theme
+Default DKAN Theme
+-------------------
-NuBoot Radix is the default theme for DKAN and is a subtheme of [Radix](https://www.drupal.org/project/radix) which uses [bootstrap](https://github.com/twbs/bootstrap) styles and is compatible with panelized sites. This theme has some basic customization features built in, for many client sites, these configurations will be all that is necessary to meet the client expectations. The configurable items are:
+In Drupal and DKAN, the collection of page templates, fonts, colors, images,
+and other “look and feel” elements are known as a “theme.” NuBoot Radix is the default theme for DKAN and is a subtheme of `Radix `_ which uses `bootstrap `_ styles and is compatible with panelized sites. This theme has some basic customization features built in, for many client sites, these configurations will be all that is necessary to meet the client expectations. The configurable items are:
* Logo (svg logos will display better on retina displays)
* Front page Hero image OR you can set a solid color background for the hero region.
@@ -17,104 +20,136 @@ NuBoot Radix is the default theme for DKAN and is a subtheme of [Radix](https://
* Color options via the Colorizer screen
* Fonts: use font-your-face to use alternate fonts
-In Drupal and DKAN, the collection of page templates, fonts, colors, images,
-and other “look and feel” elements are known as a “theme.” The DKAN
-distribution of Drupal includes a default “DKAN Theme” called NuBoot Radix, that visually
-highlights all of the DKAN-specific data elements in the software.
-DKAN administrators have the choice of customizing the existing DKAN Theme through theme settings, implementing an entirely new theme, or creating a [subtheme of nuboot_radix](dkan-documentation/dkan-developers-guide/creating-sub-theme-dkan).
+DKAN administrators have the choice of customizing the existing DKAN Theme through theme settings, implementing an entirely new theme, or creating a :ref:`subtheme of nuboot_radix `.
By default, the DKAN Theme is located in: `[SITEROOT]/themes/nuboot_radix`
-## Theme and Appearance Settings
+Theme and Appearance Settings
+-----------------------------
The DKAN Theme does provide a few simple customizations that administrators can use to change the default appearance of the site from the theme settings screen. If logged in as an administrative user, navigate to Appearance >> Settings
-### Site name and slogan
+Site name and slogan
+*********************
+
From the settings screen, you can toggle on/off the **site name** and **slogan**, simply check the box next to the elements you want to use.
-
-### Logo
+.. image:: ../images/Appearance_DKAN.png
+
+Logo
+*********************
+
Uncheck the 'Use the default' checkbox, and upload a new logo file in the logo image settings section.
-![Logo settings][(../images/Appearance_DKAN_2.png)
-### Shortcut icon
+.. image:: ../images/Appearance_DKAN_2.png
+
+Shortcut icon
+*********************
+
If you would like to use a different favicon image, uncheck the 'Use the default' checkbox, and upload your own.
-### Copyright info
+Copyright info
+*********************
+
To change the **copyright** information that displays at the bottom of every page, edit the text in the copyright field and save.
-### Hero background image/color
+Hero background image/color
+****************************
+
The **Hero Unit** is the background image that displays on the front page. To use a different photo than the one supplied, click the 'Choose file' button to upload a new image. This image will expand to cover the full width of the browser so be sure to upload a horizontal/landscape image and not a vertical/portrait image.
-
-### Color scheme
+.. image:: ../images/Appearance_DKAN_3.png
+
+Color scheme
+****************************
+
To use the **colorizer** option, you must use the default theme as the admin theme. Navigate to `[SITEROOT]/admin/appearance` and scroll to the bottom. Confirm that the Admin theme is set to 'Default Theme'.
Now navigate to `[SITEROOT]/admin/appearance/colorizer` by clicking on the 'Colorizer' tab. Here you will see the color scheme options. There are a few default options you can select from the drop down, or you can enter hex values to create a custom color scheme, be sure to click 'Save Configuration' when finished. Your new colors are saved to a css file in your files directory. If you do not see your changes you may need to clear the colorizer cache by clicking the 'Clear Colorizer Cache' button. These colors will override all other styles in the theme.
-
-### Fonts
+.. image:: ../images/Appearance_DKAN_4.png
+
+Fonts
+****************************
+
On the Appearance page, you will see a sub-menu item for **@font-your-face**. Navigate to `[SITEROOT]/admin/appearance/fontyourface`.
By default, the Google fonts api is enabled. If you click on the **Browse all fonts** tab, you will be able to select which google fonts to add to your site. Once you have made your selections, click on the **Enabled fonts** tab to view the font settings screen. Click on the **By CSS selector**, here you can select the css tag and what font should be applied to it using the table. To add fonts to specific css selectors, add them to the open text field at the bottom of the list, select a font from the dropdown next to it and click the **Save applied fonts** button
-For more information on how to use @fontyourface visit the [project page](https://www.drupal.org/project/fontyourface).
-
-
+For more information on how to use @fontyourface visit the `project page `_.
+
+.. image:: ../images/Browse_fonts_DKAN.png
+ :alt: Apply fonts
+
+.. image:: ../images/Appearance_DKAN_5.png
+ :alt: Select google fonts
+
+.. _creating_subtheme:
-## Creating a new subtheme
+Creating a new subtheme
+****************************
To create a Nuboot Radix subtheme, run these commands
-```drush en radix```
+.. code-block:: php
+
+ drush en radix
-```drush vset theme_default radix```
+ drush vset theme_default radix
-```drush radix "MyThemeName" --kit=https://github.com/NuCivic/radix-kit-nuboot/archive/master.zip```
+ drush radix "MyThemeName" --kit=https://github.com/NuCivic/radix-kit-nuboot/archive/master.zip
-```drush vset theme_default MyThemeName```
+ drush vset theme_default MyThemeName
-```drush dis radix```
+ drush dis radix
-OR if using [Ahoy](https://dkan-starter.readthedocs.io):
+OR if using `Ahoy `_:
-```ahoy dkan theme new-from-kit [new-theme-name]```
+.. code-block:: php
-```ahoy dkan theme setup```
+ ahoy dkan theme new-from-kit [new-theme-name]
-```ahoy dkan theme watch```
+ ahoy dkan theme setup
+
+ ahoy dkan theme watch
Your new subtheme will be placed in to the /sites/all/themes/ directory, it will contain only the directory structure, add your overrides where appropriate.
-### Theming Tools
-Install Node and npm. You will use [gulp](https://www.npmjs.com/package/gulp) for compiling the sass files. To get your local environment set up, follow these steps:
+Theming Tools
+---------------
+
+Install Node and npm. You will use `gulp `_ for compiling the sass files. To get your local environment set up, follow these steps:
-1. Install Node and npm. You can read a guide on how to install node here: [https://docs.npmjs.com/getting-started/installing-node](https://docs.npmjs.com/getting-started/installing-node)
-2. Install bower: `npm install -g bower`.
-3. Go to the root of your theme and run the following commands: `npm run setup`.
+1. Install Node and npm. You can read a guide on how to install node `here `_
+2. Install bower: ``npm install -g bower``.
+3. Go to the root of your theme and run the following commands: ``npm run setup``.
4. Update browserSyncProxy in config.json
-5. Edit the files under the scss and js directory, these will be compiled into the assets directory. Run the following command to compile Sass and watch for changes: `gulp`.
+5. Edit the files under the scss and js directory, these will be compiled into the assets directory. Run the following command to compile Sass and watch for changes: ``gulp``.
+
+Icon Fonts
+---------------
-## Icon Fonts
+The Nuboot Radix theme ships with two icon fonts:
-The Nuboot Radix theme [ships with two icon fonts](https://github.com/NuCivic/dkan/tree/rtd/themes/nuboot_radix/assets/fonts).
+dkan-flaticon
+***************
-### dkan-flaticon
-Used for file types (csv, pdf, xls, etc) [designed by Freepik](http://www.flaticon.com/packs/file-formats-icons)
+This font is used for file types (csv, pdf, xls, etc) `designed by Freepik `_
The font files and the css are inside the Nuboot Radix theme `dkan/themes/nuboot_radix`. If you would like to use your own file type icons you can override the dkan-flaticon css by creating a custom theme. OR, if you would like to use the dkan-flaticon icons but NOT use Nuboot Radix as your base theme, you will need to copy the dkan-flaticon fonts and the dkan-flaticon.css into the theme you are using.
-```
-dkan/themes/nuboot_radix/assets/fonts
-dkan/themes/nuboot_radix/assets/css/dkan-flaticon.css
-```
+.. code-block:: php
+
+ dkan/themes/nuboot_radix/assets/fonts/dkan-flaticon.eot
+ dkan/themes/nuboot_radix/assets/fonts/dkan-flaticon.svg
+ dkan/themes/nuboot_radix/assets/fonts/dkan-flaticon.ttf
+ dkan/themes/nuboot_radix/assets/fonts/dkan-flaticon.woff
+ dkan/themes/nuboot_radix/assets/css/dkan-flaticon.css
+
-### dkan-topics
-Used for the Content Type icons and [Topics](topics.md) icons [by Streamline Icons](http://www.streamlineicons.com/index.html)
+dkan-topics
+***************
-If you would like to use your own icon font for Topics, you can do that through the user interface.
+This font is used for the Content Type and :doc:`Topics ` icons, see `Streamline Icons `_
-1. As an administrator user you can navigate to Configuration > Content authoring > Font Icon Select Options `admin/config/content/font_icon_select_options`.
-2. Use the 'Upload New Library' button to upload your icon font files.
-3. Navigate to Structure > Taxonomy > Topics > Manage fields > Icon `admin/structure/taxonomy/dkan_topics/fields/field_topic_icon`
-4. Scroll down to the 'Icon field settings' fieldset and select your font from the drop down options.
+If you would like to use your own icon font for Topics, use the :doc:`steps outlined here `.
diff --git a/dkan/docs/components/topics.md b/dkan/docs/components/topics.md
deleted file mode 100644
index 787bc0193..000000000
--- a/dkan/docs/components/topics.md
+++ /dev/null
@@ -1,18 +0,0 @@
-# DKAN Topics
-
-While DKAN includes a free-tagging tags/keywords field for datasets, many data portals organize datasets into more predefined catagories by subject matter. These are usually a small collection of subjects with logos that are incoporated into the site navegation. Neither DKAN's tags or "groups" (which are designed for grouping user permissions and usually represent organizational divisions) are exactly appropriate for this task.
-
-The DKAN Topics module adds a "topics" vocabulary to DKAN, and corresponding functionality throughout the site. It adds a facet to the search/datasets page, and a pane to the default homepage. Topics can be administered through the standard Drupal taxonomy interface.
-
-The included [DKAN Default Topics](https://github.com/NuCivic/dkan/tree/7.x-1.x/modules/dkan/dkan_topics/modules/dkan_default_topics) module will add, on enable, a set of default civic topics using the [Taxonomy Fixtures](https://github.com/NuCivic/taxonomy_fixtures) module.
-
-DKAN Topics is enabled by default on new DKAN installations, with default terms loaded into the vocabulary. The module can be disabled and uninstalled, and all existing topics will be removed.
-
-### Known Issues
-
-* When enabling this module on an existing DKAN site, the default topics may be added to the top-level navigation menu. If this happens, simply use the taxonomy UI to move the new terms under the "Topics" term. New topics you add should then be added under the Topics term in the main menu.
-* The module adds menu items under "Topics" for any new topic you add. At present, this functionality cannot be disabled. If you want a different behavior in the main navegation bar (a different word in place of "Topics", or no presence at all for Topics in the main navegation), you will need to modify every menu item created by the module after adding a new topic. Future versions should add more flexibility.
-* To filter by topics on the Datasets/Search page, field_topics needs to be added to the dataset search index. This should happen automatically when you enable this module and revert all DKAN core [features](https://www.drupal.org/project/features). However, in some cases this has been observed not to work. To fix edit the datasets index manually (`admin/config/search/search_api/index/datasets/fields`) and add field_topics.
-* Since this module adds a field to the Dataset content type, your search indexes will need to be rebuilt, whether or not the previous step (manually adding the field to the index) is necessary. After installing, clear your dataset index and re-index all items by doing one of the following:
- * Visit _admin/config/search/search_api/index/datasets_ and perform the steps in the browser
- * Use drush: `drush sapi-c datasets && drush sapi-r datasets && drush sapi-i datasets`
diff --git a/dkan/docs/components/topics.rst b/dkan/docs/components/topics.rst
new file mode 100644
index 000000000..549b61979
--- /dev/null
+++ b/dkan/docs/components/topics.rst
@@ -0,0 +1,61 @@
+DKAN Topics
+===========
+
+While DKAN includes a free-tagging tags/keywords field for datasets, many data portals organize datasets into more predefined categories by subject matter. These are usually a small collection of subjects with logos that are incorporated into the site navigation. Neither DKAN's tags or "groups" (which are designed for grouping user permissions and usually represent organizational divisions) are exactly appropriate for this task.
+
+The DKAN Topics module adds a "topics" vocabulary to DKAN, and corresponding functionality throughout the site. It adds a facet to the search/datasets page, and a pane to the default homepage. Topics can be administered through the standard Drupal taxonomy interface.
+
+The included `DKAN Default Topics `_ module will add, on enable, a set of default civic topics using the `Taxonomy Fixtures `_ module.
+
+DKAN Topics is enabled by default on new DKAN installations, with default terms loaded into the vocabulary. The module can be disabled and uninstalled, and all existing topics will be removed.
+
+Permissions
+------------------------------------
+
+* Users with the Site Manager or Editor role can add and edit topic terms.
+* Users with the Administrator role can add new icons.
+
+Adding a new topic term
+------------------------------------
+
+From the Administration menu, navigate to ``Site Configuration > Taxonomy > Topics > Add term``
+
+:Name: Enter the term for your new topic.
+:Description: This field is not currently displayed publicly.
+:Icon Type: DKAN Topics comes with a default set of font icons that can be used with your terms, you can upload your own font icons if desired. See Adding new icons. Or you may select to use image icons, when you toggle the image option, an image upload input field will appear.
+:Icon: If using font icons, select the icon you want to associate with your topic term.
+:Icon Color: Icons will display the same color as text on datasets unless a specific color is selected here.
+
+Editing topic terms
+------------------------------------
+
+1. From the Administration menu, navigate to ``Site Configuration > Taxonomy > Topics``
+2. You will see a list of current topic terms, click the 'edit' link under Operations that corresponds to the term you would like to edit.
+3. Make changes and click "Save".
+
+Removing Topics from the main menu
+------------------------------------
+
+1. Navigate to ``Site Configuration > Menus``
+2. On the Menus screen, click "list links"
+3. Uncheck the box under "Enabled" for Topics
+4. Click "Save configuration"
+
+Adding new icons
+------------------------------------
+The font used for Topics can only be changed if there are **NO** default icon values in use, only one icon font can be used at a time.
+
+1. Navigate to ``Configuration > Content Authoring > Font Icon Select Options``
+2. Click "Upload New Library"
+3. Enter a title for your new font option
+4. Upload the four files for your font
+5. Click "Save"
+6. Navigate to ``Structure > Taxonomy > Topics > Manage Fields > Icon``
+7. Select your font from the font dropdown in the Icon field settings section.
+8. Click "Save settings"
+
+
+Known Issues
+------------------------------------
+* This module adds a main menu link for "Topics". If you want a different word in place of "Topics", you can change the name in the main menu configuration but the icons in the dropdown will stop working. If you use `String Overrrides `_ you can change the Menu link title and the icons will continue to work, however the facet block title and the dataset form field title will still display as 'Topics'.
+* Adding a new icon font for use with topics **needs work** to keep the icon functionality in facets and menus from breaking.
diff --git a/dkan/docs/components/visualizations.md b/dkan/docs/components/visualizations.md
deleted file mode 100644
index af9c70466..000000000
--- a/dkan/docs/components/visualizations.md
+++ /dev/null
@@ -1,3 +0,0 @@
-# Visualization Entities
-
-Drupal ships with the [Visualization Entity](https://github.com/NuCivic/visualization_entity/) module. The documentation for this module lives (for now) in a [separate documentation site](https://visualization-entity.readthedocs.io). This page will be improved in the future.
diff --git a/dkan/docs/components/visualizations/datapreviews.rst b/dkan/docs/components/visualizations/datapreviews.rst
new file mode 100644
index 000000000..699217358
--- /dev/null
+++ b/dkan/docs/components/visualizations/datapreviews.rst
@@ -0,0 +1,101 @@
+DKAN Data Preview Features
+==========================
+
+DKAN allows users to have a preview of their data when uploaded to or linked to a *resource*. Which preview type is displayed for a particular *resource* depends on the data **format** selected. If no data format is provided, DKAN will attempt to auto-detect the format from the file's metadata; re-editing the *resource* and correcting the format field manually may be necessary if the auto-detection is not successful.
+
+This functionality is provided via the `Recline module `_, which is not part of the core DKAN repository but is a basic dependency of it (and will be included when building the distribution via ``drush make``).
+
+Recline.js
+-------------
+
+DKAN, like CKAN, offers an integration with the `Recline `_ Javascript library. Recline allows site visitors to preview tabular data visually. The preview works for CSV and XLS [*]_ files that are uploaded to the DKAN site or hosted remotely and linked to, as well as for data stored in DKAN's local SQL-based :doc:`datastore <../datastore>`.
+
+Grid View
+*************
+All tabular data can be rendered as spreadsheet-style rows and columns:
+
+.. figure:: ../../images/csv-preview.png
+
+.. [*] For xls files be sure to fill in the format field to see previews of the data
+
+.. figure:: ../../images/xls-format.png
+
+Map View
+*************
+Visitors can preview data that contains either coordinates or GeoJSON on a `Leaflet.js `_ -based map:
+
+.. image:: ../../images/map-preview.png
+
+Graph View
+*************
+If enabled, visitors can chose one column of your data as an X-axis, one or more as Y-axis data, and preview your data as a bar, point or line graph.
+
+.. image:: ../../images/graph-preview.png
+
+File size limits
+****************
+Files can only be previewed if they are well formatted and small enough to render in the browser.
+
+If files are too large to preview within 1 second you will get the following message *"File was too large or unavailable for preview."*
+
+Files that are too large to preview in the browser can be previewed by :doc:`adding them to the datastore <../datastore/index>`. Once a file is in the datastore the preview is only asking for the first 25 rows of the data. Thus large datasets can be previewed.
+
+Additional Preview Types
+----------------------------
+DKAN provides preview formats for several additional file types beyond what is supported by Recline.js, these include: JSON, geojson, XML, ArcGIS REST, WMS, images, PDF, and ZIP files. These additional preview formatters are defined in a forked version of `Recline `_
+
+Zip files
+****************
+DKAN offers the ability to preview the files and folders locked in ZIP files. DKAN will display a list of contents for ZIP files uploaded as resources on datasets.
+
+.. image:: ../../images/zip-preview.png
+
+Image files
+****************
+Image files (JPG, PNG or GIF) uploaded as resources will be displayed directly on the resource page.
+
+.. image:: ../../images/image-preview.png
+
+Web Map Service (WMS)
+*********************
+DKAN can use Leaflet to display a preview of a `WMS server `_, provided endpoint.
+
+.. image:: ../../images/wms.png
+
+WMS support in DKAN is still somewhat experimental and your results may vary.
+
+ArcGIS REST
+****************
+An ESRI/ArcGIS REST endpoint may also be displayed in a Leaflet preview.
+
+.. image:: ../../images/arcgis.png
+
+JSON files
+****************
+.. image:: ../../images/json-preview.png
+
+GeoJSON files
+****************
+.. image:: ../../images/geojson-preview.png
+
+XML files
+****************
+.. image:: ../../images/xml-preview.png
+
+PDF files
+****************
+.. image:: ../../images/pdf-preview.png
+
+External Previews
+******************
+Starting with version 7.x-1.10, DKAN supports previewing/opening resources in external services that offer simple URL-based integrations. For instance, the CartoDB mapping service offers an `Open in CartoDB service `_. Enabling this for CSV files will result in a dataset display like this:
+
+.. image:: ../../images/external-preview.png
+
+External preview functionality can be enabled and configured in the "DKAN Dataset Previews" administration page (/admin/dkan/dataset_preview).
+
+Configuration
+----------------
+By default previews are available for resources with files below 3MB of size. However you can customize this limit in the recline configuration page (*/admin/dkan/recline*).
+
+.. image:: ../../images/recline-configuration.png
diff --git a/dkan/docs/components/visualizations/index.rst b/dkan/docs/components/visualizations/index.rst
new file mode 100644
index 000000000..8fdf270df
--- /dev/null
+++ b/dkan/docs/components/visualizations/index.rst
@@ -0,0 +1,19 @@
+Visualizations
+======================
+
+DKAN provides visualization functionality in two primary ways: through the
+automatically-created "data previews" that are displayed with data :ref:`resources `,
+and the more-complex and manually-build visualization "entities":
+
+.. toctree::
+ :maxdepth: 1
+
+ Data Previews
+ Visualization Entity
+
+Additional visualization functionality can be found in the following projects,
+which are not included in the core DKAN project and are still in a relatively
+expiremental state:
+
+* `DKAN Datastore CartoDB Integration `_
+* `React Dash library `_
diff --git a/dkan/docs/components/visualizations/visualization_entity/chart.rst b/dkan/docs/components/visualizations/visualization_entity/chart.rst
new file mode 100644
index 000000000..e38a694d1
--- /dev/null
+++ b/dkan/docs/components/visualizations/visualization_entity/chart.rst
@@ -0,0 +1,91 @@
+Visualization Chart
+====================
+
+Visualization Entity Charts is enabled by default in DKAN. This modules provides the ability to create embeddable NVD3 charts.
+
+Usage
+------------
+New chart entities can be created by going to ``/admin/structure/entity-type/visualization/ve_chart/add``. A multi-step process will guide you through the creation of a chart based on an uploaded data file.
+
+Step One - Choose a Resource
+*****************************
+Use the form to upload a data file **OR** link to an existing data resource.
+Valid source data include:
+* CSV
+* Google Spreadsheet
+* Data Proxy
+
+.. image:: images/chart-step-1.png
+
+Step Two - Define Variables
+****************************
+Choose a single *x-field* and one or more *y-fields* (series) for the visualization.
+
+.. image:: images/chart-step-2.png
+
+Step Three - Choose Chart Type
+*******************************
+**NOTE**: X and Y Axis Fields are not supported by the *Pie Chart* type.
+
+.. image:: images/chart-step-3.png
+
+Step Four - Preview and Adjust
+*******************************
+You can adjust colors, margins, include a goal, labels, tick values, and more.
+
+.. image:: images/chart-step-4.png
+
+Query Editor
+****************************
+Click the '+' on the query editor to add a query parameter to specify the data used for the chart.
+
+.. image:: images/chart-query-editor.png
+
+Filter Editor
+****************************
+Click the '+' on the filter editor to add one or more filters to limit the data used for the chart.
+Multiple filters can be applied to data, the operator is 'OR'.
+
+* Select the field you would like to filter by.
+* Select the type of filter (value, range, geo distance)
+* Click **Add**
+* Fill in the fields to complete the filter.
+
+To delete a filter, click the 'x' next to the filter name.
+
+.. image:: images/chart-filter-editor.png
+
+Chart Configuration
+--------------------
+
+X Axis
+*****************
+* **Format** Select an appropriate format for the X Axis labels.
+* **Axis Label** will provide a custom label for the x axis.
+* **Note:** Axis labels do not display for Pie Charts.
+* **Label rotation** will change angle of label values.
+* **Tick Values** with **step value** will update the number of ticks for the X axis. **NOTE:** If the range set for tick values is smaller than the range of complete data represented, the chart will be abbreviated.
+
+Y Axis
+*****************
+* **Axis Label** Provides a custom label for the y axis.
+* **Note:** Axis labels do not display for Pie Charts.
+* Adjust the *distance* field until Label is visible on the chart.
+* Adjust **Tick Values** with **step value** to change the number of ticks for the Y axis. **NOTE:** If the range set for tick values is smaller than the range of complete data represented, the chart will be abbreviated.
+
+General
+*****************
+:Color: Set the color the chart is drawn in. Use either a `HEX color code `_ or a `valid css color name `_
+:Transition Time: Time in ms it takes for graph to animate.
+:Goal: Overlay a goal or target line on the chart.
+:Margin: Enter value of margin in the order: *top, right, bottom, left*
+:Show Title: Display the title you entered on step 1.
+:Show Controls: Whether to show extra controls or not. Extra controls include things like making multiBar charts stacked or side by side.
+:Show Legend: Display a legend for the chart.
+:Group By X Field: For multiple series values Y will show values grouped by X
+:Show Tooltips: Shows data and label on hover.
+:Reduce Ticks: Reduces the number of axis values displayed.
+
+Recline
+*****************
+The bundle also includes an integration with the `Recline module `_. If you have a content type with a recline file field, you can add a Recline Field Reference field to your chart bundle. This field type is defined in a module that comes bundled with `Visualization Entity `_. The included DKAN integration module adds a Recline Field Reference pointing specifically at DKAN's Resource content type. In this case, entering an existing Resource node in the reference field will automatically populate the resource file into the chart entity's file field.
diff --git a/dkan/docs/components/visualizations/visualization_entity/choropleth.rst b/dkan/docs/components/visualizations/visualization_entity/choropleth.rst
new file mode 100644
index 000000000..a57c04557
--- /dev/null
+++ b/dkan/docs/components/visualizations/visualization_entity/choropleth.rst
@@ -0,0 +1,69 @@
+Choropleth
+===========
+.. warning::
+
+ Under Development. Do not use on production.
+
+Enable the choropleth bundle:
+
+.. code-block:: php
+
+ $ drush en -y visualization_entity_choropleth_bundle
+ $ drush cc all
+
+
+Examples Files
+--------------
+Two example files are provided in the **examples** folder:
+
+.. code-block:: php
+
+ africa.geojson
+ africa-data.csv
+
+
+Create Visualization
+--------------------
++ Look for **Content -> Add Content -> Resource** in the admin menu and click on it.
+
++ Upload a **africa-data.csv** file from the examples folder for the resource.
+
+.. image:: images/choropleth-step-00.png
+
++ Fill the required fields, enter 'geojson' in the format field, and **save** the resource
+
+.. image:: images/choropleth-step-01.png
+
++ Look for **Structure -> Entity Types -> Geo File -> geojson -> Add geojson** in the admin menu and click on it.
+
+.. image:: images/choropleth-step-02.png
+
++ Set **Title**
++ Upload a **geojson** file
++ Fill **name attribute** with the **column name** in the data (csv resource) that will match the **name** property for the features in the **geojson** file.
+
+.. image:: images/choropleth-step-03.png
+
++ Click **Save**.
++ You'll get a preview for the geojson file you just uploaded.
+
+.. image:: images/choropleth-step-04.png
+
++ Look for **Structure -> Entity Types -> Visualization -> Choropleth Visualization -> Add Choropleth Visualization** in the admin menu and click on it.
+
+.. image:: images/choropleth-step-05.png
+
++ Fill Title
++ Select the **geojson** file we created for the **geojson** field.
++ Select the **resource** file we created for the **resource** field.
+
+.. image:: images/choropleth-step-06.png
+
++ Select the **colors** you like to use for the choropleth map.
++ Fill **data column** with the column in the csv data you'll like to pick as the source of numerical data for the polygon coloring. If you leave this field blank, you'll get a list of radio buttons to pick up the column when the visualization gets rendered.
++ Fill the **data breakpoints** with comma separated numbers. If you leave this field blank, breakpoints will be calculated for you based on the data.
+
+.. image:: images/choropleth-step-07.png
+
++ Click **Save** & Enjoy!
+.. image:: images/choropleth-step-08.png
diff --git a/dkan/docs/components/visualizations/visualization_entity/examples/africa-data.csv b/dkan/docs/components/visualizations/visualization_entity/examples/africa-data.csv
new file mode 100644
index 000000000..d12c0e5b5
--- /dev/null
+++ b/dkan/docs/components/visualizations/visualization_entity/examples/africa-data.csv
@@ -0,0 +1,53 @@
+country,life_expectency,literacy_rate
+Algeria,71,69.9
+Angola,46,67.4
+Benin,57,34.7
+Botswana,61,81.2
+Burkina Faso,51,21.8
+Burundi,50,59.3
+Cameroon,53,67.9
+Cape Verde,71,76.6
+Central African R.,48,48.6
+Chad,46,25.7
+Comoros,60,56.5
+Congo,54,83.8
+D.R. Congo,45,67.2
+Côte d'Ivoire,56,48.7
+Djibouti,59,67.9
+Egypt,69,71.4
+Equatorial Guinea,53,87
+Eritrea,65,58.6
+Ethiopia,58,42.7
+Gabon,60,63.2
+Gambia,59,40.1
+Ghana,62,57.9
+Guinea,54,29.5
+Guinea-Bissau,49,42.4
+Kenya,54,85.1
+Lesotho,47,84.8
+Liberia,54,57.5
+Libya,73,82.6
+Madagascar,60,68.9
+Malawi,53,62.7
+Mali,49,46.4
+Mauritania,58,51.2
+Mauritius,73,84.4
+Morocco,72,52.3
+Mozambique,51,47.8
+Namibia,63,85
+Niger,52,28.7
+Nigeria,49,68
+Rwanda,58,70.4
+São Tomé & Príncipe,61,84.9
+Senegal,59,39.3
+Sierra Leone,49,35.1
+Somalia,48,37.8
+South Africa,53,86.4
+Sudan,57,61.1
+Swaziland,48,81.6
+Tanzania,53,69.4
+Togo,59,60.9
+Tunisia,75,74.3
+Uganda,52,66.8
+Zambia,48,80.6
+Zimbabwe,42,90.7
\ No newline at end of file
diff --git a/dkan/docs/components/visualizations/visualization_entity/examples/africa.geojson b/dkan/docs/components/visualizations/visualization_entity/examples/africa.geojson
new file mode 100644
index 000000000..7c61be332
--- /dev/null
+++ b/dkan/docs/components/visualizations/visualization_entity/examples/africa.geojson
@@ -0,0 +1 @@
+{"type":"FeatureCollection","features":[{"type":"Feature","id":"AGO","properties":{"name":"Angola"},"geometry":{"type":"MultiPolygon","coordinates":[[[[16.326528,-5.87747],[16.57318,-6.622645],[16.860191,-7.222298],[17.089996,-7.545689],[17.47297,-8.068551],[18.134222,-7.987678],[18.464176,-7.847014],[19.016752,-7.988246],[19.166613,-7.738184],[19.417502,-7.155429],[20.037723,-7.116361],[20.091622,-6.94309],[20.601823,-6.939318],[20.514748,-7.299606],[21.728111,-7.290872],[21.746456,-7.920085],[21.949131,-8.305901],[21.801801,-8.908707],[21.875182,-9.523708],[22.208753,-9.894796],[22.155268,-11.084801],[22.402798,-10.993075],[22.837345,-11.017622],[23.456791,-10.867863],[23.912215,-10.926826],[24.017894,-11.237298],[23.904154,-11.722282],[24.079905,-12.191297],[23.930922,-12.565848],[24.016137,-12.911046],[21.933886,-12.898437],[21.887843,-16.08031],[22.562478,-16.898451],[23.215048,-17.523116],[21.377176,-17.930636],[18.956187,-17.789095],[18.263309,-17.309951],[14.209707,-17.353101],[14.058501,-17.423381],[13.462362,-16.971212],[12.814081,-16.941343],[12.215461,-17.111668],[11.734199,-17.301889],[11.640096,-16.673142],[11.778537,-15.793816],[12.123581,-14.878316],[12.175619,-14.449144],[12.500095,-13.5477],[12.738479,-13.137906],[13.312914,-12.48363],[13.633721,-12.038645],[13.738728,-11.297863],[13.686379,-10.731076],[13.387328,-10.373578],[13.120988,-9.766897],[12.87537,-9.166934],[12.929061,-8.959091],[13.236433,-8.562629],[12.93304,-7.596539],[12.728298,-6.927122],[12.227347,-6.294448],[12.322432,-6.100092],[12.735171,-5.965682],[13.024869,-5.984389],[13.375597,-5.864241],[16.326528,-5.87747]]],[[[12.436688,-5.684304],[12.182337,-5.789931],[11.914963,-5.037987],[12.318608,-4.60623],[12.62076,-4.438023],[12.995517,-4.781103],[12.631612,-4.991271],[12.468004,-5.248362],[12.436688,-5.684304]]]]}},{"type":"Feature","id":"BDI","properties":{"name":"Burundi"},"geometry":{"type":"Polygon","coordinates":[[[29.339998,-4.499983],[29.276384,-3.293907],[29.024926,-2.839258],[29.632176,-2.917858],[29.938359,-2.348487],[30.469696,-2.413858],[30.527677,-2.807632],[30.743013,-3.034285],[30.752263,-3.35933],[30.50556,-3.568567],[30.116333,-4.090138],[29.753512,-4.452389],[29.339998,-4.499983]]]}},{"type":"Feature","id":"BEN","properties":{"name":"Benin"},"geometry":{"type":"Polygon","coordinates":[[[2.691702,6.258817],[1.865241,6.142158],[1.618951,6.832038],[1.664478,9.12859],[1.463043,9.334624],[1.425061,9.825395],[1.077795,10.175607],[0.772336,10.470808],[0.899563,10.997339],[1.24347,11.110511],[1.447178,11.547719],[1.935986,11.64115],[2.154474,11.94015],[2.490164,12.233052],[2.848643,12.235636],[3.61118,11.660167],[3.572216,11.327939],[3.797112,10.734746],[3.60007,10.332186],[3.705438,10.06321],[3.220352,9.444153],[2.912308,9.137608],[2.723793,8.506845],[2.749063,7.870734],[2.691702,6.258817]]]}},{"type":"Feature","id":"BFA","properties":{"name":"Burkina Faso"},"geometry":{"type":"Polygon","coordinates":[[[-2.827496,9.642461],[-3.511899,9.900326],[-3.980449,9.862344],[-4.330247,9.610835],[-4.779884,9.821985],[-4.954653,10.152714],[-5.404342,10.370737],[-5.470565,10.95127],[-5.197843,11.375146],[-5.220942,11.713859],[-4.427166,12.542646],[-4.280405,13.228444],[-4.006391,13.472485],[-3.522803,13.337662],[-3.103707,13.541267],[-2.967694,13.79815],[-2.191825,14.246418],[-2.001035,14.559008],[-1.066363,14.973815],[-0.515854,15.116158],[-0.266257,14.924309],[0.374892,14.928908],[0.295646,14.444235],[0.429928,13.988733],[0.993046,13.33575],[1.024103,12.851826],[2.177108,12.625018],[2.154474,11.94015],[1.935986,11.64115],[1.447178,11.547719],[1.24347,11.110511],[0.899563,10.997339],[0.023803,11.018682],[-0.438702,11.098341],[-0.761576,10.93693],[-1.203358,11.009819],[-2.940409,10.96269],[-2.963896,10.395335],[-2.827496,9.642461]]]}},{"type":"Feature","id":"BWA","properties":{"name":"Botswana"},"geometry":{"type":"Polygon","coordinates":[[[25.649163,-18.536026],[25.850391,-18.714413],[26.164791,-19.293086],[27.296505,-20.39152],[27.724747,-20.499059],[27.727228,-20.851802],[28.02137,-21.485975],[28.794656,-21.639454],[29.432188,-22.091313],[28.017236,-22.827754],[27.11941,-23.574323],[26.786407,-24.240691],[26.485753,-24.616327],[25.941652,-24.696373],[25.765849,-25.174845],[25.664666,-25.486816],[25.025171,-25.71967],[24.211267,-25.670216],[23.73357,-25.390129],[23.312097,-25.26869],[22.824271,-25.500459],[22.579532,-25.979448],[22.105969,-26.280256],[21.605896,-26.726534],[20.889609,-26.828543],[20.66647,-26.477453],[20.758609,-25.868136],[20.165726,-24.917962],[19.895768,-24.76779],[19.895458,-21.849157],[20.881134,-21.814327],[20.910641,-18.252219],[21.65504,-18.219146],[23.196858,-17.869038],[23.579006,-18.281261],[24.217365,-17.889347],[24.520705,-17.887125],[25.084443,-17.661816],[25.264226,-17.73654],[25.649163,-18.536026]]]}},{"type":"Feature","id":"CAF","properties":{"name":"Central African Republic"},"geometry":{"type":"Polygon","coordinates":[[[15.27946,7.421925],[16.106232,7.497088],[16.290562,7.754307],[16.456185,7.734774],[16.705988,7.508328],[17.96493,7.890914],[18.389555,8.281304],[18.911022,8.630895],[18.81201,8.982915],[19.094008,9.074847],[20.059685,9.012706],[21.000868,9.475985],[21.723822,10.567056],[22.231129,10.971889],[22.864165,11.142395],[22.977544,10.714463],[23.554304,10.089255],[23.55725,9.681218],[23.394779,9.265068],[23.459013,8.954286],[23.805813,8.666319],[24.567369,8.229188],[25.114932,7.825104],[25.124131,7.500085],[25.796648,6.979316],[26.213418,6.546603],[26.465909,5.946717],[27.213409,5.550953],[27.374226,5.233944],[27.044065,5.127853],[26.402761,5.150875],[25.650455,5.256088],[25.278798,5.170408],[25.128833,4.927245],[24.805029,4.897247],[24.410531,5.108784],[23.297214,4.609693],[22.84148,4.710126],[22.704124,4.633051],[22.405124,4.02916],[21.659123,4.224342],[20.927591,4.322786],[20.290679,4.691678],[19.467784,5.031528],[18.932312,4.709506],[18.542982,4.201785],[18.453065,3.504386],[17.8099,3.560196],[17.133042,3.728197],[16.537058,3.198255],[16.012852,2.26764],[15.907381,2.557389],[15.862732,3.013537],[15.405396,3.335301],[15.03622,3.851367],[14.950953,4.210389],[14.478372,4.732605],[14.558936,5.030598],[14.459407,5.451761],[14.53656,6.226959],[14.776545,6.408498],[15.27946,7.421925]]]}},{"type":"Feature","id":"CIV","properties":{"name":"Ivory Coast"},"geometry":{"type":"Polygon","coordinates":[[[-2.856125,4.994476],[-3.311084,4.984296],[-4.00882,5.179813],[-4.649917,5.168264],[-5.834496,4.993701],[-6.528769,4.705088],[-7.518941,4.338288],[-7.712159,4.364566],[-7.635368,5.188159],[-7.539715,5.313345],[-7.570153,5.707352],[-7.993693,6.12619],[-8.311348,6.193033],[-8.60288,6.467564],[-8.385452,6.911801],[-8.485446,7.395208],[-8.439298,7.686043],[-8.280703,7.68718],[-8.221792,8.123329],[-8.299049,8.316444],[-8.203499,8.455453],[-7.8321,8.575704],[-8.079114,9.376224],[-8.309616,9.789532],[-8.229337,10.12902],[-8.029944,10.206535],[-7.89959,10.297382],[-7.622759,10.147236],[-6.850507,10.138994],[-6.666461,10.430811],[-6.493965,10.411303],[-6.205223,10.524061],[-6.050452,10.096361],[-5.816926,10.222555],[-5.404342,10.370737],[-4.954653,10.152714],[-4.779884,9.821985],[-4.330247,9.610835],[-3.980449,9.862344],[-3.511899,9.900326],[-2.827496,9.642461],[-2.56219,8.219628],[-2.983585,7.379705],[-3.24437,6.250472],[-2.810701,5.389051],[-2.856125,4.994476]]]}},{"type":"Feature","id":"CMR","properties":{"name":"Cameroon"},"geometry":{"type":"Polygon","coordinates":[[[13.075822,2.267097],[12.951334,2.321616],[12.35938,2.192812],[11.751665,2.326758],[11.276449,2.261051],[9.649158,2.283866],[9.795196,3.073404],[9.404367,3.734527],[8.948116,3.904129],[8.744924,4.352215],[8.488816,4.495617],[8.500288,4.771983],[8.757533,5.479666],[9.233163,6.444491],[9.522706,6.453482],[10.118277,7.03877],[10.497375,7.055358],[11.058788,6.644427],[11.745774,6.981383],[11.839309,7.397042],[12.063946,7.799808],[12.218872,8.305824],[12.753672,8.717763],[12.955468,9.417772],[13.1676,9.640626],[13.308676,10.160362],[13.57295,10.798566],[14.415379,11.572369],[14.468192,11.904752],[14.577178,12.085361],[14.181336,12.483657],[14.213531,12.802035],[14.495787,12.859396],[14.893386,12.219048],[14.960152,11.555574],[14.923565,10.891325],[15.467873,9.982337],[14.909354,9.992129],[14.627201,9.920919],[14.171466,10.021378],[13.954218,9.549495],[14.544467,8.965861],[14.979996,8.796104],[15.120866,8.38215],[15.436092,7.692812],[15.27946,7.421925],[14.776545,6.408498],[14.53656,6.226959],[14.459407,5.451761],[14.558936,5.030598],[14.478372,4.732605],[14.950953,4.210389],[15.03622,3.851367],[15.405396,3.335301],[15.862732,3.013537],[15.907381,2.557389],[16.012852,2.26764],[15.940919,1.727673],[15.146342,1.964015],[14.337813,2.227875],[13.075822,2.267097]]]}},{"type":"Feature","id":"COD","properties":{"name":"Democratic Republic of the Congo"},"geometry":{"type":"Polygon","coordinates":[[[30.83386,3.509166],[30.773347,2.339883],[31.174149,2.204465],[30.85267,1.849396],[30.468508,1.583805],[30.086154,1.062313],[29.875779,0.59738],[29.819503,-0.20531],[29.587838,-0.587406],[29.579466,-1.341313],[29.291887,-1.620056],[29.254835,-2.21511],[29.117479,-2.292211],[29.024926,-2.839258],[29.276384,-3.293907],[29.339998,-4.499983],[29.519987,-5.419979],[29.419993,-5.939999],[29.620032,-6.520015],[30.199997,-7.079981],[30.740015,-8.340007],[30.346086,-8.238257],[29.002912,-8.407032],[28.734867,-8.526559],[28.449871,-9.164918],[28.673682,-9.605925],[28.49607,-10.789884],[28.372253,-11.793647],[28.642417,-11.971569],[29.341548,-12.360744],[29.616001,-12.178895],[29.699614,-13.257227],[28.934286,-13.248958],[28.523562,-12.698604],[28.155109,-12.272481],[27.388799,-12.132747],[27.16442,-11.608748],[26.553088,-11.92444],[25.75231,-11.784965],[25.418118,-11.330936],[24.78317,-11.238694],[24.314516,-11.262826],[24.257155,-10.951993],[23.912215,-10.926826],[23.456791,-10.867863],[22.837345,-11.017622],[22.402798,-10.993075],[22.155268,-11.084801],[22.208753,-9.894796],[21.875182,-9.523708],[21.801801,-8.908707],[21.949131,-8.305901],[21.746456,-7.920085],[21.728111,-7.290872],[20.514748,-7.299606],[20.601823,-6.939318],[20.091622,-6.94309],[20.037723,-7.116361],[19.417502,-7.155429],[19.166613,-7.738184],[19.016752,-7.988246],[18.464176,-7.847014],[18.134222,-7.987678],[17.47297,-8.068551],[17.089996,-7.545689],[16.860191,-7.222298],[16.57318,-6.622645],[16.326528,-5.87747],[13.375597,-5.864241],[13.024869,-5.984389],[12.735171,-5.965682],[12.322432,-6.100092],[12.182337,-5.789931],[12.436688,-5.684304],[12.468004,-5.248362],[12.631612,-4.991271],[12.995517,-4.781103],[13.25824,-4.882957],[13.600235,-4.500138],[14.144956,-4.510009],[14.209035,-4.793092],[14.582604,-4.970239],[15.170992,-4.343507],[15.75354,-3.855165],[16.00629,-3.535133],[15.972803,-2.712392],[16.407092,-1.740927],[16.865307,-1.225816],[17.523716,-0.74383],[17.638645,-0.424832],[17.663553,-0.058084],[17.82654,0.288923],[17.774192,0.855659],[17.898835,1.741832],[18.094276,2.365722],[18.393792,2.900443],[18.453065,3.504386],[18.542982,4.201785],[18.932312,4.709506],[19.467784,5.031528],[20.290679,4.691678],[20.927591,4.322786],[21.659123,4.224342],[22.405124,4.02916],[22.704124,4.633051],[22.84148,4.710126],[23.297214,4.609693],[24.410531,5.108784],[24.805029,4.897247],[25.128833,4.927245],[25.278798,5.170408],[25.650455,5.256088],[26.402761,5.150875],[27.044065,5.127853],[27.374226,5.233944],[27.979977,4.408413],[28.428994,4.287155],[28.696678,4.455077],[29.159078,4.389267],[29.715995,4.600805],[29.9535,4.173699],[30.83386,3.509166]]]}},{"type":"Feature","id":"COG","properties":{"name":"Republic of the Congo"},"geometry":{"type":"Polygon","coordinates":[[[12.995517,-4.781103],[12.62076,-4.438023],[12.318608,-4.60623],[11.914963,-5.037987],[11.093773,-3.978827],[11.855122,-3.426871],[11.478039,-2.765619],[11.820964,-2.514161],[12.495703,-2.391688],[12.575284,-1.948511],[13.109619,-2.42874],[13.992407,-2.470805],[14.29921,-1.998276],[14.425456,-1.333407],[14.316418,-0.552627],[13.843321,0.038758],[14.276266,1.19693],[14.026669,1.395677],[13.282631,1.314184],[13.003114,1.830896],[13.075822,2.267097],[14.337813,2.227875],[15.146342,1.964015],[15.940919,1.727673],[16.012852,2.26764],[16.537058,3.198255],[17.133042,3.728197],[17.8099,3.560196],[18.453065,3.504386],[18.393792,2.900443],[18.094276,2.365722],[17.898835,1.741832],[17.774192,0.855659],[17.82654,0.288923],[17.663553,-0.058084],[17.638645,-0.424832],[17.523716,-0.74383],[16.865307,-1.225816],[16.407092,-1.740927],[15.972803,-2.712392],[16.00629,-3.535133],[15.75354,-3.855165],[15.170992,-4.343507],[14.582604,-4.970239],[14.209035,-4.793092],[14.144956,-4.510009],[13.600235,-4.500138],[13.25824,-4.882957],[12.995517,-4.781103]]]}},{"type":"Feature","id":"DJI","properties":{"name":"Djibouti"},"geometry":{"type":"Polygon","coordinates":[[[43.081226,12.699639],[43.317852,12.390148],[43.286381,11.974928],[42.715874,11.735641],[43.145305,11.46204],[42.776852,10.926879],[42.55493,11.10511],[42.31414,11.0342],[41.75557,11.05091],[41.73959,11.35511],[41.66176,11.6312],[42,12.1],[42.35156,12.54223],[42.779642,12.455416],[43.081226,12.699639]]]}},{"type":"Feature","id":"DZA","properties":{"name":"Algeria"},"geometry":{"type":"Polygon","coordinates":[[[11.999506,23.471668],[8.572893,21.565661],[5.677566,19.601207],[4.267419,19.155265],[3.158133,19.057364],[3.146661,19.693579],[2.683588,19.85623],[2.060991,20.142233],[1.823228,20.610809],[-1.550055,22.792666],[-4.923337,24.974574],[-8.6844,27.395744],[-8.665124,27.589479],[-8.66559,27.656426],[-8.674116,28.841289],[-7.059228,29.579228],[-6.060632,29.7317],[-5.242129,30.000443],[-4.859646,30.501188],[-3.690441,30.896952],[-3.647498,31.637294],[-3.06898,31.724498],[-2.616605,32.094346],[-1.307899,32.262889],[-1.124551,32.651522],[-1.388049,32.864015],[-1.733455,33.919713],[-1.792986,34.527919],[-2.169914,35.168396],[-1.208603,35.714849],[-0.127454,35.888662],[0.503877,36.301273],[1.466919,36.605647],[3.161699,36.783905],[4.815758,36.865037],[5.32012,36.716519],[6.26182,37.110655],[7.330385,37.118381],[7.737078,36.885708],[8.420964,36.946427],[8.217824,36.433177],[8.376368,35.479876],[8.140981,34.655146],[7.524482,34.097376],[7.612642,33.344115],[8.430473,32.748337],[8.439103,32.506285],[9.055603,32.102692],[9.48214,30.307556],[9.805634,29.424638],[9.859998,28.95999],[9.683885,28.144174],[9.756128,27.688259],[9.629056,27.140953],[9.716286,26.512206],[9.319411,26.094325],[9.910693,25.365455],[9.948261,24.936954],[10.303847,24.379313],[10.771364,24.562532],[11.560669,24.097909],[11.999506,23.471668]]]}},{"type":"Feature","id":"EGY","properties":{"name":"Egypt"},"geometry":{"type":"Polygon","coordinates":[[[34.9226,29.50133],[34.64174,29.09942],[34.42655,28.34399],[34.15451,27.8233],[33.92136,27.6487],[33.58811,27.97136],[33.13676,28.41765],[32.42323,29.85108],[32.32046,29.76043],[32.73482,28.70523],[33.34876,27.69989],[34.10455,26.14227],[34.47387,25.59856],[34.79507,25.03375],[35.69241,23.92671],[35.49372,23.75237],[35.52598,23.10244],[36.69069,22.20485],[36.86623,22],[32.9,22],[29.02,22],[25,22],[25,25.6825],[25,29.238655],[24.70007,30.04419],[24.95762,30.6616],[24.80287,31.08929],[25.16482,31.56915],[26.49533,31.58568],[27.45762,31.32126],[28.45048,31.02577],[28.91353,30.87005],[29.68342,31.18686],[30.09503,31.4734],[30.97693,31.55586],[31.68796,31.4296],[31.96041,30.9336],[32.19247,31.26034],[32.99392,31.02407],[33.7734,30.96746],[34.26544,31.21936],[34.9226,29.50133]]]}},{"type":"Feature","id":"ERI","properties":{"name":"Eritrea"},"geometry":{"type":"Polygon","coordinates":[[[42.35156,12.54223],[42.00975,12.86582],[41.59856,13.45209],[41.155194,13.77332],[40.8966,14.11864],[40.026219,14.519579],[39.34061,14.53155],[39.0994,14.74064],[38.51295,14.50547],[37.90607,14.95943],[37.59377,14.2131],[36.42951,14.42211],[36.323189,14.822481],[36.75386,16.291874],[36.85253,16.95655],[37.16747,17.26314],[37.904,17.42754],[38.41009,17.998307],[38.990623,16.840626],[39.26611,15.922723],[39.814294,15.435647],[41.179275,14.49108],[41.734952,13.921037],[42.276831,13.343992],[42.589576,13.000421],[43.081226,12.699639],[42.779642,12.455416],[42.35156,12.54223]]]}},{"type":"Feature","id":"ETH","properties":{"name":"Ethiopia"},"geometry":{"type":"Polygon","coordinates":[[[37.90607,14.95943],[38.51295,14.50547],[39.0994,14.74064],[39.34061,14.53155],[40.02625,14.51959],[40.8966,14.11864],[41.1552,13.77333],[41.59856,13.45209],[42.00975,12.86582],[42.35156,12.54223],[42,12.1],[41.66176,11.6312],[41.73959,11.35511],[41.75557,11.05091],[42.31414,11.0342],[42.55493,11.10511],[42.776852,10.926879],[42.55876,10.57258],[42.92812,10.02194],[43.29699,9.54048],[43.67875,9.18358],[46.94834,7.99688],[47.78942,8.003],[44.9636,5.00162],[43.66087,4.95755],[42.76967,4.25259],[42.12861,4.23413],[41.855083,3.918912],[41.1718,3.91909],[40.76848,4.25702],[39.85494,3.83879],[39.559384,3.42206],[38.89251,3.50074],[38.67114,3.61607],[38.43697,3.58851],[38.120915,3.598605],[36.855093,4.447864],[36.159079,4.447864],[35.817448,4.776966],[35.817448,5.338232],[35.298007,5.506],[34.70702,6.59422],[34.25032,6.82607],[34.0751,7.22595],[33.56829,7.71334],[32.95418,7.78497],[33.2948,8.35458],[33.8255,8.37916],[33.97498,8.68456],[33.96162,9.58358],[34.25745,10.63009],[34.73115,10.91017],[34.83163,11.31896],[35.26049,12.08286],[35.86363,12.57828],[36.27022,13.56333],[36.42951,14.42211],[37.59377,14.2131],[37.90607,14.95943]]]}},{"type":"Feature","id":"GAB","properties":{"name":"Gabon"},"geometry":{"type":"Polygon","coordinates":[[[11.093773,-3.978827],[10.066135,-2.969483],[9.405245,-2.144313],[8.797996,-1.111301],[8.830087,-0.779074],[9.04842,-0.459351],[9.291351,0.268666],[9.492889,1.01012],[9.830284,1.067894],[11.285079,1.057662],[11.276449,2.261051],[11.751665,2.326758],[12.35938,2.192812],[12.951334,2.321616],[13.075822,2.267097],[13.003114,1.830896],[13.282631,1.314184],[14.026669,1.395677],[14.276266,1.19693],[13.843321,0.038758],[14.316418,-0.552627],[14.425456,-1.333407],[14.29921,-1.998276],[13.992407,-2.470805],[13.109619,-2.42874],[12.575284,-1.948511],[12.495703,-2.391688],[11.820964,-2.514161],[11.478039,-2.765619],[11.855122,-3.426871],[11.093773,-3.978827]]]}},{"type":"Feature","id":"GHA","properties":{"name":"Ghana"},"geometry":{"type":"Polygon","coordinates":[[[1.060122,5.928837],[-0.507638,5.343473],[-1.063625,5.000548],[-1.964707,4.710462],[-2.856125,4.994476],[-2.810701,5.389051],[-3.24437,6.250472],[-2.983585,7.379705],[-2.56219,8.219628],[-2.827496,9.642461],[-2.963896,10.395335],[-2.940409,10.96269],[-1.203358,11.009819],[-0.761576,10.93693],[-0.438702,11.098341],[0.023803,11.018682],[-0.049785,10.706918],[0.36758,10.191213],[0.365901,9.465004],[0.461192,8.677223],[0.712029,8.312465],[0.490957,7.411744],[0.570384,6.914359],[0.836931,6.279979],[1.060122,5.928837]]]}},{"type":"Feature","id":"GIN","properties":{"name":"Guinea"},"geometry":{"type":"Polygon","coordinates":[[[-8.439298,7.686043],[-8.722124,7.711674],[-8.926065,7.309037],[-9.208786,7.313921],[-9.403348,7.526905],[-9.33728,7.928534],[-9.755342,8.541055],[-10.016567,8.428504],[-10.230094,8.406206],[-10.505477,8.348896],[-10.494315,8.715541],[-10.65477,8.977178],[-10.622395,9.26791],[-10.839152,9.688246],[-11.117481,10.045873],[-11.917277,10.046984],[-12.150338,9.858572],[-12.425929,9.835834],[-12.596719,9.620188],[-12.711958,9.342712],[-13.24655,8.903049],[-13.685154,9.494744],[-14.074045,9.886167],[-14.330076,10.01572],[-14.579699,10.214467],[-14.693232,10.656301],[-14.839554,10.876572],[-15.130311,11.040412],[-14.685687,11.527824],[-14.382192,11.509272],[-14.121406,11.677117],[-13.9008,11.678719],[-13.743161,11.811269],[-13.828272,12.142644],[-13.718744,12.247186],[-13.700476,12.586183],[-13.217818,12.575874],[-12.499051,12.33209],[-12.278599,12.35444],[-12.203565,12.465648],[-11.658301,12.386583],[-11.513943,12.442988],[-11.456169,12.076834],[-11.297574,12.077971],[-11.036556,12.211245],[-10.87083,12.177887],[-10.593224,11.923975],[-10.165214,11.844084],[-9.890993,12.060479],[-9.567912,12.194243],[-9.327616,12.334286],[-9.127474,12.30806],[-8.905265,12.088358],[-8.786099,11.812561],[-8.376305,11.393646],[-8.581305,11.136246],[-8.620321,10.810891],[-8.407311,10.909257],[-8.282357,10.792597],[-8.335377,10.494812],[-8.029944,10.206535],[-8.229337,10.12902],[-8.309616,9.789532],[-8.079114,9.376224],[-7.8321,8.575704],[-8.203499,8.455453],[-8.299049,8.316444],[-8.221792,8.123329],[-8.280703,7.68718],[-8.439298,7.686043]]]}},{"type":"Feature","id":"GMB","properties":{"name":"Gambia"},"geometry":{"type":"Polygon","coordinates":[[[-16.841525,13.151394],[-16.713729,13.594959],[-15.624596,13.623587],[-15.39877,13.860369],[-15.081735,13.876492],[-14.687031,13.630357],[-14.376714,13.62568],[-14.046992,13.794068],[-13.844963,13.505042],[-14.277702,13.280585],[-14.712197,13.298207],[-15.141163,13.509512],[-15.511813,13.27857],[-15.691001,13.270353],[-15.931296,13.130284],[-16.841525,13.151394]]]}},{"type":"Feature","id":"GNB","properties":{"name":"Guinea Bissau"},"geometry":{"type":"Polygon","coordinates":[[[-15.130311,11.040412],[-15.66418,11.458474],[-16.085214,11.524594],[-16.314787,11.806515],[-16.308947,11.958702],[-16.613838,12.170911],[-16.677452,12.384852],[-16.147717,12.547762],[-15.816574,12.515567],[-15.548477,12.62817],[-13.700476,12.586183],[-13.718744,12.247186],[-13.828272,12.142644],[-13.743161,11.811269],[-13.9008,11.678719],[-14.121406,11.677117],[-14.382192,11.509272],[-14.685687,11.527824],[-15.130311,11.040412]]]}},{"type":"Feature","id":"GNQ","properties":{"name":"Equatorial Guinea"},"geometry":{"type":"Polygon","coordinates":[[[9.492889,1.01012],[9.305613,1.160911],[9.649158,2.283866],[11.276449,2.261051],[11.285079,1.057662],[9.830284,1.067894],[9.492889,1.01012]]]}},{"type":"Feature","id":"KEN","properties":{"name":"Kenya"},"geometry":{"type":"Polygon","coordinates":[[[40.993,-0.85829],[41.58513,-1.68325],[40.88477,-2.08255],[40.63785,-2.49979],[40.26304,-2.57309],[40.12119,-3.27768],[39.80006,-3.68116],[39.60489,-4.34653],[39.20222,-4.67677],[37.7669,-3.67712],[37.69869,-3.09699],[34.07262,-1.05982],[33.903711,-0.95],[33.893569,0.109814],[34.18,0.515],[34.6721,1.17694],[35.03599,1.90584],[34.59607,3.05374],[34.47913,3.5556],[34.005,4.249885],[34.620196,4.847123],[35.298007,5.506],[35.817448,5.338232],[35.817448,4.776966],[36.159079,4.447864],[36.855093,4.447864],[38.120915,3.598605],[38.43697,3.58851],[38.67114,3.61607],[38.89251,3.50074],[39.559384,3.42206],[39.85494,3.83879],[40.76848,4.25702],[41.1718,3.91909],[41.855083,3.918912],[40.98105,2.78452],[40.993,-0.85829]]]}},{"type":"Feature","id":"LBR","properties":{"name":"Liberia"},"geometry":{"type":"Polygon","coordinates":[[[-7.712159,4.364566],[-7.974107,4.355755],[-9.004794,4.832419],[-9.91342,5.593561],[-10.765384,6.140711],[-11.438779,6.785917],[-11.199802,7.105846],[-11.146704,7.396706],[-10.695595,7.939464],[-10.230094,8.406206],[-10.016567,8.428504],[-9.755342,8.541055],[-9.33728,7.928534],[-9.403348,7.526905],[-9.208786,7.313921],[-8.926065,7.309037],[-8.722124,7.711674],[-8.439298,7.686043],[-8.485446,7.395208],[-8.385452,6.911801],[-8.60288,6.467564],[-8.311348,6.193033],[-7.993693,6.12619],[-7.570153,5.707352],[-7.539715,5.313345],[-7.635368,5.188159],[-7.712159,4.364566]]]}},{"type":"Feature","id":"LBY","properties":{"name":"Libya"},"geometry":{"type":"Polygon","coordinates":[[[14.8513,22.86295],[14.143871,22.491289],[13.581425,23.040506],[11.999506,23.471668],[11.560669,24.097909],[10.771364,24.562532],[10.303847,24.379313],[9.948261,24.936954],[9.910693,25.365455],[9.319411,26.094325],[9.716286,26.512206],[9.629056,27.140953],[9.756128,27.688259],[9.683885,28.144174],[9.859998,28.95999],[9.805634,29.424638],[9.48214,30.307556],[9.970017,30.539325],[10.056575,30.961831],[9.950225,31.37607],[10.636901,31.761421],[10.94479,32.081815],[11.432253,32.368903],[11.488787,33.136996],[12.66331,32.79278],[13.08326,32.87882],[13.91868,32.71196],[15.24563,32.26508],[15.71394,31.37626],[16.61162,31.18218],[18.02109,30.76357],[19.08641,30.26639],[19.57404,30.52582],[20.05335,30.98576],[19.82033,31.75179],[20.13397,32.2382],[20.85452,32.7068],[21.54298,32.8432],[22.89576,32.63858],[23.2368,32.19149],[23.60913,32.18726],[23.9275,32.01667],[24.92114,31.89936],[25.16482,31.56915],[24.80287,31.08929],[24.95762,30.6616],[24.70007,30.04419],[25,29.238655],[25,25.6825],[25,22],[25,20.00304],[23.85,20],[23.83766,19.58047],[19.84926,21.49509],[15.86085,23.40972],[14.8513,22.86295]]]}},{"type":"Feature","id":"LSO","properties":{"name":"Lesotho"},"geometry":{"type":"Polygon","coordinates":[[[28.978263,-28.955597],[29.325166,-29.257387],[29.018415,-29.743766],[28.8484,-30.070051],[28.291069,-30.226217],[28.107205,-30.545732],[27.749397,-30.645106],[26.999262,-29.875954],[27.532511,-29.242711],[28.074338,-28.851469],[28.5417,-28.647502],[28.978263,-28.955597]]]}},{"type":"Feature","id":"MAR","properties":{"name":"Morocco"},"geometry":{"type":"Polygon","coordinates":[[[-5.193863,35.755182],[-4.591006,35.330712],[-3.640057,35.399855],[-2.604306,35.179093],[-2.169914,35.168396],[-1.792986,34.527919],[-1.733455,33.919713],[-1.388049,32.864015],[-1.124551,32.651522],[-1.307899,32.262889],[-2.616605,32.094346],[-3.06898,31.724498],[-3.647498,31.637294],[-3.690441,30.896952],[-4.859646,30.501188],[-5.242129,30.000443],[-6.060632,29.7317],[-7.059228,29.579228],[-8.674116,28.841289],[-8.66559,27.656426],[-8.817809,27.656426],[-8.817828,27.656426],[-8.794884,27.120696],[-9.413037,27.088476],[-9.735343,26.860945],[-10.189424,26.860945],[-10.551263,26.990808],[-11.392555,26.883424],[-11.71822,26.104092],[-12.030759,26.030866],[-12.500963,24.770116],[-13.89111,23.691009],[-14.221168,22.310163],[-14.630833,21.86094],[-14.750955,21.5006],[-17.002962,21.420734],[-17.020428,21.42231],[-16.973248,21.885745],[-16.589137,22.158234],[-16.261922,22.67934],[-16.326414,23.017768],[-15.982611,23.723358],[-15.426004,24.359134],[-15.089332,24.520261],[-14.824645,25.103533],[-14.800926,25.636265],[-14.43994,26.254418],[-13.773805,26.618892],[-13.139942,27.640148],[-13.121613,27.654148],[-12.618837,28.038186],[-11.688919,28.148644],[-10.900957,28.832142],[-10.399592,29.098586],[-9.564811,29.933574],[-9.814718,31.177736],[-9.434793,32.038096],[-9.300693,32.564679],[-8.657476,33.240245],[-7.654178,33.697065],[-6.912544,34.110476],[-6.244342,35.145865],[-5.929994,35.759988],[-5.193863,35.755182]]]}},{"type":"Feature","id":"MDG","properties":{"name":"Madagascar"},"geometry":{"type":"Polygon","coordinates":[[[49.543519,-12.469833],[49.808981,-12.895285],[50.056511,-13.555761],[50.217431,-14.758789],[50.476537,-15.226512],[50.377111,-15.706069],[50.200275,-16.000263],[49.860606,-15.414253],[49.672607,-15.710204],[49.863344,-16.451037],[49.774564,-16.875042],[49.498612,-17.106036],[49.435619,-17.953064],[49.041792,-19.118781],[48.548541,-20.496888],[47.930749,-22.391501],[47.547723,-23.781959],[47.095761,-24.94163],[46.282478,-25.178463],[45.409508,-25.601434],[44.833574,-25.346101],[44.03972,-24.988345],[43.763768,-24.460677],[43.697778,-23.574116],[43.345654,-22.776904],[43.254187,-22.057413],[43.433298,-21.336475],[43.893683,-21.163307],[43.89637,-20.830459],[44.374325,-20.072366],[44.464397,-19.435454],[44.232422,-18.961995],[44.042976,-18.331387],[43.963084,-17.409945],[44.312469,-16.850496],[44.446517,-16.216219],[44.944937,-16.179374],[45.502732,-15.974373],[45.872994,-15.793454],[46.312243,-15.780018],[46.882183,-15.210182],[47.70513,-14.594303],[48.005215,-14.091233],[47.869047,-13.663869],[48.293828,-13.784068],[48.84506,-13.089175],[48.863509,-12.487868],[49.194651,-12.040557],[49.543519,-12.469833]]]}},{"type":"Feature","id":"MLI","properties":{"name":"Mali"},"geometry":{"type":"Polygon","coordinates":[[[-12.17075,14.616834],[-11.834208,14.799097],[-11.666078,15.388208],[-11.349095,15.411256],[-10.650791,15.132746],[-10.086846,15.330486],[-9.700255,15.264107],[-9.550238,15.486497],[-5.537744,15.50169],[-5.315277,16.201854],[-5.488523,16.325102],[-5.971129,20.640833],[-6.453787,24.956591],[-4.923337,24.974574],[-1.550055,22.792666],[1.823228,20.610809],[2.060991,20.142233],[2.683588,19.85623],[3.146661,19.693579],[3.158133,19.057364],[4.267419,19.155265],[4.27021,16.852227],[3.723422,16.184284],[3.638259,15.56812],[2.749993,15.409525],[1.385528,15.323561],[1.015783,14.968182],[0.374892,14.928908],[-0.266257,14.924309],[-0.515854,15.116158],[-1.066363,14.973815],[-2.001035,14.559008],[-2.191825,14.246418],[-2.967694,13.79815],[-3.103707,13.541267],[-3.522803,13.337662],[-4.006391,13.472485],[-4.280405,13.228444],[-4.427166,12.542646],[-5.220942,11.713859],[-5.197843,11.375146],[-5.470565,10.95127],[-5.404342,10.370737],[-5.816926,10.222555],[-6.050452,10.096361],[-6.205223,10.524061],[-6.493965,10.411303],[-6.666461,10.430811],[-6.850507,10.138994],[-7.622759,10.147236],[-7.89959,10.297382],[-8.029944,10.206535],[-8.335377,10.494812],[-8.282357,10.792597],[-8.407311,10.909257],[-8.620321,10.810891],[-8.581305,11.136246],[-8.376305,11.393646],[-8.786099,11.812561],[-8.905265,12.088358],[-9.127474,12.30806],[-9.327616,12.334286],[-9.567912,12.194243],[-9.890993,12.060479],[-10.165214,11.844084],[-10.593224,11.923975],[-10.87083,12.177887],[-11.036556,12.211245],[-11.297574,12.077971],[-11.456169,12.076834],[-11.513943,12.442988],[-11.467899,12.754519],[-11.553398,13.141214],[-11.927716,13.422075],[-12.124887,13.994727],[-12.17075,14.616834]]]}},{"type":"Feature","id":"MOZ","properties":{"name":"Mozambique"},"geometry":{"type":"Polygon","coordinates":[[[34.559989,-11.52002],[35.312398,-11.439146],[36.514082,-11.720938],[36.775151,-11.594537],[37.471284,-11.568751],[37.827645,-11.268769],[38.427557,-11.285202],[39.52103,-10.896854],[40.316589,-10.317096],[40.478387,-10.765441],[40.437253,-11.761711],[40.560811,-12.639177],[40.59962,-14.201975],[40.775475,-14.691764],[40.477251,-15.406294],[40.089264,-16.100774],[39.452559,-16.720891],[38.538351,-17.101023],[37.411133,-17.586368],[36.281279,-18.659688],[35.896497,-18.84226],[35.1984,-19.552811],[34.786383,-19.784012],[34.701893,-20.497043],[35.176127,-21.254361],[35.373428,-21.840837],[35.385848,-22.14],[35.562546,-22.09],[35.533935,-23.070788],[35.371774,-23.535359],[35.60747,-23.706563],[35.458746,-24.12261],[35.040735,-24.478351],[34.215824,-24.816314],[33.01321,-25.357573],[32.574632,-25.727318],[32.660363,-26.148584],[32.915955,-26.215867],[32.83012,-26.742192],[32.071665,-26.73382],[31.985779,-26.29178],[31.837778,-25.843332],[31.752408,-25.484284],[31.930589,-24.369417],[31.670398,-23.658969],[31.191409,-22.25151],[32.244988,-21.116489],[32.508693,-20.395292],[32.659743,-20.30429],[32.772708,-19.715592],[32.611994,-19.419383],[32.654886,-18.67209],[32.849861,-17.979057],[32.847639,-16.713398],[32.328239,-16.392074],[31.852041,-16.319417],[31.636498,-16.07199],[31.173064,-15.860944],[30.338955,-15.880839],[30.274256,-15.507787],[30.179481,-14.796099],[33.214025,-13.97186],[33.7897,-14.451831],[34.064825,-14.35995],[34.459633,-14.61301],[34.517666,-15.013709],[34.307291,-15.478641],[34.381292,-16.18356],[35.03381,-16.8013],[35.339063,-16.10744],[35.771905,-15.896859],[35.686845,-14.611046],[35.267956,-13.887834],[34.907151,-13.565425],[34.559989,-13.579998],[34.280006,-12.280025],[34.559989,-11.52002]]]}},{"type":"Feature","id":"MRT","properties":{"name":"Mauritania"},"geometry":{"type":"Polygon","coordinates":[[[-12.17075,14.616834],[-12.830658,15.303692],[-13.435738,16.039383],[-14.099521,16.304302],[-14.577348,16.598264],[-15.135737,16.587282],[-15.623666,16.369337],[-16.12069,16.455663],[-16.463098,16.135036],[-16.549708,16.673892],[-16.270552,17.166963],[-16.146347,18.108482],[-16.256883,19.096716],[-16.377651,19.593817],[-16.277838,20.092521],[-16.536324,20.567866],[-17.063423,20.999752],[-16.845194,21.333323],[-12.929102,21.327071],[-13.118754,22.77122],[-12.874222,23.284832],[-11.937224,23.374594],[-11.969419,25.933353],[-8.687294,25.881056],[-8.6844,27.395744],[-4.923337,24.974574],[-6.453787,24.956591],[-5.971129,20.640833],[-5.488523,16.325102],[-5.315277,16.201854],[-5.537744,15.50169],[-9.550238,15.486497],[-9.700255,15.264107],[-10.086846,15.330486],[-10.650791,15.132746],[-11.349095,15.411256],[-11.666078,15.388208],[-11.834208,14.799097],[-12.17075,14.616834]]]}},{"type":"Feature","id":"MWI","properties":{"name":"Malawi"},"geometry":{"type":"Polygon","coordinates":[[[34.559989,-11.52002],[34.280006,-12.280025],[34.559989,-13.579998],[34.907151,-13.565425],[35.267956,-13.887834],[35.686845,-14.611046],[35.771905,-15.896859],[35.339063,-16.10744],[35.03381,-16.8013],[34.381292,-16.18356],[34.307291,-15.478641],[34.517666,-15.013709],[34.459633,-14.61301],[34.064825,-14.35995],[33.7897,-14.451831],[33.214025,-13.97186],[32.688165,-13.712858],[32.991764,-12.783871],[33.306422,-12.435778],[33.114289,-11.607198],[33.31531,-10.79655],[33.485688,-10.525559],[33.231388,-9.676722],[32.759375,-9.230599],[33.739729,-9.417151],[33.940838,-9.693674],[34.280006,-10.16],[34.559989,-11.52002]]]}},{"type":"Feature","id":"NAM","properties":{"name":"Namibia"},"geometry":{"type":"Polygon","coordinates":[[[16.344977,-28.576705],[15.601818,-27.821247],[15.210472,-27.090956],[14.989711,-26.117372],[14.743214,-25.39292],[14.408144,-23.853014],[14.385717,-22.656653],[14.257714,-22.111208],[13.868642,-21.699037],[13.352498,-20.872834],[12.826845,-19.673166],[12.608564,-19.045349],[11.794919,-18.069129],[11.734199,-17.301889],[12.215461,-17.111668],[12.814081,-16.941343],[13.462362,-16.971212],[14.058501,-17.423381],[14.209707,-17.353101],[18.263309,-17.309951],[18.956187,-17.789095],[21.377176,-17.930636],[23.215048,-17.523116],[24.033862,-17.295843],[24.682349,-17.353411],[25.07695,-17.578823],[25.084443,-17.661816],[24.520705,-17.887125],[24.217365,-17.889347],[23.579006,-18.281261],[23.196858,-17.869038],[21.65504,-18.219146],[20.910641,-18.252219],[20.881134,-21.814327],[19.895458,-21.849157],[19.895768,-24.76779],[19.894734,-28.461105],[19.002127,-28.972443],[18.464899,-29.045462],[17.836152,-28.856378],[17.387497,-28.783514],[17.218929,-28.355943],[16.824017,-28.082162],[16.344977,-28.576705]]]}},{"type":"Feature","id":"NER","properties":{"name":"Niger"},"geometry":{"type":"Polygon","coordinates":[[[2.154474,11.94015],[2.177108,12.625018],[1.024103,12.851826],[0.993046,13.33575],[0.429928,13.988733],[0.295646,14.444235],[0.374892,14.928908],[1.015783,14.968182],[1.385528,15.323561],[2.749993,15.409525],[3.638259,15.56812],[3.723422,16.184284],[4.27021,16.852227],[4.267419,19.155265],[5.677566,19.601207],[8.572893,21.565661],[11.999506,23.471668],[13.581425,23.040506],[14.143871,22.491289],[14.8513,22.86295],[15.096888,21.308519],[15.471077,21.048457],[15.487148,20.730415],[15.903247,20.387619],[15.685741,19.95718],[15.300441,17.92795],[15.247731,16.627306],[13.972202,15.684366],[13.540394,14.367134],[13.956699,13.996691],[13.954477,13.353449],[14.595781,13.330427],[14.495787,12.859396],[14.213531,12.802035],[14.181336,12.483657],[13.995353,12.461565],[13.318702,13.556356],[13.083987,13.596147],[12.302071,13.037189],[11.527803,13.32898],[10.989593,13.387323],[10.701032,13.246918],[10.114814,13.277252],[9.524928,12.851102],[9.014933,12.826659],[7.804671,13.343527],[7.330747,13.098038],[6.820442,13.115091],[6.445426,13.492768],[5.443058,13.865924],[4.368344,13.747482],[4.107946,13.531216],[3.967283,12.956109],[3.680634,12.552903],[3.61118,11.660167],[2.848643,12.235636],[2.490164,12.233052],[2.154474,11.94015]]]}},{"type":"Feature","id":"NGA","properties":{"name":"Nigeria"},"geometry":{"type":"Polygon","coordinates":[[[8.500288,4.771983],[7.462108,4.412108],[7.082596,4.464689],[6.698072,4.240594],[5.898173,4.262453],[5.362805,4.887971],[5.033574,5.611802],[4.325607,6.270651],[3.57418,6.2583],[2.691702,6.258817],[2.749063,7.870734],[2.723793,8.506845],[2.912308,9.137608],[3.220352,9.444153],[3.705438,10.06321],[3.60007,10.332186],[3.797112,10.734746],[3.572216,11.327939],[3.61118,11.660167],[3.680634,12.552903],[3.967283,12.956109],[4.107946,13.531216],[4.368344,13.747482],[5.443058,13.865924],[6.445426,13.492768],[6.820442,13.115091],[7.330747,13.098038],[7.804671,13.343527],[9.014933,12.826659],[9.524928,12.851102],[10.114814,13.277252],[10.701032,13.246918],[10.989593,13.387323],[11.527803,13.32898],[12.302071,13.037189],[13.083987,13.596147],[13.318702,13.556356],[13.995353,12.461565],[14.181336,12.483657],[14.577178,12.085361],[14.468192,11.904752],[14.415379,11.572369],[13.57295,10.798566],[13.308676,10.160362],[13.1676,9.640626],[12.955468,9.417772],[12.753672,8.717763],[12.218872,8.305824],[12.063946,7.799808],[11.839309,7.397042],[11.745774,6.981383],[11.058788,6.644427],[10.497375,7.055358],[10.118277,7.03877],[9.522706,6.453482],[9.233163,6.444491],[8.757533,5.479666],[8.500288,4.771983]]]}},{"type":"Feature","id":"RWA","properties":{"name":"Rwanda"},"geometry":{"type":"Polygon","coordinates":[[[30.419105,-1.134659],[30.816135,-1.698914],[30.758309,-2.28725],[30.469696,-2.413858],[29.938359,-2.348487],[29.632176,-2.917858],[29.024926,-2.839258],[29.117479,-2.292211],[29.254835,-2.21511],[29.291887,-1.620056],[29.579466,-1.341313],[29.821519,-1.443322],[30.419105,-1.134659]]]}},{"type":"Feature","id":"ESH","properties":{"name":"Western Sahara"},"geometry":{"type":"Polygon","coordinates":[[[-8.794884,27.120696],[-8.817828,27.656426],[-8.66559,27.656426],[-8.665124,27.589479],[-8.6844,27.395744],[-8.687294,25.881056],[-11.969419,25.933353],[-11.937224,23.374594],[-12.874222,23.284832],[-13.118754,22.77122],[-12.929102,21.327071],[-16.845194,21.333323],[-17.063423,20.999752],[-17.020428,21.42231],[-17.002962,21.420734],[-14.750955,21.5006],[-14.630833,21.86094],[-14.221168,22.310163],[-13.89111,23.691009],[-12.500963,24.770116],[-12.030759,26.030866],[-11.71822,26.104092],[-11.392555,26.883424],[-10.551263,26.990808],[-10.189424,26.860945],[-9.735343,26.860945],[-9.413037,27.088476],[-8.794884,27.120696]]]}},{"type":"Feature","id":"SDN","properties":{"name":"Sudan"},"geometry":{"type":"Polygon","coordinates":[[[33.963393,9.464285],[33.824963,9.484061],[33.842131,9.981915],[33.721959,10.325262],[33.206938,10.720112],[33.086766,11.441141],[33.206938,12.179338],[32.743419,12.248008],[32.67475,12.024832],[32.073892,11.97333],[32.314235,11.681484],[32.400072,11.080626],[31.850716,10.531271],[31.352862,9.810241],[30.837841,9.707237],[29.996639,10.290927],[29.618957,10.084919],[29.515953,9.793074],[29.000932,9.604232],[28.966597,9.398224],[27.97089,9.398224],[27.833551,9.604232],[27.112521,9.638567],[26.752006,9.466893],[26.477328,9.55273],[25.962307,10.136421],[25.790633,10.411099],[25.069604,10.27376],[24.794926,9.810241],[24.537415,8.917538],[24.194068,8.728696],[23.88698,8.61973],[23.805813,8.666319],[23.459013,8.954286],[23.394779,9.265068],[23.55725,9.681218],[23.554304,10.089255],[22.977544,10.714463],[22.864165,11.142395],[22.87622,11.38461],[22.50869,11.67936],[22.49762,12.26024],[22.28801,12.64605],[21.93681,12.58818],[22.03759,12.95546],[22.29658,13.37232],[22.18329,13.78648],[22.51202,14.09318],[22.30351,14.32682],[22.56795,14.94429],[23.02459,15.68072],[23.88689,15.61084],[23.83766,19.58047],[23.85,20],[25,20.00304],[25,22],[29.02,22],[32.9,22],[36.86623,22],[37.18872,21.01885],[36.96941,20.83744],[37.1147,19.80796],[37.48179,18.61409],[37.86276,18.36786],[38.41009,17.998307],[37.904,17.42754],[37.16747,17.26314],[36.85253,16.95655],[36.75389,16.29186],[36.32322,14.82249],[36.42951,14.42211],[36.27022,13.56333],[35.86363,12.57828],[35.26049,12.08286],[34.83163,11.31896],[34.73115,10.91017],[34.25745,10.63009],[33.96162,9.58358],[33.963393,9.464285]]]}},{"type":"Feature","id":"SSD","properties":{"name":"South Sudan"},"geometry":{"type":"Polygon","coordinates":[[[33.963393,9.464285],[33.97498,8.68456],[33.8255,8.37916],[33.2948,8.35458],[32.95418,7.78497],[33.56829,7.71334],[34.0751,7.22595],[34.25032,6.82607],[34.70702,6.59422],[35.298007,5.506],[34.620196,4.847123],[34.005,4.249885],[33.39,3.79],[32.68642,3.79232],[31.88145,3.55827],[31.24556,3.7819],[30.83385,3.50917],[29.95349,4.1737],[29.715995,4.600805],[29.159078,4.389267],[28.696678,4.455077],[28.428994,4.287155],[27.979977,4.408413],[27.374226,5.233944],[27.213409,5.550953],[26.465909,5.946717],[26.213418,6.546603],[25.796648,6.979316],[25.124131,7.500085],[25.114932,7.825104],[24.567369,8.229188],[23.88698,8.61973],[24.194068,8.728696],[24.537415,8.917538],[24.794926,9.810241],[25.069604,10.27376],[25.790633,10.411099],[25.962307,10.136421],[26.477328,9.55273],[26.752006,9.466893],[27.112521,9.638567],[27.833551,9.604232],[27.97089,9.398224],[28.966597,9.398224],[29.000932,9.604232],[29.515953,9.793074],[29.618957,10.084919],[29.996639,10.290927],[30.837841,9.707237],[31.352862,9.810241],[31.850716,10.531271],[32.400072,11.080626],[32.314235,11.681484],[32.073892,11.97333],[32.67475,12.024832],[32.743419,12.248008],[33.206938,12.179338],[33.086766,11.441141],[33.206938,10.720112],[33.721959,10.325262],[33.842131,9.981915],[33.824963,9.484061],[33.963393,9.464285]]]}},{"type":"Feature","id":"SEN","properties":{"name":"Senegal"},"geometry":{"type":"Polygon","coordinates":[[[-16.713729,13.594959],[-17.126107,14.373516],[-17.625043,14.729541],[-17.185173,14.919477],[-16.700706,15.621527],[-16.463098,16.135036],[-16.12069,16.455663],[-15.623666,16.369337],[-15.135737,16.587282],[-14.577348,16.598264],[-14.099521,16.304302],[-13.435738,16.039383],[-12.830658,15.303692],[-12.17075,14.616834],[-12.124887,13.994727],[-11.927716,13.422075],[-11.553398,13.141214],[-11.467899,12.754519],[-11.513943,12.442988],[-11.658301,12.386583],[-12.203565,12.465648],[-12.278599,12.35444],[-12.499051,12.33209],[-13.217818,12.575874],[-13.700476,12.586183],[-15.548477,12.62817],[-15.816574,12.515567],[-16.147717,12.547762],[-16.677452,12.384852],[-16.841525,13.151394],[-15.931296,13.130284],[-15.691001,13.270353],[-15.511813,13.27857],[-15.141163,13.509512],[-14.712197,13.298207],[-14.277702,13.280585],[-13.844963,13.505042],[-14.046992,13.794068],[-14.376714,13.62568],[-14.687031,13.630357],[-15.081735,13.876492],[-15.39877,13.860369],[-15.624596,13.623587],[-16.713729,13.594959]]]}},{"type":"Feature","id":"SLE","properties":{"name":"Sierra Leone"},"geometry":{"type":"Polygon","coordinates":[[[-11.438779,6.785917],[-11.708195,6.860098],[-12.428099,7.262942],[-12.949049,7.798646],[-13.124025,8.163946],[-13.24655,8.903049],[-12.711958,9.342712],[-12.596719,9.620188],[-12.425929,9.835834],[-12.150338,9.858572],[-11.917277,10.046984],[-11.117481,10.045873],[-10.839152,9.688246],[-10.622395,9.26791],[-10.65477,8.977178],[-10.494315,8.715541],[-10.505477,8.348896],[-10.230094,8.406206],[-10.695595,7.939464],[-11.146704,7.396706],[-11.199802,7.105846],[-11.438779,6.785917]]]}},{"type":"Feature","id":"-99","properties":{"name":"Somaliland"},"geometry":{"type":"Polygon","coordinates":[[[48.93813,9.451749],[48.486736,8.837626],[47.78942,8.003],[46.948328,7.996877],[43.67875,9.18358],[43.296975,9.540477],[42.92812,10.02194],[42.55876,10.57258],[42.776852,10.926879],[43.145305,11.46204],[43.47066,11.27771],[43.666668,10.864169],[44.117804,10.445538],[44.614259,10.442205],[45.556941,10.698029],[46.645401,10.816549],[47.525658,11.127228],[48.021596,11.193064],[48.378784,11.375482],[48.948206,11.410622],[48.942005,11.394266],[48.938491,10.982327],[48.938233,9.9735],[48.93813,9.451749]]]}},{"type":"Feature","id":"SOM","properties":{"name":"Somalia"},"geometry":{"type":"Polygon","coordinates":[[[49.72862,11.5789],[50.25878,11.67957],[50.73202,12.0219],[51.1112,12.02464],[51.13387,11.74815],[51.04153,11.16651],[51.04531,10.6409],[50.83418,10.27972],[50.55239,9.19874],[50.07092,8.08173],[49.4527,6.80466],[48.59455,5.33911],[47.74079,4.2194],[46.56476,2.85529],[45.56399,2.04576],[44.06815,1.05283],[43.13597,0.2922],[42.04157,-0.91916],[41.81095,-1.44647],[41.58513,-1.68325],[40.993,-0.85829],[40.98105,2.78452],[41.855083,3.918912],[42.12861,4.23413],[42.76967,4.25259],[43.66087,4.95755],[44.9636,5.00162],[47.78942,8.003],[48.486736,8.837626],[48.93813,9.451749],[48.938233,9.9735],[48.938491,10.982327],[48.942005,11.394266],[48.948205,11.410617],[49.26776,11.43033],[49.72862,11.5789]]]}},{"type":"Feature","id":"SWZ","properties":{"name":"Swaziland"},"geometry":{"type":"Polygon","coordinates":[[[32.071665,-26.73382],[31.86806,-27.177927],[31.282773,-27.285879],[30.685962,-26.743845],[30.676609,-26.398078],[30.949667,-26.022649],[31.04408,-25.731452],[31.333158,-25.660191],[31.837778,-25.843332],[31.985779,-26.29178],[32.071665,-26.73382]]]}},{"type":"Feature","id":"TCD","properties":{"name":"Chad"},"geometry":{"type":"Polygon","coordinates":[[[14.495787,12.859396],[14.595781,13.330427],[13.954477,13.353449],[13.956699,13.996691],[13.540394,14.367134],[13.97217,15.68437],[15.247731,16.627306],[15.300441,17.92795],[15.685741,19.95718],[15.903247,20.387619],[15.487148,20.730415],[15.47106,21.04845],[15.096888,21.308519],[14.8513,22.86295],[15.86085,23.40972],[19.84926,21.49509],[23.83766,19.58047],[23.88689,15.61084],[23.02459,15.68072],[22.56795,14.94429],[22.30351,14.32682],[22.51202,14.09318],[22.18329,13.78648],[22.29658,13.37232],[22.03759,12.95546],[21.93681,12.58818],[22.28801,12.64605],[22.49762,12.26024],[22.50869,11.67936],[22.87622,11.38461],[22.864165,11.142395],[22.231129,10.971889],[21.723822,10.567056],[21.000868,9.475985],[20.059685,9.012706],[19.094008,9.074847],[18.81201,8.982915],[18.911022,8.630895],[18.389555,8.281304],[17.96493,7.890914],[16.705988,7.508328],[16.456185,7.734774],[16.290562,7.754307],[16.106232,7.497088],[15.27946,7.421925],[15.436092,7.692812],[15.120866,8.38215],[14.979996,8.796104],[14.544467,8.965861],[13.954218,9.549495],[14.171466,10.021378],[14.627201,9.920919],[14.909354,9.992129],[15.467873,9.982337],[14.923565,10.891325],[14.960152,11.555574],[14.89336,12.21905],[14.495787,12.859396]]]}},{"type":"Feature","id":"TGO","properties":{"name":"Togo"},"geometry":{"type":"Polygon","coordinates":[[[1.865241,6.142158],[1.060122,5.928837],[0.836931,6.279979],[0.570384,6.914359],[0.490957,7.411744],[0.712029,8.312465],[0.461192,8.677223],[0.365901,9.465004],[0.36758,10.191213],[-0.049785,10.706918],[0.023803,11.018682],[0.899563,10.997339],[0.772336,10.470808],[1.077795,10.175607],[1.425061,9.825395],[1.463043,9.334624],[1.664478,9.12859],[1.618951,6.832038],[1.865241,6.142158]]]}},{"type":"Feature","id":"TUN","properties":{"name":"Tunisia"},"geometry":{"type":"Polygon","coordinates":[[[9.48214,30.307556],[9.055603,32.102692],[8.439103,32.506285],[8.430473,32.748337],[7.612642,33.344115],[7.524482,34.097376],[8.140981,34.655146],[8.376368,35.479876],[8.217824,36.433177],[8.420964,36.946427],[9.509994,37.349994],[10.210002,37.230002],[10.18065,36.724038],[11.028867,37.092103],[11.100026,36.899996],[10.600005,36.41],[10.593287,35.947444],[10.939519,35.698984],[10.807847,34.833507],[10.149593,34.330773],[10.339659,33.785742],[10.856836,33.76874],[11.108501,33.293343],[11.488787,33.136996],[11.432253,32.368903],[10.94479,32.081815],[10.636901,31.761421],[9.950225,31.37607],[10.056575,30.961831],[9.970017,30.539325],[9.48214,30.307556]]]}},{"type":"Feature","id":"TZA","properties":{"name":"United Republic of Tanzania"},"geometry":{"type":"Polygon","coordinates":[[[33.903711,-0.95],[34.07262,-1.05982],[37.69869,-3.09699],[37.7669,-3.67712],[39.20222,-4.67677],[38.74054,-5.90895],[38.79977,-6.47566],[39.44,-6.84],[39.47,-7.1],[39.19469,-7.7039],[39.25203,-8.00781],[39.18652,-8.48551],[39.53574,-9.11237],[39.9496,-10.0984],[40.31659,-10.3171],[39.521,-10.89688],[38.427557,-11.285202],[37.82764,-11.26879],[37.47129,-11.56876],[36.775151,-11.594537],[36.514082,-11.720938],[35.312398,-11.439146],[34.559989,-11.52002],[34.28,-10.16],[33.940838,-9.693674],[33.73972,-9.41715],[32.759375,-9.230599],[32.191865,-8.930359],[31.556348,-8.762049],[31.157751,-8.594579],[30.74,-8.34],[30.2,-7.08],[29.62,-6.52],[29.419993,-5.939999],[29.519987,-5.419979],[29.339998,-4.499983],[29.753512,-4.452389],[30.11632,-4.09012],[30.50554,-3.56858],[30.75224,-3.35931],[30.74301,-3.03431],[30.52766,-2.80762],[30.46967,-2.41383],[30.758309,-2.28725],[30.816135,-1.698914],[30.419105,-1.134659],[30.76986,-1.01455],[31.86617,-1.02736],[33.903711,-0.95]]]}},{"type":"Feature","id":"UGA","properties":{"name":"Uganda"},"geometry":{"type":"Polygon","coordinates":[[[31.86617,-1.02736],[30.76986,-1.01455],[30.419105,-1.134659],[29.821519,-1.443322],[29.579466,-1.341313],[29.587838,-0.587406],[29.8195,-0.2053],[29.875779,0.59738],[30.086154,1.062313],[30.468508,1.583805],[30.85267,1.849396],[31.174149,2.204465],[30.77332,2.33989],[30.83385,3.50917],[31.24556,3.7819],[31.88145,3.55827],[32.68642,3.79232],[33.39,3.79],[34.005,4.249885],[34.47913,3.5556],[34.59607,3.05374],[35.03599,1.90584],[34.6721,1.17694],[34.18,0.515],[33.893569,0.109814],[33.903711,-0.95],[31.86617,-1.02736]]]}},{"type":"Feature","id":"ZAF","properties":{"name":"South Africa"},"geometry":{"type":"Polygon","coordinates":[[[31.521001,-29.257387],[31.325561,-29.401978],[30.901763,-29.909957],[30.622813,-30.423776],[30.055716,-31.140269],[28.925553,-32.172041],[28.219756,-32.771953],[27.464608,-33.226964],[26.419452,-33.61495],[25.909664,-33.66704],[25.780628,-33.944646],[25.172862,-33.796851],[24.677853,-33.987176],[23.594043,-33.794474],[22.988189,-33.916431],[22.574157,-33.864083],[21.542799,-34.258839],[20.689053,-34.417175],[20.071261,-34.795137],[19.616405,-34.819166],[19.193278,-34.462599],[18.855315,-34.444306],[18.424643,-33.997873],[18.377411,-34.136521],[18.244499,-33.867752],[18.25008,-33.281431],[17.92519,-32.611291],[18.24791,-32.429131],[18.221762,-31.661633],[17.566918,-30.725721],[17.064416,-29.878641],[17.062918,-29.875954],[16.344977,-28.576705],[16.824017,-28.082162],[17.218929,-28.355943],[17.387497,-28.783514],[17.836152,-28.856378],[18.464899,-29.045462],[19.002127,-28.972443],[19.894734,-28.461105],[19.895768,-24.76779],[20.165726,-24.917962],[20.758609,-25.868136],[20.66647,-26.477453],[20.889609,-26.828543],[21.605896,-26.726534],[22.105969,-26.280256],[22.579532,-25.979448],[22.824271,-25.500459],[23.312097,-25.26869],[23.73357,-25.390129],[24.211267,-25.670216],[25.025171,-25.71967],[25.664666,-25.486816],[25.765849,-25.174845],[25.941652,-24.696373],[26.485753,-24.616327],[26.786407,-24.240691],[27.11941,-23.574323],[28.017236,-22.827754],[29.432188,-22.091313],[29.839037,-22.102216],[30.322883,-22.271612],[30.659865,-22.151567],[31.191409,-22.25151],[31.670398,-23.658969],[31.930589,-24.369417],[31.752408,-25.484284],[31.837778,-25.843332],[31.333158,-25.660191],[31.04408,-25.731452],[30.949667,-26.022649],[30.676609,-26.398078],[30.685962,-26.743845],[31.282773,-27.285879],[31.86806,-27.177927],[32.071665,-26.73382],[32.83012,-26.742192],[32.580265,-27.470158],[32.462133,-28.301011],[32.203389,-28.752405],[31.521001,-29.257387]],[[28.978263,-28.955597],[28.5417,-28.647502],[28.074338,-28.851469],[27.532511,-29.242711],[26.999262,-29.875954],[27.749397,-30.645106],[28.107205,-30.545732],[28.291069,-30.226217],[28.8484,-30.070051],[29.018415,-29.743766],[29.325166,-29.257387],[28.978263,-28.955597]]]}},{"type":"Feature","id":"ZMB","properties":{"name":"Zambia"},"geometry":{"type":"Polygon","coordinates":[[[32.759375,-9.230599],[33.231388,-9.676722],[33.485688,-10.525559],[33.31531,-10.79655],[33.114289,-11.607198],[33.306422,-12.435778],[32.991764,-12.783871],[32.688165,-13.712858],[33.214025,-13.97186],[30.179481,-14.796099],[30.274256,-15.507787],[29.516834,-15.644678],[28.947463,-16.043051],[28.825869,-16.389749],[28.467906,-16.4684],[27.598243,-17.290831],[27.044427,-17.938026],[26.706773,-17.961229],[26.381935,-17.846042],[25.264226,-17.73654],[25.084443,-17.661816],[25.07695,-17.578823],[24.682349,-17.353411],[24.033862,-17.295843],[23.215048,-17.523116],[22.562478,-16.898451],[21.887843,-16.08031],[21.933886,-12.898437],[24.016137,-12.911046],[23.930922,-12.565848],[24.079905,-12.191297],[23.904154,-11.722282],[24.017894,-11.237298],[23.912215,-10.926826],[24.257155,-10.951993],[24.314516,-11.262826],[24.78317,-11.238694],[25.418118,-11.330936],[25.75231,-11.784965],[26.553088,-11.92444],[27.16442,-11.608748],[27.388799,-12.132747],[28.155109,-12.272481],[28.523562,-12.698604],[28.934286,-13.248958],[29.699614,-13.257227],[29.616001,-12.178895],[29.341548,-12.360744],[28.642417,-11.971569],[28.372253,-11.793647],[28.49607,-10.789884],[28.673682,-9.605925],[28.449871,-9.164918],[28.734867,-8.526559],[29.002912,-8.407032],[30.346086,-8.238257],[30.740015,-8.340007],[31.157751,-8.594579],[31.556348,-8.762049],[32.191865,-8.930359],[32.759375,-9.230599]]]}},{"type":"Feature","id":"ZWE","properties":{"name":"Zimbabwe"},"geometry":{"type":"Polygon","coordinates":[[[31.191409,-22.25151],[30.659865,-22.151567],[30.322883,-22.271612],[29.839037,-22.102216],[29.432188,-22.091313],[28.794656,-21.639454],[28.02137,-21.485975],[27.727228,-20.851802],[27.724747,-20.499059],[27.296505,-20.39152],[26.164791,-19.293086],[25.850391,-18.714413],[25.649163,-18.536026],[25.264226,-17.73654],[26.381935,-17.846042],[26.706773,-17.961229],[27.044427,-17.938026],[27.598243,-17.290831],[28.467906,-16.4684],[28.825869,-16.389749],[28.947463,-16.043051],[29.516834,-15.644678],[30.274256,-15.507787],[30.338955,-15.880839],[31.173064,-15.860944],[31.636498,-16.07199],[31.852041,-16.319417],[32.328239,-16.392074],[32.847639,-16.713398],[32.849861,-17.979057],[32.654886,-18.67209],[32.611994,-19.419383],[32.772708,-19.715592],[32.659743,-20.30429],[32.508693,-20.395292],[32.244988,-21.116489],[31.191409,-22.25151]]]}}]}
\ No newline at end of file
diff --git a/dkan/docs/components/visualizations/visualization_entity/geojson.rst b/dkan/docs/components/visualizations/visualization_entity/geojson.rst
new file mode 100644
index 000000000..9991e89fd
--- /dev/null
+++ b/dkan/docs/components/visualizations/visualization_entity/geojson.rst
@@ -0,0 +1,36 @@
+GeoJSON
+=======
+.. warning::
+
+ Under Development. Do not use on production.
+
+Enable the geojson bundle:
+
+.. code-block:: php
+
+ $ drush -y visualization_entity_geojson_bundle
+ $ drush cc all
+
+
+Create Visualization
+--------------------
++ Look for **Content -> Add Content -> Resource** in the admin menu and click on it.
+
++ Upload a geojson data file for the resource
+
+.. image:: images/geojson-step-01.png
+
++ Fill the required fields, enter 'geojson' in the format field, and **save** the resource
+
+.. image:: images/geojson-step-03.png
+
++ Look for **Structure -> Entity Types -> Visualization -> Geojson Visualization -> Add Geojson Visualization** in the admin menu and click on it.
+
++ Set a **title**
++ Select the **resource** containing the **geojson** data file you uploaded
+
+.. image:: images/geojson-step-04.png
+
++ Click **Save** & Enjoy!
+
+.. image:: images/geojson-step-05.png
diff --git a/dkan/docs/components/visualizations/visualization_entity/images/chart-filter-editor.png b/dkan/docs/components/visualizations/visualization_entity/images/chart-filter-editor.png
new file mode 100644
index 000000000..62fc7002c
Binary files /dev/null and b/dkan/docs/components/visualizations/visualization_entity/images/chart-filter-editor.png differ
diff --git a/dkan/docs/components/visualizations/visualization_entity/images/chart-query-editor.png b/dkan/docs/components/visualizations/visualization_entity/images/chart-query-editor.png
new file mode 100644
index 000000000..51bdffba8
Binary files /dev/null and b/dkan/docs/components/visualizations/visualization_entity/images/chart-query-editor.png differ
diff --git a/dkan/docs/components/visualizations/visualization_entity/images/chart-step-1.png b/dkan/docs/components/visualizations/visualization_entity/images/chart-step-1.png
new file mode 100644
index 000000000..07811b105
Binary files /dev/null and b/dkan/docs/components/visualizations/visualization_entity/images/chart-step-1.png differ
diff --git a/dkan/docs/components/visualizations/visualization_entity/images/chart-step-2.png b/dkan/docs/components/visualizations/visualization_entity/images/chart-step-2.png
new file mode 100644
index 000000000..425a75e14
Binary files /dev/null and b/dkan/docs/components/visualizations/visualization_entity/images/chart-step-2.png differ
diff --git a/dkan/docs/components/visualizations/visualization_entity/images/chart-step-3.png b/dkan/docs/components/visualizations/visualization_entity/images/chart-step-3.png
new file mode 100644
index 000000000..a226c32b4
Binary files /dev/null and b/dkan/docs/components/visualizations/visualization_entity/images/chart-step-3.png differ
diff --git a/dkan/docs/components/visualizations/visualization_entity/images/chart-step-4.png b/dkan/docs/components/visualizations/visualization_entity/images/chart-step-4.png
new file mode 100644
index 000000000..942964b0d
Binary files /dev/null and b/dkan/docs/components/visualizations/visualization_entity/images/chart-step-4.png differ
diff --git a/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-00.png b/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-00.png
new file mode 100644
index 000000000..64cbd60f3
Binary files /dev/null and b/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-00.png differ
diff --git a/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-01.png b/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-01.png
new file mode 100644
index 000000000..fb91f5dc0
Binary files /dev/null and b/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-01.png differ
diff --git a/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-02.png b/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-02.png
new file mode 100644
index 000000000..2e07dd704
Binary files /dev/null and b/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-02.png differ
diff --git a/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-03.png b/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-03.png
new file mode 100644
index 000000000..8e25b20e6
Binary files /dev/null and b/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-03.png differ
diff --git a/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-04.png b/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-04.png
new file mode 100644
index 000000000..2eb4bb25c
Binary files /dev/null and b/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-04.png differ
diff --git a/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-05.png b/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-05.png
new file mode 100644
index 000000000..306d99181
Binary files /dev/null and b/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-05.png differ
diff --git a/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-06.png b/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-06.png
new file mode 100644
index 000000000..c09dc87a0
Binary files /dev/null and b/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-06.png differ
diff --git a/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-07.png b/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-07.png
new file mode 100644
index 000000000..afd6a50cc
Binary files /dev/null and b/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-07.png differ
diff --git a/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-08.png b/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-08.png
new file mode 100644
index 000000000..077ea6e08
Binary files /dev/null and b/dkan/docs/components/visualizations/visualization_entity/images/choropleth-step-08.png differ
diff --git a/dkan/docs/components/visualizations/visualization_entity/images/choropleth.png b/dkan/docs/components/visualizations/visualization_entity/images/choropleth.png
new file mode 100644
index 000000000..e93aa81c9
Binary files /dev/null and b/dkan/docs/components/visualizations/visualization_entity/images/choropleth.png differ
diff --git a/dkan/docs/components/visualizations/visualization_entity/images/geojson-step-01.png b/dkan/docs/components/visualizations/visualization_entity/images/geojson-step-01.png
new file mode 100644
index 000000000..39162384c
Binary files /dev/null and b/dkan/docs/components/visualizations/visualization_entity/images/geojson-step-01.png differ
diff --git a/dkan/docs/components/visualizations/visualization_entity/images/geojson-step-03.png b/dkan/docs/components/visualizations/visualization_entity/images/geojson-step-03.png
new file mode 100644
index 000000000..4e3df4f0d
Binary files /dev/null and b/dkan/docs/components/visualizations/visualization_entity/images/geojson-step-03.png differ
diff --git a/dkan/docs/components/visualizations/visualization_entity/images/geojson-step-04.png b/dkan/docs/components/visualizations/visualization_entity/images/geojson-step-04.png
new file mode 100644
index 000000000..978e730ba
Binary files /dev/null and b/dkan/docs/components/visualizations/visualization_entity/images/geojson-step-04.png differ
diff --git a/dkan/docs/components/visualizations/visualization_entity/images/geojson-step-05.png b/dkan/docs/components/visualizations/visualization_entity/images/geojson-step-05.png
new file mode 100644
index 000000000..e4e45156e
Binary files /dev/null and b/dkan/docs/components/visualizations/visualization_entity/images/geojson-step-05.png differ
diff --git a/dkan/docs/components/visualizations/visualization_entity/index.rst b/dkan/docs/components/visualizations/visualization_entity/index.rst
new file mode 100644
index 000000000..e592e4511
--- /dev/null
+++ b/dkan/docs/components/visualizations/visualization_entity/index.rst
@@ -0,0 +1,25 @@
+Visualization Entity
+=========================
+Visualization Entity is included in the DKAN distribution.
+
+This module **aims** to provide:
+
+- A base drupal entity to extend and create **visualization bundles**.
+- A set of visualization bundles that provide functionality out of the box for the module and indicate a good example for extending this entity.
+- A set of permissions common to all visualization bundles.
+- A common "iframe view" shared between all visualization bundles.
+- A common "embed" functionality shared between all visualization bundles.
+
+------------
+
+.. toctree::
+ :maxdepth: 1
+
+ Chart Bundle
+ Geojson Bundle
+ Choropleth Bundle
+
+
+
+
+This module is **still on early development**.
diff --git a/dkan/docs/components/workflow.md b/dkan/docs/components/workflow.md
deleted file mode 100644
index 6dba615eb..000000000
--- a/dkan/docs/components/workflow.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# DKAN Workflow
-
-Workflow implementation for [DKAN](https://github.com/NuCivic/dkan) based on
-[Workbench](https://www.drupal.org/project/workbench) and related modules.
-
-## Requirements
-
-* Dkan install. We do use undeclared dependencies used in core Dkan, for example
- the dataset and resource content types, features_role_export...
-* All external dependencies other then core Dkan are incapsulated in the
-`dkan_workflow.make` file. This includes
-[Workbench](https://www.drupal.org/project/workbench) and related modules
-([Workbench Moderation](https://www.drupal.org/project/workbench_moderation) for
-the content moderation features, [Workbench
-Email](https://www.drupal.org/project/workbench_email) for email notifications.)
-* Better UX is made possible by using the [Link
- Badges](https://www.drupal.org/project/link_badges) and [Menu
- Badges](https://www.drupal.org/project/menu_badges)
-
-## Known issues
-
-* Transitions config and Emails templates for "Original Author" could not be
- exported due to a bug in workbench_email.
-* Behat tests uses [hhs_implementation](https://github.com/NuCivic/dkanextension/tree/hhs_implementation)
- dkanextension instead of the master branch.
-* Support for OG while sending emails is supported but not clearly documented.
-
-## Documentation
-
-We are working on improving this documentation. Please let us know if you have
-any questions in the mean time.
diff --git a/dkan/docs/components/workflow.rst b/dkan/docs/components/workflow.rst
new file mode 100644
index 000000000..d59a2dd86
--- /dev/null
+++ b/dkan/docs/components/workflow.rst
@@ -0,0 +1,228 @@
+DKAN Workflow
+=============
+
+DKAN Workflow is a Workflow implementation for `DKAN
+`_ based on the `Workbench
+`_ family of modules.
+
+The goal of this component is help various organizations adhere to an editorial
+workflow for metadata publishing by providing:
+
+* Content state tracking and revisioning
+* State oriented management UI
+* Access control
+
+.. figure:: ../images/workflow/dkan_workflow_screenshot.png
+
+ DKAN Workflow main administration interface.
+
+Requirements
+------------
+
+The DKAN workflow component comes in the form of three modules:
+
+* DKAN Workflow
+* DKAN Workflow Permissions
+* Views Workflow List
+
+In addition to these core modules, DKAN Workflow depends on multiple Drupal
+contrib modules
+
+* `Workbench `_
+* `Workbench Moderation `_
+* `Workbench Email `_
+* `Drafty `_
+
+Outside of the direct Workbench add-ons, DKAN Workflow needs additional Drupal
+contrib modules to provide extra functionality (Menu and link badges, etc).
+
+* `Link Badges `_
+* `Menu Badges `_
+* `Better Exposed Filters `_
+
+All those dependencies are declared in the `drupal-org.make
+`_ file.
+
+Installation
+------------
+DKAN workflow is included in the core DKAN install but it's not enabled by default. It can be enabled either from the Modules management page or by using drush.
+
+.. code-block:: bash
+
+ drush en dkan_workflow -y
+
+Enabling DKAN workflow should enable all the dependencies modules and update the
+user roles (more information available in the `Workflow Roles`_
+section).
+
+Metadata Moderation States
+--------------------------
+
+There are three default moderations states available by default in DKAN:
+
+:Draft: This is the starter state that the metadata (be it dataset or resource) is in
+ when first created by the "Workflow Contributor" ( defined in the `Workflow
+ Roles`_ section). The node can be updated and have multiple iteration (or
+ revision in the Drupal jargon) without the need to change the state. After the
+ author evaluate the content is ready for being reviewed. The node moderation
+ state can be set to "Needs Review".
+
+:Needs Review: When the content author consider the work to be good enough to be reviewed by
+ a Moderator, the node(s) can be set to the *Needs Review*. This will signal to
+ available "Workflow Moderator" users that the data is ready to be looked at by
+ peers (more information in the `Workflow Roles`_ section).
+
+:Published: When the content is judged being ready for public consumption. The qualified
+ moderator (Take a look at the `Workflow Roles`_ section) can set it to the
+ *Published* state. This will make the current revision of the metadata to be
+ accessible by all the site visitor and the dataset/resources will be added to
+ the search index.
+
+Content Moderation UI
+----------------------------
+
+Controlling the moderation state of the various core content types provided by
+DKAN can be done from various places.
+
+My Workbench
+++++++++++++++++++++++++++++
+
+The main moderation interface is available from the *My Workbench* link from the
+navigation bar, or accessible directly via *admin/workbench*.
+
+.. image:: ../images/workflow/dkan_workflow_main_interface.png
+
+1. **Moderation Tabs**.
+
+ :My content: This tab is the only tab without the moderation table and provides quick
+ links to content creation forms.
+
+ :My drafts: This will display the draft content authored by the logged in user.
+
+ :Needs review: This will display the content with the moderation state set to *Needs
+ Review* depending on the Workflow role of the current user (This behavior is
+ detailed in the `Workflow Roles`_ section).
+
+ :Stale drafts: This moderation tab is equivalent to **My drafts** tabs except that it holds
+ all the *draft* content that was not updated in the last **72 hours**. This
+ tab is **only accessible by Workflow Supervisor** (see `Workflow Roles`_).
+
+ :Stale reviews: This moderation tab is equivalent to **Needs review** tabs except that it
+ holds all the *Needs Review* content that was not updated in the last **48
+ hours**. This tab is **only accessible by Workflow Supervisor** (see
+ `Workflow Roles`_).
+
+2. **Content Filters**. Users can filter through the moderated content by *Title*,
+ *Type* (Dataset, Resource, Data Story, etc), and *Groups*.
+
+3. **Bulk updates**. Certain operations like publishing or rejection can be
+ applied to all or a selected subset of the content available on the
+ moderation tab.
+
+4. **Moderated content Table**. The table will list all the moderated content
+ relevant to the tab currently selected. Supports displaying dataset without
+ resource or with all it's resources published (5), moderated dataset with
+ moderated child resource (6), and even child moderated resource(s) with
+ published parent dataset (7).
+
+Node Edit Page
+++++++++++++++++++++++++++++
+
+Changing the moderation state for individual nodes (be it a dataset or a
+resource) is available via the node edit form at the bottom of the edit page
+under the **Publishing options** sidebar. Authors and reviewers can change the
+moderation state and add a note about the change via the **Moderation notes**
+text area.
+
+.. image:: ../images/workflow/workflow_node_edit.png
+
+Workflow Roles
+---------------------------
+DKAN workflow permissions provides 3 Drupal roles:
+
+:Workflow Contributor: This is the lowest level role desgined with "Content Creator" users in mind,
+ with access only to the workflow menu and limited set of admininstration
+ pages. The only transitions granted for this role is from "Draft" to "Needs
+ Review" and the opposite way from "Needs Review" to "Draft". The only tabs
+ available for the "Workflow Contributor" role are the "My Draft" tab and
+ "Needs Review tab". Accros all the tabs, a user with this role have access
+ only to the content that was authored by him/her.
+
+:Workflow Moderator: This is a more advanced role desgined for "Editor" role. In addition of all
+ the capabilities of the "Workflow Contributor" role, A "Workflow Moderator"
+ can move content from "Needs review" to "Published". "Workflow Moderator"
+ users have access to all the content that is associated to the same Groups
+ that they belong to (checkout `Organic Groups integration`_ for more
+ information).
+
+:Workflow Supervisor: This is the role associated with "Site Manager" users. In addition to being
+ able to view and act upon all the content available on all the tabs (more
+ information available in the `Organic Groups integration`_), this role is the
+ only role that have access to the "Stale Drafts" and "Stale Review" tabs.
+
+Automatic User Role Assignment
+++++++++++++++++++++++++++++++
+
+Users with only workflow roles won't be able to do much in DKAN and need to be
+associated to its equivalent core role. The Roles form on the User edit page
+supports adding the suited core role when only a Workflow role is checked.
+
+.. figure:: ../images/workflow/dkan_workflow_autorole.gif
+ :scale: 75
+
+ Automatic core role assignment with workflow roles.
+
+Organic Groups integration
+++++++++++++++++++++++++++
+
+Content viewing
+~~~~~~~~~~~~~~~
+
++-------------------------+-------------------------------------+---------------------------------------------+
+| What a user will see | My drafts | Needs review |
++=========================+=====================================+=============================================+
+| Workflow Contributor | - Only content that they submitted. | * Can see only content they have submitted. |
++-------------------------+-------------------------------------+---------------------------------------------+
+| Workflow Moderator | - The content submitted to their | - The content submitted to their organic |
+| | organic group. | group. |
+| | - Their own content. | - Thier own content. |
++-------------------------+-------------------------------------+---------------------------------------------+
+| Workflow Supervisor | - Only content that they submitted. | - All the "Needs review" content. |
++-------------------------+-------------------------------------+---------------------------------------------+
+
+Emails
+~~~~~~~~~~~~~~~
+
+For each state transition (for example from *Draft* to *Needs Review*, from
+*Needs Review* to *Draft*, etc) a set of users with workflow roles will be
+notified by an email notification. The users will be selected following those
+rules:
+
+1. Email original content author.
+2. Email "Workflow Moderators" that are members of a group that the content have
+ been associated to.
+3. Email all "Workflow Supervisors".
+
+Emails will have the context triggering the notification with links to the
+updated content.
+
+Extending DKAN Workflow
+-----------------------
+
+Tweaking the Email template
++++++++++++++++++++++++++++
+Changing the email template being sent when a moderation operation is applied
+can be done via the *admin/config/workbench/email* configuration page. For more
+in-depth documentation please Review the `Workbench Modules Docs`_.
+
+Workbench Modules Docs
+++++++++++++++++++++++
+For more advanced edge case writing custom code may be needed. For more
+information please refer to the workflow modules documentation.
+
+* `Workbench documentation in drupal.org
+ `_.
+* `Workbench Moderation documentation in drupal.org
+ `_.
+* `Workbench Email documentation in drupal.org
+ `_.
diff --git a/dkan/docs/conf.py b/dkan/docs/conf.py
index 9693adbe8..fe66df5b8 100644
--- a/dkan/docs/conf.py
+++ b/dkan/docs/conf.py
@@ -35,6 +35,14 @@
pygments_style = 'sphinx'
+# load PhpLexer
+from sphinx.highlighting import lexers
+from pygments.lexers.web import PhpLexer
+
+# enable highlighting for PHP code not between by default
+lexers['php'] = PhpLexer(startinline=True)
+lexers['php-annotations'] = PhpLexer(startinline=True)
+
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
diff --git a/dkan/docs/development/index.rst b/dkan/docs/development/index.rst
index 4b26577ae..8ce2c2519 100644
--- a/dkan/docs/development/index.rst
+++ b/dkan/docs/development/index.rst
@@ -1,35 +1,40 @@
Extending and Customizing DKAN
-==============
+===============================
-
-Much additional functionality can be added simply by installing one of the
-tens of thousands of `contrib modules `_
+Much additional functionality can be added simply by installing one of the
+tens of thousands of `contrib modules `_
from the Drupal community. However, as a `Drupal
Distribution `_ DKAN is a
-flexible framework which developers can also build off of and add to.
-
+flexible framework which developers can also build off of and add to.
+
DKAN consists of of a distribution profile which manages the initial
installation, 3rd party libraries and drupal modules, and DKAN specific
-modules.
-
+modules.
+
Below is a simplified version of where the DKAN code sits within the fully
packaged version::
- profiles/
- dkan/
- libraries/ (3rd party libraries)
- modules/
- dkan/ (dkan modules)
- contrib/ (3rd party module dependencies)
- themes/ (dkan themes)
- sites/
- all/
- libraries/ (your libraries)
- modules/ (your modules)
+ profiles/
+ dkan/
+ libraries/ (3rd party libraries)
+ modules/
+ dkan/ (dkan modules)
+ contrib/ (3rd party module dependencies)
+ themes/ (dkan themes)
+ sites/
+ all/
+ libraries/ (your libraries)
+ modules/ (your modules)
themes/ (your themes)
After installing DKAN additional functionality should be added to the "sites"
-directory.
-
-In the future, this section will feature more detailed information on developing
-custom extentions to DKAN.
\ No newline at end of file
+directory.
+
+In the future, this section will feature more detailed information on developing
+custom extentions to DKAN. For now, read additional information about:
+
+.. toctree::
+ :maxdepth: 1
+
+ license
+ modules
diff --git a/dkan/docs/development/license.rst b/dkan/docs/development/license.rst
new file mode 100644
index 000000000..0cfcae25d
--- /dev/null
+++ b/dkan/docs/development/license.rst
@@ -0,0 +1,51 @@
+Customizing the License Field
+=============================
+
+In order to add options to the existing ones you need to implement `hook_license_subscribe` in the following fashion:
+
+.. code-block:: php
+
+ // Let's assume we want to do this as part of the fictitious license_options_extra module
+ function license_options_extra_license_subscribe() {
+ return array(
+ 'tcl' => array(
+ 'label' => 'Talis Community License (TCL)',
+ 'uri' => 'http://opendefinition.org/licenses/tcl/',
+ ),
+ );
+ }
+
+The code above add the **Talis Community License (TCL)** license referencing it to the **tcl** key. It also provides a link to the license (optional). You can provide as many options as you want through the array being returned.
+
+Removing License Options
+------------------------
+
+In order to remove options from the existing ones you need to implement `hook_license_unsubscribe` in the following fashion:
+
+.. code-block:: php
+
+ // Let's assume we want to do this as part of the fictitious license_options_extra module
+ function license_options_extra_license_unsubscribe() {
+ return array(
+ 'notspecified',
+ );
+ }
+
+
+The code above removes the **notspecified** option. You can provide as many options as you want through the array being returned.
+
+Additional notes about the behavior of both hooks
+-------------------------------------------------
+
+* The options provided through the license drupal field configuration are **COMPLETELY** ignored.
+* ``hook_license_subscribe()`` implementations are of course called before ``hook_license_unsubscribe()`` implementations.
+* Options subscribed through ``hook_license_subscribe()`` are processed as they come through the order of modules provided by the drupal registry.
+* If multiple options are provided using the same key then it grabs the first one that comes in and ignores the rest
+* If you want to **replace** and item that already exists, unsubscribe the existing key and provided an alternative one for your option
+
+References to the code
+----------------------
+
++ Hooks are invoked `here `_
++ Field formatter implementation for the license field is in `here `_
+
diff --git a/dkan/docs/development/modules.rst b/dkan/docs/development/modules.rst
new file mode 100644
index 000000000..09c79eeb2
--- /dev/null
+++ b/dkan/docs/development/modules.rst
@@ -0,0 +1,9 @@
+Community Contributions
+----------------------
+
+What follows is a list of modules from the community that extend DKAN's
+functionality. Many are developed by the DKAN team themselves but are still in
+an expiremental stage and not part of the core DKAN software. `Contact us
+`_ to add your mdodule to this list!
+
+* `DKAN Datastore CartoDB Integration `_
diff --git a/dkan/docs/images/992d1138-7ac6-11e4-8e7b-bcaefa733648.png b/dkan/docs/images/992d1138-7ac6-11e4-8e7b-bcaefa733648.png
new file mode 100644
index 000000000..a3114efe5
Binary files /dev/null and b/dkan/docs/images/992d1138-7ac6-11e4-8e7b-bcaefa733648.png differ
diff --git a/dkan/docs/images/Appearance_DKAN.png b/dkan/docs/images/Appearance_DKAN.png
index 6d18c3a6b..e75d312ab 100644
Binary files a/dkan/docs/images/Appearance_DKAN.png and b/dkan/docs/images/Appearance_DKAN.png differ
diff --git a/dkan/docs/images/Appearance_DKAN_2.png b/dkan/docs/images/Appearance_DKAN_2.png
index 685d11b8a..80c0426f2 100644
Binary files a/dkan/docs/images/Appearance_DKAN_2.png and b/dkan/docs/images/Appearance_DKAN_2.png differ
diff --git a/dkan/docs/images/DKANCartoDB.png b/dkan/docs/images/DKANCartoDB.png
new file mode 100644
index 000000000..d255093e7
Binary files /dev/null and b/dkan/docs/images/DKANCartoDB.png differ
diff --git a/dkan/docs/images/DatasetResourceDiagram2.png b/dkan/docs/images/DatasetResourceDiagram2.png
new file mode 100644
index 000000000..69d9e7e8d
Binary files /dev/null and b/dkan/docs/images/DatasetResourceDiagram2.png differ
diff --git a/dkan/docs/images/a9cb06b2-344e-11e4-84c8-c2174b5fc566.png b/dkan/docs/images/a9cb06b2-344e-11e4-84c8-c2174b5fc566.png
new file mode 100644
index 000000000..54766da02
Binary files /dev/null and b/dkan/docs/images/a9cb06b2-344e-11e4-84c8-c2174b5fc566.png differ
diff --git a/dkan/docs/images/ad5e3eac-7ac6-11e4-8c7d-91076527c84d.png b/dkan/docs/images/ad5e3eac-7ac6-11e4-8c7d-91076527c84d.png
new file mode 100644
index 000000000..02fd080ce
Binary files /dev/null and b/dkan/docs/images/ad5e3eac-7ac6-11e4-8c7d-91076527c84d.png differ
diff --git a/dkan/docs/images/add-dataset-screen-1.png b/dkan/docs/images/add-dataset-screen-1.png
new file mode 100644
index 000000000..7075e2f74
Binary files /dev/null and b/dkan/docs/images/add-dataset-screen-1.png differ
diff --git a/dkan/docs/admin/visualizations/images/arcgis.png b/dkan/docs/images/arcgis-preview.png~7.x-1.x
similarity index 100%
rename from dkan/docs/admin/visualizations/images/arcgis.png
rename to dkan/docs/images/arcgis-preview.png~7.x-1.x
diff --git a/dkan/docs/images/arcgis-preview.png~HEAD b/dkan/docs/images/arcgis-preview.png~HEAD
new file mode 100644
index 000000000..0aa8dc175
Binary files /dev/null and b/dkan/docs/images/arcgis-preview.png~HEAD differ
diff --git a/dkan/docs/images/arcgis.png b/dkan/docs/images/arcgis.png
new file mode 100644
index 000000000..8014676a9
Binary files /dev/null and b/dkan/docs/images/arcgis.png differ
diff --git a/dkan/docs/images/b3e6ea90-0b8f-11e4-9d9e-33b4515310f0.png b/dkan/docs/images/b3e6ea90-0b8f-11e4-9d9e-33b4515310f0.png
new file mode 100644
index 000000000..9122e1658
Binary files /dev/null and b/dkan/docs/images/b3e6ea90-0b8f-11e4-9d9e-33b4515310f0.png differ
diff --git a/dkan/docs/images/c3ca9cd4-0c9f-11e4-8fd0-1ea7c3c8b2b3.png b/dkan/docs/images/c3ca9cd4-0c9f-11e4-8fd0-1ea7c3c8b2b3.png
new file mode 100644
index 000000000..49990c275
Binary files /dev/null and b/dkan/docs/images/c3ca9cd4-0c9f-11e4-8fd0-1ea7c3c8b2b3.png differ
diff --git a/dkan/docs/images/c7ff24e6-0b8c-11e4-92c3-9ba2e163bf56.png b/dkan/docs/images/c7ff24e6-0b8c-11e4-92c3-9ba2e163bf56.png
new file mode 100644
index 000000000..9417fab5e
Binary files /dev/null and b/dkan/docs/images/c7ff24e6-0b8c-11e4-92c3-9ba2e163bf56.png differ
diff --git a/dkan/docs/images/cartodb-mappreview.png b/dkan/docs/images/cartodb-mappreview.png
new file mode 100644
index 000000000..322ada8d0
Binary files /dev/null and b/dkan/docs/images/cartodb-mappreview.png differ
diff --git a/dkan/docs/images/csv-preview.png b/dkan/docs/images/csv-preview.png
new file mode 100644
index 000000000..6d7572fa9
Binary files /dev/null and b/dkan/docs/images/csv-preview.png differ
diff --git a/dkan/docs/images/data-extent-block.png b/dkan/docs/images/data-extent-block.png
new file mode 100644
index 000000000..74ad94f26
Binary files /dev/null and b/dkan/docs/images/data-extent-block.png differ
diff --git a/dkan/docs/images/data-json.png b/dkan/docs/images/data-json.png
new file mode 100644
index 000000000..8b517c320
Binary files /dev/null and b/dkan/docs/images/data-json.png differ
diff --git a/dkan/docs/images/datasets-resources.png b/dkan/docs/images/datasets-resources.png
new file mode 100644
index 000000000..688790356
Binary files /dev/null and b/dkan/docs/images/datasets-resources.png differ
diff --git a/dkan/docs/images/datastore-api.png b/dkan/docs/images/datastore-api.png
new file mode 100644
index 000000000..9bcaefb0b
Binary files /dev/null and b/dkan/docs/images/datastore-api.png differ
diff --git a/dkan/docs/images/datastore-cartodb.png b/dkan/docs/images/datastore-cartodb.png
new file mode 100644
index 000000000..7ea9972ac
Binary files /dev/null and b/dkan/docs/images/datastore-cartodb.png differ
diff --git a/dkan/docs/images/external-preview.png b/dkan/docs/images/external-preview.png
new file mode 100644
index 000000000..a241dad80
Binary files /dev/null and b/dkan/docs/images/external-preview.png differ
diff --git a/dkan/docs/images/geojson-preview.png b/dkan/docs/images/geojson-preview.png
new file mode 100644
index 000000000..a44682b2c
Binary files /dev/null and b/dkan/docs/images/geojson-preview.png differ
diff --git a/dkan/docs/images/geojson-step-00.png b/dkan/docs/images/geojson-step-00.png
new file mode 100644
index 000000000..3b9436c6e
Binary files /dev/null and b/dkan/docs/images/geojson-step-00.png differ
diff --git a/dkan/docs/images/graph-preview.png b/dkan/docs/images/graph-preview.png
new file mode 100644
index 000000000..cb4ca1b10
Binary files /dev/null and b/dkan/docs/images/graph-preview.png differ
diff --git a/dkan/docs/images/group-members.png b/dkan/docs/images/group-members.png
new file mode 100644
index 000000000..64f8769b1
Binary files /dev/null and b/dkan/docs/images/group-members.png differ
diff --git a/dkan/docs/images/group.png b/dkan/docs/images/group.png
new file mode 100644
index 000000000..c3ed2df60
Binary files /dev/null and b/dkan/docs/images/group.png differ
diff --git a/dkan/docs/images/image-preview.png b/dkan/docs/images/image-preview.png
new file mode 100644
index 000000000..0c23c9830
Binary files /dev/null and b/dkan/docs/images/image-preview.png differ
diff --git a/dkan/docs/images/install-config-screen.png b/dkan/docs/images/install-config-screen.png
new file mode 100644
index 000000000..27192ef72
Binary files /dev/null and b/dkan/docs/images/install-config-screen.png differ
diff --git a/dkan/docs/images/install-database.png b/dkan/docs/images/install-database.png
new file mode 100644
index 000000000..182c78038
Binary files /dev/null and b/dkan/docs/images/install-database.png differ
diff --git a/dkan/docs/images/install-language.png b/dkan/docs/images/install-language.png
new file mode 100644
index 000000000..53b82aecb
Binary files /dev/null and b/dkan/docs/images/install-language.png differ
diff --git a/dkan/docs/images/install-progress.png b/dkan/docs/images/install-progress.png
new file mode 100644
index 000000000..09b8e4802
Binary files /dev/null and b/dkan/docs/images/install-progress.png differ
diff --git a/dkan/docs/images/json-preview.png b/dkan/docs/images/json-preview.png
new file mode 100644
index 000000000..3edc48eba
Binary files /dev/null and b/dkan/docs/images/json-preview.png differ
diff --git a/dkan/docs/images/manage-datastore.png b/dkan/docs/images/manage-datastore.png
new file mode 100644
index 000000000..14b23a49f
Binary files /dev/null and b/dkan/docs/images/manage-datastore.png differ
diff --git a/dkan/docs/images/map-preview.png b/dkan/docs/images/map-preview.png
new file mode 100644
index 000000000..77c872ef0
Binary files /dev/null and b/dkan/docs/images/map-preview.png differ
diff --git a/dkan/docs/images/metadata.png b/dkan/docs/images/metadata.png
new file mode 100644
index 000000000..fa73bee9c
Binary files /dev/null and b/dkan/docs/images/metadata.png differ
diff --git a/dkan/docs/images/new-user.png b/dkan/docs/images/new-user.png
new file mode 100644
index 000000000..44dae8662
Binary files /dev/null and b/dkan/docs/images/new-user.png differ
diff --git a/dkan/docs/images/pdf-preview.png b/dkan/docs/images/pdf-preview.png
new file mode 100644
index 000000000..2e620a903
Binary files /dev/null and b/dkan/docs/images/pdf-preview.png differ
diff --git a/dkan/docs/images/people.png b/dkan/docs/images/people.png
new file mode 100644
index 000000000..3dd1c54f0
Binary files /dev/null and b/dkan/docs/images/people.png differ
diff --git a/dkan/docs/images/png-preview.png b/dkan/docs/images/png-preview.png
new file mode 100644
index 000000000..9c1eecbd1
Binary files /dev/null and b/dkan/docs/images/png-preview.png differ
diff --git a/dkan/docs/images/recline-configuration.png b/dkan/docs/images/recline-configuration.png
new file mode 100644
index 000000000..4f64c9e62
Binary files /dev/null and b/dkan/docs/images/recline-configuration.png differ
diff --git a/dkan/docs/images/revision-diff.png b/dkan/docs/images/revision-diff.png
new file mode 100644
index 000000000..0e03e2635
Binary files /dev/null and b/dkan/docs/images/revision-diff.png differ
diff --git a/dkan/docs/images/revision.png b/dkan/docs/images/revision.png
new file mode 100644
index 000000000..a4936b147
Binary files /dev/null and b/dkan/docs/images/revision.png differ
diff --git a/dkan/docs/images/spacial-geographical.png b/dkan/docs/images/spacial-geographical.png
new file mode 100644
index 000000000..0b36487cb
Binary files /dev/null and b/dkan/docs/images/spacial-geographical.png differ
diff --git a/dkan/docs/images/upload-file.png b/dkan/docs/images/upload-file.png
new file mode 100644
index 000000000..8bd73e23d
Binary files /dev/null and b/dkan/docs/images/upload-file.png differ
diff --git a/dkan/docs/admin/visualizations/images/wms.png b/dkan/docs/images/wms.png
similarity index 100%
rename from dkan/docs/admin/visualizations/images/wms.png
rename to dkan/docs/images/wms.png
diff --git a/dkan/docs/images/workflow/dkan_workflow_autorole.gif b/dkan/docs/images/workflow/dkan_workflow_autorole.gif
new file mode 100644
index 000000000..9095c0555
Binary files /dev/null and b/dkan/docs/images/workflow/dkan_workflow_autorole.gif differ
diff --git a/dkan/docs/images/workflow/dkan_workflow_main_interface.png b/dkan/docs/images/workflow/dkan_workflow_main_interface.png
new file mode 100644
index 000000000..fbca8429d
Binary files /dev/null and b/dkan/docs/images/workflow/dkan_workflow_main_interface.png differ
diff --git a/dkan/docs/images/workflow/dkan_workflow_screenshot.png b/dkan/docs/images/workflow/dkan_workflow_screenshot.png
new file mode 100644
index 000000000..1d73f7241
Binary files /dev/null and b/dkan/docs/images/workflow/dkan_workflow_screenshot.png differ
diff --git a/dkan/docs/images/workflow/workflow_node_edit.png b/dkan/docs/images/workflow/workflow_node_edit.png
new file mode 100644
index 000000000..0fdf6cd68
Binary files /dev/null and b/dkan/docs/images/workflow/workflow_node_edit.png differ
diff --git a/dkan/docs/images/xls-format.png b/dkan/docs/images/xls-format.png
new file mode 100644
index 000000000..f2c1c8355
Binary files /dev/null and b/dkan/docs/images/xls-format.png differ
diff --git a/dkan/docs/images/xml-preview.png b/dkan/docs/images/xml-preview.png
new file mode 100644
index 000000000..9c65d6634
Binary files /dev/null and b/dkan/docs/images/xml-preview.png differ
diff --git a/dkan/docs/images/zip-preview.png b/dkan/docs/images/zip-preview.png
new file mode 100644
index 000000000..3b5f667e6
Binary files /dev/null and b/dkan/docs/images/zip-preview.png differ
diff --git a/dkan/docs/introduction/catalog-basics.md b/dkan/docs/introduction/catalog-basics.rst
similarity index 54%
rename from dkan/docs/introduction/catalog-basics.md
rename to dkan/docs/introduction/catalog-basics.rst
index 750be634d..1e39eeceb 100644
--- a/dkan/docs/introduction/catalog-basics.md
+++ b/dkan/docs/introduction/catalog-basics.rst
@@ -1,33 +1,42 @@
-# Catalog Basics
+Catalog Basics
+====================
Open data catalogs - or portals - are simple in purpose but may appear complicated at first glance. A homepage will often feature a slideshow, list of blog posts, or a visualization using data from the underlying catalog; these homepage assets can easily obscure the underlying structure of the data.
Understanding the structure of an open data catalog can help users, developers, and stakeholders make the best use of open data tools.
-## Catalog
+Catalog
+--------------------
The catalog is a wrapper containing information, sorted into datasets. A catalog should provide the answers to basic questions such as: "Who is providing this data?" and "Under what conditions?"
-[DCAT](http://www.w3.org/TR/vocab-dcat/) - an RDF vocabulary designed to facilitate interoperability between data catalogs published on the Web - recommends providing the following fields: catalog record, dataset, description, homepage, language, license, publisher, release date, rights, spatial, themes, title and update date.
+`DCAT `_ - an RDF vocabulary designed to facilitate interoperability between data catalogs published on the Web - recommends providing the following fields: catalog record, dataset, description, homepage, language, license, publisher, release date, rights, spatial, themes, title and update date.
-## Dataset
+.. _datasets:
-A dataset contains individual resources as well as metadata. Metadata is the "Who, What, When, Where, Why" of each dataset. There are a number of specifications for dataset metadata and DKAN currently complies with the DCAT and Project Open Data schemas.
+Dataset
+--------------------
+
+A dataset contains individual resources as well as metadata. Metadata is the "Who, What, When, Where, Why" of each dataset. There are a number of specifications for dataset metadata and DKAN currently complies with the DCAT and `Project Open Data `_ schemas.
It is possible to add new fields to DKAN to conform to additional specifications or custom requirements.
-## Resource
+.. _resources:
+
+Resource
+--------------------
Resources are the actual files, APIs or links that are being shared. Resource types include csv, html, xls, json, xlsx, doc, docx, rdf, txt, jpg, png, gif, tiff, pdf, odf, ods, odt, tsv, geojson and xml files. If the resource is an API, it can be used as a live source of information for building a site or application.
-## Datasets and Resources within DKAN and CKAN
+Datasets and Resources within DKAN and CKAN
+-------------------------------------------
-The following images display how datasets and resources are structured within DKAN and CKAN. Screenshots are from [Data.gov](http://data.gov) which is powered by CKAN. DKAN follows CKAN conventions where possible.
+The following images display how datasets and resources are structured within DKAN and CKAN. Screenshots are from `Data.gov `_ which is powered by CKAN. DKAN follows CKAN conventions where possible.
-
+.. figure:: ../images/DatasetResourceDiagram2.png
-
+.. figure:: ../images/datasets-resources.png
-
+.. figure:: ../images/metadata.png
+ :alt: Metadata
-
diff --git a/dkan/docs/introduction/dkan-ckan.md b/dkan/docs/introduction/dkan-ckan.md
index b70557941..7f78be35e 100644
--- a/dkan/docs/introduction/dkan-ckan.md
+++ b/dkan/docs/introduction/dkan-ckan.md
@@ -1,6 +1,6 @@
# Comparing DKAN and CKAN
-[CKAN](http://ckan.org) is an open data catalog that has powered many high-profile portals, including the main open data portals for both the [United Kingdom](http://data.gov.uk) and the [United Statres](http://data.gov), among others. The makers of DKAN have enjoyed contributing to and deploying CKAN. So why DKAN?
+[CKAN](http://ckan.org) is an open data catalog that has powered many high-profile portals, including the main open data portals for both the [United Kingdom](http://data.gov.uk) and the [United States](http://data.gov), among others. The makers of DKAN have enjoyed contributing to and deploying CKAN. So why DKAN?
Ultimately, DKAN is a complimentary offering to CKAN in the effort to make data more open and accessible.
diff --git a/dkan/docs/introduction/installation.rst b/dkan/docs/introduction/installation.rst
index 8d7b96de8..2cb22fe6c 100644
--- a/dkan/docs/introduction/installation.rst
+++ b/dkan/docs/introduction/installation.rst
@@ -152,7 +152,7 @@ With the web installer
- Open a web browser and visit **http://YOURDKANSITE/install.php**:
-.. figure:: http://docs.getdkan.com/sites/default/files/installation_screen01.png
+.. figure:: ../images/install-language.png
:alt: Installation Screen
Installation Screen
@@ -165,7 +165,7 @@ With the web installer
corrected before installation can proceed. Instructions for
correcting each error condition are provided.
-.. figure:: http://docs.getdkan.com/sites/default/files/installation_screen02.png
+.. figure:: ../images/install-database.png
:alt: Installation Screen - database config
Installation Screen
@@ -175,7 +175,7 @@ With the web installer
database name, database username, and database password, then click
“Save to Continue” to proceed.
-.. figure:: http://docs.getdkan.com/sites/default/files/installation_screen03.png
+.. figure:: ../images/install-progress.png
:alt: Progress Bar
Progress Bar
@@ -184,7 +184,7 @@ With the web installer
screen. Depending on your server resources, this may take several
minutes.
-.. figure:: http://docs.getdkan.com/sites/default/files/config_screen.png
+.. figure:: ../images/install-config-screen.png
:alt: Configuration Screen
Configuration
diff --git a/dkan/docs/introduction/maintaining.rst b/dkan/docs/introduction/maintaining.rst
index 7f2b2cb9b..50f66d308 100644
--- a/dkan/docs/introduction/maintaining.rst
+++ b/dkan/docs/introduction/maintaining.rst
@@ -149,8 +149,8 @@ Using a Custom Make file
~~~~~~~~~~~~~~~~~~~~~~~~
DKAN is “built” using a make file and ``drush make``. The
-```drupal-org.make`` `__
-file in DKAN contains a link to most of the modules installed in DKAN.
+`drupal-org.make `_
+file in DKAN contains a list of most of the modules installed in DKAN.
When developing a website for production, it is recommended to keep a
make file for all custom modules added to DKAN. Instead of using
@@ -159,12 +159,10 @@ to ``sites/all``, a make file is kept that has a list of the sites
modules. This enforces some best practices about not overwriting
contributed modules, maintaining patches, and reusability. This make
file along with DKAN’s makefiles also provide a reusable recipe for your
-site. See our `Data Starter
-template `__
-for DKAN sites for an example.
+site.
More documentation and automation scripts regarding this process are
-under active development and will be published here soon.
+under active development and can be viewed here: `DKAN Starter Documentation `_.
Adding additional modules or features
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/dkan/docs/releases/notes/1.13.1.md b/dkan/docs/releases/notes/1.13.1.md
deleted file mode 100644
index a91167126..000000000
--- a/dkan/docs/releases/notes/1.13.1.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# DKAN 1.13.1 Release Notes
-
-This is a "patch" release of DKAN, containing bug fixes and minor updates to DKAN 1.13, but adding no new functionality. It was released very shortly after 1.13 to address bugs that surfaced during deployments and upgrades. If you have not yet upgraded to 1.13, upgrade _directly_ to this release and skip 1.13; if you have already upgraded, we recommend updating to 1.13.1 immediately.
-
-[See full 1.13 release notes here](https://github.com/NuCivic/dkan/releases/tag/7.x-1.13).
-
-
-## Improvements in this release
-
- - Fixed a bug in the [home page conversion function](https://github.com/NuCivic/dkan/blob/f6d58c0751e9fe16016cb289c17697f4d44d1059/modules/dkan/dkan_sitewide/dkan_sitewide.module#L297)
- - Fixed the page title (``) so that it's just the site name (not the node or panel title)
- - Updated the DKAN API link on dataset pages to use the new [documentation site page](http://docs.getdkan.com/en/latest/apis/index.html).
- - Fixed error messages appearing on homepage after upgrade
- - Fixed panelizer permissions to hide the "Customize Display" button for Site Managers.
- - Additional minor bug fixes to code and tests
diff --git a/dkan/docs/releases/notes/1.13.1.rst b/dkan/docs/releases/notes/1.13.1.rst
new file mode 100644
index 000000000..5a263858e
--- /dev/null
+++ b/dkan/docs/releases/notes/1.13.1.rst
@@ -0,0 +1,17 @@
+DKAN 1.13.1 Release Notes
+=========================
+
+This is a "patch" release of DKAN, containing bug fixes and minor updates to DKAN 1.13, but adding no new functionality. It was released very shortly after 1.13 to address bugs that surfaced during deployments and upgrades. If you have not yet upgraded to 1.13, upgrade *directly* to this release and skip 1.13; if you have already upgraded, we recommend updating to 1.13.1 immediately.
+
+:doc:`See full 1.13 release notes here <1.13>`.
+
+
+Improvements in this release
+-----------------------------
+- Fix validation page permission check using wrong permission name `odsm `_.
+- Fixed a bug in the `home page conversion function `_
+- Fixed the page title (````) so that it's just the site name (not the node or panel title)
+- Updated the DKAN API link on dataset pages to use the new `documentation site page `_.
+- Fixed error messages appearing on homepage after upgrade
+- Fixed panelizer permissions to hide the "Customize Display" button for Site Managers.
+- Additional minor bug fixes to code and tests
diff --git a/dkan/docs/releases/notes/1.13.2.rst b/dkan/docs/releases/notes/1.13.2.rst
new file mode 100644
index 000000000..2520f50f3
--- /dev/null
+++ b/dkan/docs/releases/notes/1.13.2.rst
@@ -0,0 +1,14 @@
+DKAN 1.13.2 Release Notes
+=========================
+
+This is a "patch" release of DKAN, containing bug fixes and minor updates, but adding no new functionality.
+
+:doc:`See full 1.13 release notes here <1.13>`.
+
+
+Improvements in this release
+----------------------------
+- Fixed access to the featured groups block for anonymous users.
+- Fixed DKAN Harvest permissions for the site manager role, they now have access to the cache, delete, harvest, and migrate bulk operations from the Harvest Dashboard.
+- DKAN Harvest added support for importing contact name and contact email.
+- Updated contrib modules: services, visualization_entity and views.
diff --git a/dkan/docs/releases/notes/1.13.3.rst b/dkan/docs/releases/notes/1.13.3.rst
new file mode 100644
index 000000000..975ce3d09
--- /dev/null
+++ b/dkan/docs/releases/notes/1.13.3.rst
@@ -0,0 +1,6 @@
+DKAN 1.13.3 (future release)
+============================
+
+Placeholder for good things to come.
+
+
diff --git a/dkan/docs/releases/notes/1.13.md b/dkan/docs/releases/notes/1.13.md
index 78354f49c..c1dfa4e50 100644
--- a/dkan/docs/releases/notes/1.13.md
+++ b/dkan/docs/releases/notes/1.13.md
@@ -22,7 +22,7 @@ Get more details on the [Dataset REST API](http://docs.getdkan.com/en/latest/api
### DCAT-AP Compliance
-DKAN's DCAT RDF publishing has been reengineered to be more consistent with its other open-data standards implementation, and, more importantly, to implement the new DCAT-AP protocol. DKAN's fields can be easily mapped to DCAT-AP fields using the [Open Data Schema Mapper](http://docs.getdkan.com/en/latest/components/open-data-schema.html). Now, DKAN meets US standards (Project Open Data) as well as European Union standards (DCAT-AP).
+DKAN's DCAT RDF publishing has been re-engineered to be more consistent with its other open-data standards implementation, and, more importantly, to implement the new DCAT-AP protocol. DKAN's fields can be easily mapped to DCAT-AP fields using the [Open Data Schema Mapper](http://docs.getdkan.com/en/latest/components/open-data-schema.html). Now, DKAN meets US standards (Project Open Data) as well as European Union standards (DCAT-AP).
### New Default Content
@@ -136,21 +136,21 @@ One view previously used EVA, `user_profile_search`. You can avoid an error by r
### Features Reverts
-The following commands should be run to for the upgrade:
+The following commands should be run for the upgrade:
```
-ahoy drush rr
-ahoy drush fr dkan_dataset_content_types -y
-ahoy drush fr dkan_permissions -y
+drush rr
+drush fr dkan_dataset_content_types -y
+drush fr dkan_permissions -y
If ODFE is enabled then: ahoy drush fr open_data_federal_extras -y
If ODFE is enabled then: rm -rf sites/all/modules/open_data_federal_extras
-ahoy drush fr open_data_schema_map_dkan -y
-ahoy drush updatedb -y
-ahoy drush en dkan_ipe -y
-ahoy drush en dkan_harvest_dashboard -y
-ahoy drush en menu_admin_per_menu -y
-ahoy drush fra -y
-ahoy drush rr
+drush fr open_data_schema_map_dkan -y
+drush updatedb -y
+drush en dkan_ipe -y
+drush en dkan_harvest_dashboard -y
+drush en menu_admin_per_menu -y
+drush fra -y
+drush rr
```
## New Documentation location
diff --git a/dkan/docs/releases/notes/index.rst b/dkan/docs/releases/notes/index.rst
index c608b9288..7be51cbed 100644
--- a/dkan/docs/releases/notes/index.rst
+++ b/dkan/docs/releases/notes/index.rst
@@ -6,7 +6,10 @@ Release notes here will be identical to the releases kept in the `Github reposit
.. toctree::
:maxdepth: 1
- 1.13 (Future release) <1.13>
+ 1.13.3 (Future release) <1.13.3>
+ 1.13.2 <1.13.2>
+ 1.13.1 <1.13.1>
+ 1.13 <1.13>
1.12.13 <1.12.13>
1.12.12 <1.12.12>
1.12.11 <1.12.11>
diff --git a/dkan/docs/requirements.txt b/dkan/docs/requirements.txt
index b4d9d6d8d..c50eac206 100644
--- a/dkan/docs/requirements.txt
+++ b/dkan/docs/requirements.txt
@@ -1,4 +1,4 @@
-sphinx>=1.3.6
-sphinx-rtd-theme>=0.1.9
+sphinx>=1.5.2
+sphinx-rtd-theme>=0.2.4
recommonmark==0.4.0
# sphinxcontrib-httpdomain==1.5.0
diff --git a/dkan/drupal-org.make b/dkan/drupal-org.make
index 68b6089b1..9c17bb99f 100644
--- a/dkan/drupal-org.make
+++ b/dkan/drupal-org.make
@@ -2,10 +2,10 @@
api: '2'
core: 7.x
includes:
-- https://raw.githubusercontent.com/NuCivic/visualization_entity/7.x-1.0/visualization_entity.make
-- https://raw.githubusercontent.com/NuCivic/open_data_schema_map/7.x-1.13.1/open_data_schema_map.make
+- https://raw.githubusercontent.com/NuCivic/visualization_entity/7.x-1.1/visualization_entity.make
+- https://raw.githubusercontent.com/NuCivic/open_data_schema_map/7.x-1.13.2/open_data_schema_map.make
- https://raw.githubusercontent.com/NuCivic/leaflet_draw_widget/cb0d2b0e8c733a5f997038bd0b444ab2b6072542/leaflet_widget.make
-- https://raw.githubusercontent.com/NuCivic/recline/7.x-1.13.1/recline.make
+- https://raw.githubusercontent.com/NuCivic/recline/7.x-1.13.2/recline.make
projects:
admin_menu:
version: 3.0-rc5
@@ -112,7 +112,7 @@ projects:
download:
type: git
url: https://github.com/NuCivic/feeds_flatstore_processor.git
- revision: a69b7c4af7d585a7abf8f1d45d0599aeed043ae6
+ revision: 60ebdc5a688914b00f2f3ee15849a933acb5d751
field_group:
version: '1.5'
patch:
@@ -246,7 +246,7 @@ projects:
download:
type: git
url: https://github.com/NuCivic/open_data_schema_map.git
- tag: 7.x-1.13.1
+ tag: 7.x-1.13.2
panelizer:
version: '3.4'
panels:
@@ -276,7 +276,7 @@ projects:
download:
type: git
url: https://github.com/NuCivic/recline.git
- tag: 7.x-1.13.1
+ tag: 7.x-1.13.2
ref_field:
download:
type: git
@@ -291,7 +291,7 @@ projects:
remote_stream_wrapper:
version: 1.0-rc1
patch:
- 2833837: https://www.drupal.org/files/issues/prevent-download-intent-open-stream-2833837-1.patch
+ 2833837: https://www.drupal.org/files/issues/prevent-download-intent-open-stream-2833837-4.patch
role_export:
version: '1.0'
rules:
@@ -312,7 +312,7 @@ projects:
select_or_other:
version: '2.22'
services:
- version: '3.17'
+ version: '3.19'
simple_gmap:
version: '1.3'
strongarm:
@@ -331,9 +331,7 @@ projects:
uuid:
version: 1.0-beta2
views:
- version: '3.14'
- patch:
- 1388684: https://www.drupal.org/files/views_taxonomy_entity_uri-1388684-15.patch
+ version: '3.15'
views_autocomplete_filters:
version: '1.2'
patch:
@@ -347,7 +345,7 @@ projects:
download:
type: git
url: https://github.com/NuCivic/visualization_entity.git
- tag: 7.x-1.0
+ tag: 7.x-1.1
type: module
workbench:
version: '1.2'
diff --git a/dkan/libraries/chroma/CHANGELOG b/dkan/libraries/chroma/CHANGELOG
index f2df7c39c..da91b76eb 100644
--- a/dkan/libraries/chroma/CHANGELOG
+++ b/dkan/libraries/chroma/CHANGELOG
@@ -1,3 +1,6 @@
+# 1.2.2
+
+* scale.colors() now returns the original colors instead of just min/max range
# 1.2.0
diff --git a/dkan/libraries/chroma/bower.json b/dkan/libraries/chroma/bower.json
index db19116f6..7dcab5d20 100644
--- a/dkan/libraries/chroma/bower.json
+++ b/dkan/libraries/chroma/bower.json
@@ -27,7 +27,8 @@
"hsl",
"css",
"lch",
- "lab"
+ "lab",
+ "hcg"
],
"license": "MIT"
}
diff --git a/dkan/libraries/chroma/chroma.js b/dkan/libraries/chroma/chroma.js
index bcd99f138..a550239e6 100644
--- a/dkan/libraries/chroma/chroma.js
+++ b/dkan/libraries/chroma/chroma.js
@@ -34,7 +34,7 @@
*/
(function() {
- var Color, DEG2RAD, LAB_CONSTANTS, PI, PITHIRD, RAD2DEG, TWOPI, _guess_formats, _guess_formats_sorted, _input, _interpolators, abs, atan2, bezier, blend, blend_f, brewer, burn, chroma, clip_rgb, cmyk2rgb, colors, cos, css2rgb, darken, dodge, each, floor, hex2rgb, hsi2rgb, hsl2css, hsl2rgb, hsv2rgb, interpolate, interpolate_hsx, interpolate_lab, interpolate_num, interpolate_rgb, lab2lch, lab2rgb, lab_xyz, lch2lab, lch2rgb, lighten, limit, log, luminance_x, m, max, multiply, normal, num2rgb, overlay, pow, rgb2cmyk, rgb2css, rgb2hex, rgb2hsi, rgb2hsl, rgb2hsv, rgb2lab, rgb2lch, rgb2luminance, rgb2num, rgb2temperature, rgb2xyz, rgb_xyz, rnd, root, round, screen, sin, sqrt, temperature2rgb, type, unpack, w3cx11, xyz_lab, xyz_rgb,
+ var Color, DEG2RAD, LAB_CONSTANTS, PI, PITHIRD, RAD2DEG, TWOPI, _guess_formats, _guess_formats_sorted, _input, _interpolators, abs, atan2, bezier, blend, blend_f, brewer, burn, chroma, clip_rgb, cmyk2rgb, colors, cos, css2rgb, darken, dodge, each, floor, hcg2rgb, hex2rgb, hsi2rgb, hsl2css, hsl2rgb, hsv2rgb, interpolate, interpolate_hsx, interpolate_lab, interpolate_num, interpolate_rgb, lab2lch, lab2rgb, lab_xyz, lch2lab, lch2rgb, lighten, limit, log, luminance_x, m, max, multiply, normal, num2rgb, overlay, pow, rgb2cmyk, rgb2css, rgb2hcg, rgb2hex, rgb2hsi, rgb2hsl, rgb2hsv, rgb2lab, rgb2lch, rgb2luminance, rgb2num, rgb2temperature, rgb2xyz, rgb_xyz, rnd, root, round, screen, sin, sqrt, temperature2rgb, type, unpack, w3cx11, xyz_lab, xyz_rgb,
slice = [].slice;
type = (function() {
@@ -139,7 +139,7 @@
root.chroma = chroma;
}
- chroma.version = '1.1.1';
+ chroma.version = '1.2.2';
/**
@@ -224,14 +224,6 @@
}
}
- Color.prototype.alpha = function(alpha) {
- if (arguments.length) {
- this._rgb[3] = alpha;
- return this;
- }
- return this._rgb[3];
- };
-
Color.prototype.toString = function() {
return this.name();
};
@@ -281,6 +273,7 @@
PuRd: ['#f7f4f9', '#e7e1ef', '#d4b9da', '#c994c7', '#df65b0', '#e7298a', '#ce1256', '#980043', '#67001f'],
Blues: ['#f7fbff', '#deebf7', '#c6dbef', '#9ecae1', '#6baed6', '#4292c6', '#2171b5', '#08519c', '#08306b'],
PuBuGn: ['#fff7fb', '#ece2f0', '#d0d1e6', '#a6bddb', '#67a9cf', '#3690c0', '#02818a', '#016c59', '#014636'],
+ Viridis: ['#440154', '#482777', '#3f4a8a', '#31678e', '#26838f', '#1f9d8a', '#6cce5a', '#b6de2b', '#fee825'],
Spectral: ['#9e0142', '#d53e4f', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#e6f598', '#abdda4', '#66c2a5', '#3288bd', '#5e4fa2'],
RdYlGn: ['#a50026', '#d73027', '#f46d43', '#fdae61', '#fee08b', '#ffffbf', '#d9ef8b', '#a6d96a', '#66bd63', '#1a9850', '#006837'],
RdBu: ['#67001f', '#b2182b', '#d6604d', '#f4a582', '#fddbc7', '#f7f7f7', '#d1e5f0', '#92c5de', '#4393c3', '#2166ac', '#053061'],
@@ -300,6 +293,15 @@
Pastel1: ['#fbb4ae', '#b3cde3', '#ccebc5', '#decbe4', '#fed9a6', '#ffffcc', '#e5d8bd', '#fddaec', '#f2f2f2']
};
+ (function() {
+ var key, results;
+ results = [];
+ for (key in brewer) {
+ results.push(brewer[key.toLowerCase()] = brewer[key]);
+ }
+ return results;
+ })();
+
/**
X11 color names
@@ -1143,6 +1145,100 @@
}
});
+ hcg2rgb = function() {
+ var _c, _g, args, b, c, f, g, h, i, p, q, r, ref, ref1, ref2, ref3, ref4, ref5, t, v;
+ args = unpack(arguments);
+ h = args[0], c = args[1], _g = args[2];
+ c = c / 100;
+ g = g / 100 * 255;
+ _c = c * 255;
+ if (c === 0) {
+ r = g = b = _g;
+ } else {
+ if (h === 360) {
+ h = 0;
+ }
+ if (h > 360) {
+ h -= 360;
+ }
+ if (h < 0) {
+ h += 360;
+ }
+ h /= 60;
+ i = floor(h);
+ f = h - i;
+ p = _g * (1 - c);
+ q = p + _c * (1 - f);
+ t = p + _c * f;
+ v = p + _c;
+ switch (i) {
+ case 0:
+ ref = [v, t, p], r = ref[0], g = ref[1], b = ref[2];
+ break;
+ case 1:
+ ref1 = [q, v, p], r = ref1[0], g = ref1[1], b = ref1[2];
+ break;
+ case 2:
+ ref2 = [p, v, t], r = ref2[0], g = ref2[1], b = ref2[2];
+ break;
+ case 3:
+ ref3 = [p, q, v], r = ref3[0], g = ref3[1], b = ref3[2];
+ break;
+ case 4:
+ ref4 = [t, p, v], r = ref4[0], g = ref4[1], b = ref4[2];
+ break;
+ case 5:
+ ref5 = [v, p, q], r = ref5[0], g = ref5[1], b = ref5[2];
+ }
+ }
+ r = round(r);
+ g = round(g);
+ b = round(b);
+ return [r, g, b, args.length > 3 ? args[3] : 1];
+ };
+
+ rgb2hcg = function() {
+ var _g, b, c, delta, g, h, min, r, ref;
+ ref = unpack(arguments), r = ref[0], g = ref[1], b = ref[2];
+ min = Math.min(r, g, b);
+ max = Math.max(r, g, b);
+ delta = max - min;
+ c = delta * 100 / 255;
+ _g = min / (255 - delta) * 100;
+ if (delta === 0) {
+ h = Number.NaN;
+ } else {
+ if (r === max) {
+ h = (g - b) / delta;
+ }
+ if (g === max) {
+ h = 2 + (b - r) / delta;
+ }
+ if (b === max) {
+ h = 4 + (r - g) / delta;
+ }
+ h *= 60;
+ if (h < 0) {
+ h += 360;
+ }
+ }
+ return [h, c, _g];
+ };
+
+ chroma.hcg = function() {
+ return (function(func, args, ctor) {
+ ctor.prototype = func.prototype;
+ var child = new ctor, result = func.apply(child, args);
+ return Object(result) === result ? result : child;
+ })(Color, slice.call(arguments).concat(['hcg']), function(){});
+ };
+
+ _input.hcg = hcg2rgb;
+
+ Color.prototype.hcg = function() {
+ return rgb2hcg(this._rgb);
+ };
+
css2rgb = function(css) {
var aa, ab, hsl, i, m, o, rgb, w;
css = css.toLowerCase();
@@ -1469,8 +1565,7 @@
if (res == null) {
throw "color mode " + m + " is not supported";
}
- res.alpha(col1.alpha() + f * (col2.alpha() - col1.alpha()));
- return res;
+ return res.alpha(col1.alpha() + f * (col2.alpha() - col1.alpha()));
};
chroma.interpolate = interpolate;
@@ -1646,6 +1741,17 @@
return me;
};
+ Color.prototype.alpha = function(a) {
+ var b, g, r;
+ if (arguments.length) {
+ r = this._rgb[0];
+ g = this._rgb[1];
+ b = this._rgb[2];
+ return chroma.rgb([r, g, b, a]);
+ }
+ return this._rgb[3];
+ };
+
Color.prototype.darken = function(amount) {
var lab, me;
if (amount == null) {
@@ -1840,23 +1946,23 @@
_correctLightness = false;
_colorCache = {};
setColors = function(colors) {
- var c, col, o, ref, ref1, ref2, w;
+ var c, col, o, ref, ref1, w;
if (colors == null) {
colors = ['#fff', '#000'];
}
- if ((colors != null) && type(colors) === 'string' && (((ref = chroma.brewer) != null ? ref[colors] : void 0) != null)) {
- colors = chroma.brewer[colors];
+ if ((colors != null) && type(colors) === 'string' && (chroma.brewer != null)) {
+ colors = chroma.brewer[colors] || chroma.brewer[colors.toLowerCase()] || colors;
}
if (type(colors) === 'array') {
colors = colors.slice(0);
- for (c = o = 0, ref1 = colors.length - 1; 0 <= ref1 ? o <= ref1 : o >= ref1; c = 0 <= ref1 ? ++o : --o) {
+ for (c = o = 0, ref = colors.length - 1; 0 <= ref ? o <= ref : o >= ref; c = 0 <= ref ? ++o : --o) {
col = colors[c];
if (type(col) === "string") {
colors[c] = chroma(col);
}
}
_pos.length = 0;
- for (c = w = 0, ref2 = colors.length - 1; 0 <= ref2 ? w <= ref2 : w >= ref2; c = 0 <= ref2 ? ++w : --w) {
+ for (c = w = 0, ref1 = colors.length - 1; 0 <= ref1 ? w <= ref1 : w >= ref1; c = 0 <= ref1 ? ++w : --w) {
_pos.push(c / (colors.length - 1));
}
}
@@ -2078,6 +2184,11 @@
var dd, dm, i, numColors, o, out, ref, results, samples, w;
numColors = 0;
out = 'hex';
+ if (arguments.length === 0) {
+ return _colors.map(function(c) {
+ return c[out]();
+ });
+ }
if (arguments.length === 1) {
if (type(arguments[0]) === 'string') {
out = arguments[0];
@@ -2407,6 +2518,9 @@
} else if (m === 'hsv') {
xyz0 = col1.hsv();
xyz1 = col2.hsv();
+ } else if (m === 'hcg') {
+ xyz0 = col1.hcg();
+ xyz1 = col2.hcg();
} else if (m === 'hsi') {
xyz0 = col1.hsi();
xyz1 = col2.hsi();
@@ -2450,7 +2564,7 @@
_interpolators = _interpolators.concat((function() {
var len, o, ref, results;
- ref = ['hsv', 'hsl', 'hsi', 'hcl', 'lch'];
+ ref = ['hsv', 'hsl', 'hsi', 'hcl', 'lch', 'hcg'];
results = [];
for (o = 0, len = ref.length; o < len; o++) {
m = ref[o];
diff --git a/dkan/libraries/chroma/chroma.min.js b/dkan/libraries/chroma/chroma.min.js
index e81220c77..15e504acb 100644
--- a/dkan/libraries/chroma/chroma.min.js
+++ b/dkan/libraries/chroma/chroma.min.js
@@ -29,5 +29,5 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-(function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,$,_,aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la,ma,na,oa,pa,qa,ra,sa,ta,ua,va,wa,xa,ya,za=[].slice;ua=function(){var a,b,c,d,e;for(a={},e="Boolean Number String Function Array Date RegExp Undefined Null".split(" "),d=0,b=e.length;dc&&(a=c),a},va=function(a){return a.length>=3?[].slice.call(a):a[0]},t=function(a){var b;for(b in a)b<3?(a[b]<0&&(a[b]=0),a[b]>255&&(a[b]=255)):3===b&&(a[b]<0&&(a[b]=0),a[b]>1&&(a[b]=1));return a},d=Math.PI,pa=Math.round,w=Math.cos,B=Math.floor,_=Math.pow,T=Math.log,ra=Math.sin,sa=Math.sqrt,m=Math.atan2,W=Math.max,l=Math.abs,g=2*d,e=d/3,b=d/180,f=180/d,s=function(){return arguments[0]instanceof a?arguments[0]:function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,arguments,function(){})},k=[],"undefined"!=typeof module&&null!==module&&null!=module.exports&&(module.exports=s),"function"==typeof define&&define.amd?define([],function(){return s}):(oa="undefined"!=typeof exports&&null!==exports?exports:this,oa.chroma=s),s.version="1.1.1",j={},h=[],i=!1,a=function(){function a(){var a,b,c,d,e,f,g,k,l;for(f=this,b=[],k=0,d=arguments.length;k3?b[3]:1]},ya=function(a){return pa(255*(a<=.00304?12.92*a:1.055*_(a,1/2.4)-.055))},O=function(a){return a>c.t1?a*a*a:c.t2*(a-c.t0)},c={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},ga=function(){var a,b,c,d,e,f,g,h;return d=va(arguments),c=d[0],b=d[1],a=d[2],e=la(c,b,a),f=e[0],g=e[1],h=e[2],[116*g-16,500*(f-g),200*(g-h)]},ma=function(a){return(a/=255)<=.04045?a/12.92:_((a+.055)/1.055,2.4)},xa=function(a){return a>c.t3?_(a,1/3):a/c.t2+c.t0},la=function(){var a,b,d,e,f,g,h;return e=va(arguments),d=e[0],b=e[1],a=e[2],d=ma(d),b=ma(b),a=ma(a),f=xa((.4124564*d+.3575761*b+.1804375*a)/c.Xn),g=xa((.2126729*d+.7151522*b+.072175*a)/c.Yn),h=xa((.0193339*d+.119192*b+.9503041*a)/c.Zn),[f,g,h]},s.lab=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,za.call(arguments).concat(["lab"]),function(){})},j.lab=N,a.prototype.lab=function(){return ga(this._rgb)},n=function(a){var b,c,d,e,f,g,h,i,j,k,l;return a=function(){var b,c,d;for(d=[],c=0,b=a.length;c=0&&b[3]<=1?"rgb":void 0}}),C=function(a){var b,c,d,e,f,g;if(a.match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/))return 4!==a.length&&7!==a.length||(a=a.substr(1)),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),g=parseInt(a,16),e=g>>16,d=g>>8&255,c=255&g,[e,d,c,1];if(a.match(/^#?([A-Fa-f0-9]{8})$/))return 9===a.length&&(a=a.substr(1)),g=parseInt(a,16),e=g>>24&255,d=g>>16&255,c=g>>8&255,b=pa((255&g)/255*100)/100,[e,d,c,b];if(null!=j.css&&(f=j.css(a)))return f;throw"unknown color: "+a},ca=function(a,b){var c,d,e,f,g,h,i;return null==b&&(b="rgb"),g=a[0],e=a[1],d=a[2],c=a[3],i=g<<16|e<<8|d,h="000000"+i.toString(16),h=h.substr(h.length-6),f="0"+pa(255*c).toString(16),f=f.substr(f.length-2),"#"+function(){switch(b.toLowerCase()){case"rgba":return h+f;case"argb":return f+h;default:return h}}()},j.hex=function(a){return C(a)},s.hex=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,za.call(arguments).concat(["hex"]),function(){})},a.prototype.hex=function(a){return null==a&&(a="rgb"),ca(this._rgb,a)},h.push({p:10,test:function(a){if(1===arguments.length&&"string"===ua(a))return"hex"}}),F=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;if(a=va(arguments),e=a[0],k=a[1],g=a[2],0===k)i=d=b=255*g;else{for(n=[0,0,0],c=[0,0,0],m=g<.5?g*(1+k):g+k-g*k,l=2*g-m,e/=360,n[0]=e+1/3,n[1]=e,n[2]=e-1/3,f=h=0;h<=2;f=++h)n[f]<0&&(n[f]+=1),n[f]>1&&(n[f]-=1),6*n[f]<1?c[f]=l+6*(m-l)*n[f]:2*n[f]<1?c[f]=m:3*n[f]<2?c[f]=l+(m-l)*(2/3-n[f])*6:c[f]=l;j=[pa(255*c[0]),pa(255*c[1]),pa(255*c[2])],i=j[0],d=j[1],b=j[2]}return a.length>3?[i,d,b,a[3]]:[i,d,b]},ea=function(a,b,c){var d,e,f,g,h;return void 0!==a&&a.length>=3&&(g=a,a=g[0],b=g[1],c=g[2]),a/=255,b/=255,c/=255,f=Math.min(a,b,c),W=Math.max(a,b,c),e=(W+f)/2,W===f?(h=0,d=Number.NaN):h=e<.5?(W-f)/(W+f):(W-f)/(2-W-f),a===W?d=(b-c)/(W-f):b===W?d=2+(c-a)/(W-f):c===W&&(d=4+(a-b)/(W-f)),d*=60,d<0&&(d+=360),[d,h,e]},s.hsl=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,za.call(arguments).concat(["hsl"]),function(){})},j.hsl=F,a.prototype.hsl=function(){return ea(this._rgb)},G=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;if(a=va(arguments),e=a[0],p=a[1],r=a[2],r*=255,0===p)i=d=b=r;else switch(360===e&&(e=0),e>360&&(e-=360),e<0&&(e+=360),e/=60,f=B(e),c=e-f,g=r*(1-p),h=r*(1-p*c),q=r*(1-p*(1-c)),f){case 0:j=[r,q,g],i=j[0],d=j[1],b=j[2];break;case 1:k=[h,r,g],i=k[0],d=k[1],b=k[2];break;case 2:l=[g,r,q],i=l[0],d=l[1],b=l[2];break;case 3:m=[g,h,r],i=m[0],d=m[1],b=m[2];break;case 4:n=[q,g,r],i=n[0],d=n[1],b=n[2];break;case 5:o=[r,g,h],i=o[0],d=o[1],b=o[2]}return i=pa(i),d=pa(d),b=pa(b),[i,d,b,a.length>3?a[3]:1]},fa=function(){var a,b,c,d,e,f,g,h,i;return g=va(arguments),f=g[0],c=g[1],a=g[2],e=Math.min(f,c,a),W=Math.max(f,c,a),b=W-e,i=W/255,0===W?(d=Number.NaN,h=0):(h=b/W,f===W&&(d=(c-a)/b),c===W&&(d=2+(a-f)/b),a===W&&(d=4+(f-c)/b),d*=60,d<0&&(d+=360)),[d,h,i]},s.hsv=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,za.call(arguments).concat(["hsv"]),function(){})},j.hsv=G,a.prototype.hsv=function(){return fa(this._rgb)},Z=function(a){var b,c,d;return"number"===ua(a)&&a>=0&&a<=16777215?(d=a>>16,c=a>>8&255,b=255&a,[d,c,b,1]):(console.warn("unknown num color: "+a),[0,0,0,1])},ja=function(){var a,b,c,d;return d=va(arguments),c=d[0],b=d[1],a=d[2],(c<<16)+(b<<8)+a},s.num=function(b){return new a(b,"num")},a.prototype.num=function(a){return null==a&&(a="rgb"),ja(this._rgb,a)},j.num=Z,h.push({p:10,test:function(a){if(1===arguments.length&&"number"===ua(a)&&a>=0&&a<=16777215)return"num"}}),x=function(a){var b,c,d,e,f,g,h,i;if(a=a.toLowerCase(),null!=s.colors&&s.colors[a])return C(s.colors[a]);if(f=a.match(/rgb\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*\)/)){for(h=f.slice(1,4),e=g=0;g<=2;e=++g)h[e]=+h[e];h[3]=1}else if(f=a.match(/rgba\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*,\s*([01]|[01]?\.\d+)\)/))for(h=f.slice(1,5),e=i=0;i<=3;e=++i)h[e]=+h[e];else if(f=a.match(/rgb\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/)){for(h=f.slice(1,4),e=b=0;b<=2;e=++b)h[e]=pa(2.55*h[e]);h[3]=1}else if(f=a.match(/rgba\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/)){for(h=f.slice(1,5),e=c=0;c<=2;e=++c)h[e]=pa(2.55*h[e]);h[3]=+h[3]}else(f=a.match(/hsl\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/))?(d=f.slice(1,4),d[1]*=.01,d[2]*=.01,h=F(d),h[3]=1):(f=a.match(/hsla\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/))&&(d=f.slice(1,4),d[1]*=.01,d[2]*=.01,h=F(d),h[3]=+f[4]);return h},ba=function(a){var b;return b=a[3]<1?"rgba":"rgb","rgb"===b?b+"("+a.slice(0,3).map(pa).join(",")+")":"rgba"===b?b+"("+a.slice(0,3).map(pa).join(",")+","+a[3]+")":void 0},na=function(a){return pa(100*a)/100},E=function(a,b){var c;return c=b<1?"hsla":"hsl",a[0]=na(a[0]||0),a[1]=na(100*a[1])+"%",a[2]=na(100*a[2])+"%","hsla"===c&&(a[3]=b),c+"("+a.join(",")+")"},j.css=function(a){return x(a)},s.css=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,za.call(arguments).concat(["css"]),function(){})},a.prototype.css=function(a){return null==a&&(a="rgb"),"rgb"===a.slice(0,3)?ba(this._rgb):"hsl"===a.slice(0,3)?E(this.hsl(),this.alpha()):void 0},j.named=function(a){return C(wa[a])},h.push({p:20,test:function(a){if(1===arguments.length&&null!=wa[a])return"named"}}),a.prototype.name=function(a){var b,c;arguments.length&&(wa[a]&&(this._rgb=C(wa[a])),this._rgb[3]=1),b=this.hex();for(c in wa)if(b===wa[c])return c;return b},P=function(){var a,c,d,e;return e=va(arguments),d=e[0],a=e[1],c=e[2],c*=b,[d,w(c)*a,ra(c)*a]},Q=function(){var a,b,c,d,e,f,g,h,i,j,k;return c=va(arguments),h=c[0],e=c[1],g=c[2],j=P(h,e,g),a=j[0],b=j[1],d=j[2],k=N(a,b,d),i=k[0],f=k[1],d=k[2],[S(i,0,255),S(f,0,255),S(d,0,255),c.length>3?c[3]:1]},M=function(){var a,b,c,d,e,g;return g=va(arguments),e=g[0],a=g[1],b=g[2],c=sa(a*a+b*b),d=(m(b,a)*f+360)%360,0===pa(1e4*c)&&(d=Number.NaN),[e,c,d]},ha=function(){var a,b,c,d,e,f,g;return f=va(arguments),e=f[0],c=f[1],b=f[2],g=ga(e,c,b),d=g[0],a=g[1],b=g[2],M(d,a,b)},s.lch=function(){var b;return b=va(arguments),new a(b,"lch")},s.hcl=function(){var b;return b=va(arguments),new a(b,"hcl")},j.lch=Q,j.hcl=function(){var a,b,c,d;return d=va(arguments),b=d[0],a=d[1],c=d[2],Q([c,a,b])},a.prototype.lch=function(){return ha(this._rgb)},a.prototype.hcl=function(){return ha(this._rgb).reverse()},aa=function(a){var b,c,d,e,f,g,h,i,j;return null==a&&(a="rgb"),i=va(arguments),h=i[0],e=i[1],b=i[2],h/=255,e/=255,b/=255,f=1-Math.max(h,Math.max(e,b)),d=f<1?1/(1-f):0,c=(1-h-f)*d,g=(1-e-f)*d,j=(1-b-f)*d,[c,g,j,f]},u=function(){var a,b,c,d,e,f,g,h,i;return b=va(arguments),d=b[0],g=b[1],i=b[2],f=b[3],a=b.length>4?b[4]:1,1===f?[0,0,0,a]:(h=d>=1?0:pa(255*(1-d)*(1-f)),e=g>=1?0:pa(255*(1-g)*(1-f)),c=i>=1?0:pa(255*(1-i)*(1-f)),[h,e,c,a])},j.cmyk=function(){return u(va(arguments))},s.cmyk=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,za.call(arguments).concat(["cmyk"]),function(){})},a.prototype.cmyk=function(){return aa(this._rgb)},j.gl=function(){var a,b,c,d,e;for(d=function(){var a,c;a=va(arguments),c=[];for(b in a)e=a[b],c.push(e);return c}.apply(this,arguments),a=c=0;c<=2;a=++c)d[a]*=255;return d},s.gl=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,za.call(arguments).concat(["gl"]),function(){})},a.prototype.gl=function(){var a;return a=this._rgb,[a[0]/255,a[1]/255,a[2]/255,a[3]]},ia=function(a,b,c){var d;return d=va(arguments),a=d[0],b=d[1],c=d[2],a=U(a),b=U(b),c=U(c),.2126*a+.7152*b+.0722*c},U=function(a){return a/=255,a<=.03928?a/12.92:_((a+.055)/1.055,2.4)},k=[],H=function(a,b,c,d){var e,f,g,h;for(null==c&&(c=.5),null==d&&(d="rgb"),"object"!==ua(a)&&(a=s(a)),"object"!==ua(b)&&(b=s(b)),g=0,f=k.length;ga?f(c,i):f(i,g)},c=ia(this._rgb),this._rgb=(c>a?f(s("black"),this):f(this,s("white"))).rgba()),this):ia(this._rgb)},ta=function(a){var b,c,d,e;return e=a/100,e<66?(d=255,c=-155.25485562709179-.44596950469579133*(c=e-2)+104.49216199393888*T(c),b=e<20?0:-254.76935184120902+.8274096064007395*(b=e-10)+115.67994401066147*T(b)):(d=351.97690566805693+.114206453784165*(d=e-55)-40.25366309332127*T(d),c=325.4494125711974+.07943456536662342*(c=e-50)-28.0852963507957*T(c),b=255),t([d,c,b])},ka=function(){var a,b,c,d,e,f,g,h,i;for(g=va(arguments),f=g[0],c=g[1],a=g[2],e=1e3,d=4e4,b=.4;d-e>b;)i=.5*(d+e),h=ta(i),h[2]/h[0]>=a/f?d=i:e=i;return pa(i)},s.temperature=s.kelvin=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,za.call(arguments).concat(["temperature"]),function(){})},j.temperature=j.kelvin=j.K=ta,a.prototype.temperature=function(){return ka(this._rgb)},a.prototype.kelvin=a.prototype.temperature,s.contrast=function(b,c){var d,e,f,g;return"string"!==(f=ua(b))&&"number"!==f||(b=new a(b)),"string"!==(g=ua(c))&&"number"!==g||(c=new a(c)),d=b.luminance(),e=c.luminance(),d>e?(d+.05)/(e+.05):(e+.05)/(d+.05)},a.prototype.get=function(a){var b,c,d,e,f,g;return d=this,f=a.split("."),e=f[0],b=f[1],g=d[e](),b?(c=e.indexOf(b),c>-1?g[c]:console.warn("unknown channel "+b+" in mode "+e)):g},a.prototype.set=function(a,b){var c,d,e,f,g,h;if(e=this,g=a.split("."),f=g[0],c=g[1],c)if(h=e[f](),d=f.indexOf(c),d>-1)if("string"===ua(b))switch(b.charAt(0)){case"+":h[d]+=+b;break;case"-":h[d]+=+b;break;case"*":h[d]*=+b.substr(1);break;case"/":h[d]/=+b.substr(1);break;default:h[d]=+b}else h[d]=b;else console.warn("unknown channel "+c+" in mode "+f);else h=b;return e._rgb=s(h,f).alpha(e.alpha())._rgb,e},a.prototype.darken=function(a){var b,d;return null==a&&(a=1),d=this,b=d.lab(),b[0]-=c.Kn*a,s.lab(b).alpha(d.alpha())},a.prototype.brighten=function(a){return null==a&&(a=1),this.darken(-a)},a.prototype.darker=a.prototype.darken,a.prototype.brighter=a.prototype.brighten,a.prototype.saturate=function(a){var b,d;return null==a&&(a=1),d=this,b=d.lch(),b[1]+=a*c.Kn,b[1]<0&&(b[1]=0),s.lch(b).alpha(d.alpha())},a.prototype.desaturate=function(a){return null==a&&(a=1),this.saturate(-a)},a.prototype.premultiply=function(){var a,b;return b=this.rgb(),a=this.alpha(),s(b[0]*a,b[1]*a,b[2]*a,a)},o=function(a,b,c){if(!o[c])throw"unknown blend mode "+c;return o[c](a,b)},p=function(a){return function(b,c){var d,e;return d=s(c).rgb(),e=s(b).rgb(),s(a(d,e),"rgb")}},A=function(a){return function(b,c){var d,e,f;for(f=[],d=e=0;e<=3;d=++e)f[d]=a(b[d],c[d]);return f}},Y=function(a,b){return a},X=function(a,b){return a*b/255},y=function(a,b){return a>b?b:a},R=function(a,b){return a>b?a:b},qa=function(a,b){return 255*(1-(1-a/255)*(1-b/255))},$=function(a,b){return b<128?2*a*b/255:255*(1-2*(1-a/255)*(1-b/255))},r=function(a,b){return 255*(1-(1-b/255)/(a/255))},z=function(a,b){return 255===a?255:(a=255*(b/255)/(1-a/255),a>255?255:a)},o.normal=p(A(Y)),o.multiply=p(A(X)),o.screen=p(A(qa)),o.overlay=p(A($)),o.darken=p(A(y)),o.lighten=p(A(R)),o.dodge=p(A(z)),o.burn=p(A(r)),s.blend=o,s.analyze=function(a){var b,c,d,e;for(d={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0},c=0,b=a.length;cd.max&&(d.max=e),d.count+=1);return d.domain=[d.min,d.max],d.limits=function(a,b){return s.limits(d,a,b)},d},s.scale=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,t,u,v,w,x;return k="rgb",l=s("#ccc"),p=0,h=!1,g=[0,1],o=[],n=[0,0],c=!1,e=[],m=!1,j=0,i=1,f=!1,d={},w=function(a){var b,c,d,f,g,h,i;if(null==a&&(a=["#fff","#000"]),null!=a&&"string"===ua(a)&&null!=(null!=(f=s.brewer)?f[a]:void 0)&&(a=s.brewer[a]),"array"===ua(a)){for(a=a.slice(0),b=d=0,g=a.length-1;0<=g?d<=g:d>=g;b=0<=g?++d:--d)c=a[b],"string"===ua(c)&&(a[b]=s(c));for(o.length=0,b=i=0,h=a.length-1;0<=h?i<=h:i>=h;b=0<=h?++i:--i)o.push(b/(a.length-1))}return v(),e=a},t=function(a){var b,d;if(null!=c){for(d=c.length-1,b=0;b=c[b];)b++;return b-1}return 0},x=function(a){return a},q=function(a){var b,d,e,f,g;return g=a,c.length>2&&(f=c.length-1,b=t(a),e=c[0]+(c[1]-c[0])*(0+.5*p),d=c[f-1]+(c[f]-c[f-1])*(1-.5*p),g=j+(c[b]+.5*(c[b+1]-c[b])-e)/(d-e)*(i-j)),g},u=function(a,b){var f,g,h,m,p,q,r,u;if(null==b&&(b=!1),isNaN(a))return l;if(b?u=a:c&&c.length>2?(f=t(a),u=f/(c.length-2),u=n[0]+u*(1-n[0]-n[1])):i!==j?(u=(a-j)/(i-j),u=n[0]+u*(1-n[0]-n[1]),u=Math.min(1,Math.max(0,u))):u=1,b||(u=x(u)),m=Math.floor(1e4*u),d[m])g=d[m];else{if("array"===ua(e))for(h=p=0,r=o.length-1;0<=r?p<=r:p>=r;h=0<=r?++p:--p){if(q=o[h],u<=q){g=e[h];break}if(u>=q&&h===o.length-1){g=e[h];break}if(u>q&&u=k;b=0<=k?++l:--l)o.push(b/(d-1));return g=[j,i],r},r.mode=function(a){return arguments.length?(k=a,v(),r):k},r.range=function(a,b){return w(a,b),r},r.out=function(a){return m=a,r},r.spread=function(a){return arguments.length?(p=a,r):p},r.correctLightness=function(a){return null==a&&(a=!0),f=a,v(),x=f?function(a){var b,c,d,e,f,g,h,i,j;for(b=u(0,!0).lab()[0],c=u(1,!0).lab()[0],h=b>c,d=u(a,!0).lab()[0],f=b+(c-b)*a,e=d-f,i=0,j=1,g=20;Math.abs(e)>.01&&g-- >0;)!function(){return h&&(e*=-1),e<0?(i=a,a+=.5*(j-a)):(j=a,a+=.5*(i-a)),d=u(a,!0).lab()[0],e=d-f}();return a}:function(a){return a},r},r.padding=function(a){return null!=a?("number"===ua(a)&&(a=[a,a]),n=a,r):n},r.colors=function(){var b,d,e,f,h,i,j,k,l;if(f=0,h="hex",1===arguments.length&&("string"===ua(arguments[0])?h=arguments[0]:f=arguments[0]),2===arguments.length&&(f=arguments[0],h=arguments[1]),f)return d=g[0],b=g[1]-d,function(){j=[];for(var a=0;0<=f?af;0<=f?a++:a--)j.push(a);return j}.apply(this).map(function(a){return r(d+a/(f-1)*b)[h]()});if(a=[],k=[],c&&c.length>2)for(e=l=1,i=c.length;1<=i?li;e=1<=i?++l:--l)k.push(.5*(c[e-1]+c[e]));else k=g;return k.map(function(a){return r(a)[h]()})},r},null==s.scales&&(s.scales={}),s.scales.cool=function(){return s.scale([s.hsl(180,1,.9),s.hsl(250,.7,.4)])},s.scales.hot=function(){return s.scale(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")},s.analyze=function(a,b,c){var d,e,f,g,h,i,j;if(h={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0},null==c&&(c=function(){return!0}),d=function(a){null==a||isNaN(a)||(h.values.push(a),h.sum+=a,ah.max&&(h.max=a),h.count+=1)},j=function(a,e){if(c(a,e))return d(null!=b&&"function"===ua(b)?b(a):null!=b&&"string"===ua(b)||"number"===ua(b)?a[b]:a)},"array"===ua(a))for(g=0,f=a.length;g=O;y=1<=O?++K:--K)C.push(E+y/c*(W-E));C.push(W)}else if("l"===b.substr(0,1)){if(E<=0)throw"Logarithmic scales are only possible for values > 0";for(F=Math.LOG10E*T(E),D=Math.LOG10E*T(W),C.push(E),y=ja=1,P=c-1;1<=P?ja<=P:ja>=P;y=1<=P?++ja:--ja)C.push(_(10,F+y/c*(D-F)));C.push(W)}else if("q"===b.substr(0,1)){for(C.push(E),y=d=1,X=c-1;1<=X?d<=X:d>=X;y=1<=X?++d:--d)L=ia.length*y/c,M=B(L),M===L?C.push(ia[M]):(N=L-M,C.push(ia[M]*N+ia[M+1]*(1-N)));C.push(W)}else if("k"===b.substr(0,1)){for(H=ia.length,r=new Array(H),w=new Array(c),ea=!0,I=0,u=null,u=[],u.push(E),y=e=1,Y=c-1;1<=Y?e<=Y:e>=Y;y=1<=Y?++e:--e)u.push(E+y/c*(W-E));for(u.push(W);ea;){for(z=f=0,Z=c-1;0<=Z?f<=Z:f>=Z;z=0<=Z?++f:--f)w[z]=0;for(y=g=0,$=H-1;0<=$?g<=$:g>=$;y=0<=$?++g:--g){for(ha=ia[y],G=Number.MAX_VALUE,z=h=0,aa=c-1;0<=aa?h<=aa:h>=aa;z=0<=aa?++h:--h)x=l(u[z]-ha),x=ba;z=0<=ba?++i:--i)J[z]=null;for(y=j=0,ca=H-1;0<=ca?j<=ca:j>=ca;y=0<=ca?++j:--j)v=r[y],null===J[v]?J[v]=ia[y]:J[v]+=ia[y];for(z=k=0,da=c-1;0<=da?k<=da:k>=da;z=0<=da?++k:--k)J[z]*=1/w[z];for(ea=!1,z=m=0,Q=c-1;0<=Q?m<=Q:m>=Q;z=0<=Q?++m:--m)if(J[z]!==u[y]){ea=!0;break}u=J,I++,I>200&&(ea=!1)}for(A={},z=n=0,R=c-1;0<=R?n<=R:n>=R;z=0<=R?++n:--n)A[z]=[];for(y=o=0,S=H-1;0<=S?o<=S:o>=S;y=0<=S?++o:--o)v=r[y],A[v].push(ia[y]);for(ga=[],z=p=0,U=c-1;0<=U?p<=U:p>=U;z=0<=U?++p:--p)ga.push(A[z][0]),ga.push(A[z][A[z].length-1]);for(ga=ga.sort(function(a,b){return a-b}),C.push(ga[0]),y=q=1,V=ga.length-1;q<=V;y=q+=2)isNaN(ga[y])||C.push(ga[y])}return C},D=function(a,b,c){var d,f,h,i;return d=va(arguments),a=d[0],b=d[1],c=d[2],a/=360,a<1/3?(f=(1-b)/3,i=(1+b*w(g*a)/w(e-g*a))/3,h=1-(f+i)):a<2/3?(a-=1/3,i=(1-b)/3,h=(1+b*w(g*a)/w(e-g*a))/3,f=1-(i+h)):(a-=2/3,h=(1-b)/3,f=(1+b*w(g*a)/w(e-g*a))/3,i=1-(h+f)),i=S(c*i*3),h=S(c*h*3),f=S(c*f*3),[255*i,255*h,255*f,d.length>3?d[3]:1]},da=function(){var a,b,c,d,e,f,h,i;return h=va(arguments),f=h[0],b=h[1],a=h[2],g=2*Math.PI,f/=255,b/=255,a/=255,e=Math.min(f,b,a),d=(f+b+a)/3,i=1-e/d,0===i?c=0:(c=(f-b+(f-a))/2,c/=Math.sqrt((f-b)*(f-b)+(f-a)*(b-a)),c=Math.acos(c),a>b&&(c=g-c),c/=g),[360*c,i,d]},s.hsi=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,za.call(arguments).concat(["hsi"]),function(){})},j.hsi=D,a.prototype.hsi=function(){return da(this._rgb)},I=function(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q;return"hsl"===d?(p=a.hsl(),q=b.hsl()):"hsv"===d?(p=a.hsv(),q=b.hsv()):"hsi"===d?(p=a.hsi(),q=b.hsi()):"lch"!==d&&"hcl"!==d||(d="hcl",p=a.hcl(),q=b.hcl()),"h"===d.substr(0,1)&&(g=p[0],n=p[1],j=p[2],h=q[0],o=q[1],k=q[2]),isNaN(g)||isNaN(h)?isNaN(g)?isNaN(h)?f=Number.NaN:(f=h,1!==j&&0!==j||"hsv"===d||(m=o)):(f=g,1!==k&&0!==k||"hsv"===d||(m=n)):(e=h>g&&h-g>180?h-(g+360):h180?h+360-g:h-g,f=g+c*e),null==m&&(m=n+c*(o-n)),i=j+c*(k-j),l=s[d](f,m,i)},k=k.concat(function(){var a,b,c,d;for(c=["hsv","hsl","hsi","hcl","lch"],d=[],b=0,a=c.length;bd;d++)c=e[d],a["[object "+c+"]"]=c.toLowerCase();return function(b){var c;return c=Object.prototype.toString.call(b),a[c]||"object"}}(),T=function(a,b,c){return null==b&&(b=0),null==c&&(c=1),b>a&&(a=b),a>c&&(a=c),a},xa=function(a){return a.length>=3?[].slice.call(a):a[0]},t=function(a){var b;for(b in a)3>b?(a[b]<0&&(a[b]=0),a[b]>255&&(a[b]=255)):3===b&&(a[b]<0&&(a[b]=0),a[b]>1&&(a[b]=1));return a},d=Math.PI,ra=Math.round,w=Math.cos,B=Math.floor,aa=Math.pow,U=Math.log,ta=Math.sin,ua=Math.sqrt,m=Math.atan2,X=Math.max,l=Math.abs,g=2*d,e=d/3,b=d/180,f=180/d,s=function(){return arguments[0]instanceof a?arguments[0]:function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,arguments,function(){})},k=[],"undefined"!=typeof module&&null!==module&&null!=module.exports&&(module.exports=s),"function"==typeof define&&define.amd?define([],function(){return s}):(qa="undefined"!=typeof exports&&null!==exports?exports:this,qa.chroma=s),s.version="1.2.2",j={},h=[],i=!1,a=function(){function a(){var a,b,c,d,e,f,g,k,l;for(f=this,b=[],k=0,d=arguments.length;d>k;k++)a=arguments[k],null!=a&&b.push(a);if(g=b[b.length-1],null!=j[g])f._rgb=t(j[g](xa(b.slice(0,-1))));else{for(i||(h=h.sort(function(a,b){return b.p-a.p}),i=!0),l=0,e=h.length;e>l&&(c=h[l],!(g=c.test.apply(c,b)));l++);g&&(f._rgb=t(j[g].apply(j,b)))}null==f._rgb&&console.warn("unknown format: "+b),null==f._rgb&&(f._rgb=[0,0,0]),3===f._rgb.length&&f._rgb.push(1)}return a.prototype.toString=function(){return this.name()},a}(),s._input=j,s.brewer=q={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},function(){var a,b;b=[];for(a in q)b.push(q[a.toLowerCase()]=q[a]);return b}(),ya={indigo:"#4b0082",gold:"#ffd700",hotpink:"#ff69b4",firebrick:"#b22222",indianred:"#cd5c5c",yellow:"#ffff00",mistyrose:"#ffe4e1",darkolivegreen:"#556b2f",olive:"#808000",darkseagreen:"#8fbc8f",pink:"#ffc0cb",tomato:"#ff6347",lightcoral:"#f08080",orangered:"#ff4500",navajowhite:"#ffdead",lime:"#00ff00",palegreen:"#98fb98",darkslategrey:"#2f4f4f",greenyellow:"#adff2f",burlywood:"#deb887",seashell:"#fff5ee",mediumspringgreen:"#00fa9a",fuchsia:"#ff00ff",papayawhip:"#ffefd5",blanchedalmond:"#ffebcd",chartreuse:"#7fff00",dimgray:"#696969",black:"#000000",peachpuff:"#ffdab9",springgreen:"#00ff7f",aquamarine:"#7fffd4",white:"#ffffff",orange:"#ffa500",lightsalmon:"#ffa07a",darkslategray:"#2f4f4f",brown:"#a52a2a",ivory:"#fffff0",dodgerblue:"#1e90ff",peru:"#cd853f",lawngreen:"#7cfc00",chocolate:"#d2691e",crimson:"#dc143c",forestgreen:"#228b22",darkgrey:"#a9a9a9",lightseagreen:"#20b2aa",cyan:"#00ffff",mintcream:"#f5fffa",silver:"#c0c0c0",antiquewhite:"#faebd7",mediumorchid:"#ba55d3",skyblue:"#87ceeb",gray:"#808080",darkturquoise:"#00ced1",goldenrod:"#daa520",darkgreen:"#006400",floralwhite:"#fffaf0",darkviolet:"#9400d3",darkgray:"#a9a9a9",moccasin:"#ffe4b5",saddlebrown:"#8b4513",grey:"#808080",darkslateblue:"#483d8b",lightskyblue:"#87cefa",lightpink:"#ffb6c1",mediumvioletred:"#c71585",slategrey:"#708090",red:"#ff0000",deeppink:"#ff1493",limegreen:"#32cd32",darkmagenta:"#8b008b",palegoldenrod:"#eee8aa",plum:"#dda0dd",turquoise:"#40e0d0",lightgrey:"#d3d3d3",lightgoldenrodyellow:"#fafad2",darkgoldenrod:"#b8860b",lavender:"#e6e6fa",maroon:"#800000",yellowgreen:"#9acd32",sandybrown:"#f4a460",thistle:"#d8bfd8",violet:"#ee82ee",navy:"#000080",magenta:"#ff00ff",dimgrey:"#696969",tan:"#d2b48c",rosybrown:"#bc8f8f",olivedrab:"#6b8e23",blue:"#0000ff",lightblue:"#add8e6",ghostwhite:"#f8f8ff",honeydew:"#f0fff0",cornflowerblue:"#6495ed",slateblue:"#6a5acd",linen:"#faf0e6",darkblue:"#00008b",powderblue:"#b0e0e6",seagreen:"#2e8b57",darkkhaki:"#bdb76b",snow:"#fffafa",sienna:"#a0522d",mediumblue:"#0000cd",royalblue:"#4169e1",lightcyan:"#e0ffff",green:"#008000",mediumpurple:"#9370db",midnightblue:"#191970",cornsilk:"#fff8dc",paleturquoise:"#afeeee",bisque:"#ffe4c4",slategray:"#708090",darkcyan:"#008b8b",khaki:"#f0e68c",wheat:"#f5deb3",teal:"#008080",darkorchid:"#9932cc",deepskyblue:"#00bfff",salmon:"#fa8072",darkred:"#8b0000",steelblue:"#4682b4",palevioletred:"#db7093",lightslategray:"#778899",aliceblue:"#f0f8ff",lightslategrey:"#778899",lightgreen:"#90ee90",orchid:"#da70d6",gainsboro:"#dcdcdc",mediumseagreen:"#3cb371",lightgray:"#d3d3d3",mediumturquoise:"#48d1cc",lemonchiffon:"#fffacd",cadetblue:"#5f9ea0",lightyellow:"#ffffe0",lavenderblush:"#fff0f5",coral:"#ff7f50",purple:"#800080",aqua:"#00ffff",whitesmoke:"#f5f5f5",mediumslateblue:"#7b68ee",darkorange:"#ff8c00",mediumaquamarine:"#66cdaa",darksalmon:"#e9967a",beige:"#f5f5dc",blueviolet:"#8a2be2",azure:"#f0ffff",lightsteelblue:"#b0c4de",oldlace:"#fdf5e6",rebeccapurple:"#663399"},s.colors=v=ya,O=function(){var a,b,d,e,f,g,h,i,j;return b=xa(arguments),f=b[0],a=b[1],d=b[2],i=(f+16)/116,h=isNaN(a)?i:i+a/500,j=isNaN(d)?i:i-d/200,i=c.Yn*P(i),h=c.Xn*P(h),j=c.Zn*P(j),g=Aa(3.2404542*h-1.5371385*i-.4985314*j),e=Aa(-.969266*h+1.8760108*i+.041556*j),d=Aa(.0556434*h-.2040259*i+1.0572252*j),g=T(g,0,255),e=T(e,0,255),d=T(d,0,255),[g,e,d,b.length>3?b[3]:1]},Aa=function(a){return ra(255*(.00304>=a?12.92*a:1.055*aa(a,1/2.4)-.055))},P=function(a){return a>c.t1?a*a*a:c.t2*(a-c.t0)},c={Kn:18,Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452},ia=function(){var a,b,c,d,e,f,g,h;return d=xa(arguments),c=d[0],b=d[1],a=d[2],e=na(c,b,a),f=e[0],g=e[1],h=e[2],[116*g-16,500*(f-g),200*(g-h)]},oa=function(a){return(a/=255)<=.04045?a/12.92:aa((a+.055)/1.055,2.4)},za=function(a){return a>c.t3?aa(a,1/3):a/c.t2+c.t0},na=function(){var a,b,d,e,f,g,h;return e=xa(arguments),d=e[0],b=e[1],a=e[2],d=oa(d),b=oa(b),a=oa(a),f=za((.4124564*d+.3575761*b+.1804375*a)/c.Xn),g=za((.2126729*d+.7151522*b+.072175*a)/c.Yn),h=za((.0193339*d+.119192*b+.9503041*a)/c.Zn),[f,g,h]},s.lab=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ba.call(arguments).concat(["lab"]),function(){})},j.lab=O,a.prototype.lab=function(){return ia(this._rgb)},n=function(a){var b,c,d,e,f,g,h,i,j,k,l;return a=function(){var b,c,d;for(d=[],c=0,b=a.length;b>c;c++)e=a[c],d.push(s(e));return d}(),2===a.length?(j=function(){var b,c,d;for(d=[],c=0,b=a.length;b>c;c++)e=a[c],d.push(e.lab());return d}(),f=j[0],g=j[1],b=function(a){var b,c;return c=function(){var c,d;for(d=[],b=c=0;2>=c;b=++c)d.push(f[b]+a*(g[b]-f[b]));return d}(),s.lab.apply(s,c)}):3===a.length?(k=function(){var b,c,d;for(d=[],c=0,b=a.length;b>c;c++)e=a[c],d.push(e.lab());return d}(),f=k[0],g=k[1],h=k[2],b=function(a){var b,c;return c=function(){var c,d;for(d=[],b=c=0;2>=c;b=++c)d.push((1-a)*(1-a)*f[b]+2*(1-a)*a*g[b]+a*a*h[b]);return d}(),s.lab.apply(s,c)}):4===a.length?(l=function(){var b,c,d;for(d=[],c=0,b=a.length;b>c;c++)e=a[c],d.push(e.lab());return d}(),f=l[0],g=l[1],h=l[2],i=l[3],b=function(a){var b,c;return c=function(){var c,d;for(d=[],b=c=0;2>=c;b=++c)d.push((1-a)*(1-a)*(1-a)*f[b]+3*(1-a)*(1-a)*a*g[b]+3*(1-a)*a*a*h[b]+a*a*a*i[b]);return d}(),s.lab.apply(s,c)}):5===a.length&&(c=n(a.slice(0,3)),d=n(a.slice(2,5)),b=function(a){return.5>a?c(2*a):d(2*(a-.5))}),b},s.bezier=function(a){var b;return b=n(a),b.scale=function(){return s.scale(b)},b},s.cubehelix=function(a,b,c,d,e){var f,h,i;return null==a&&(a=300),null==b&&(b=-1.5),null==c&&(c=1),null==d&&(d=1),null==e&&(e=[0,1]),h=e[1]-e[0],f=0,i=function(i){var j,k,l,m,n,o,p,q,r;return j=g*((a+120)/360+b*i),p=aa(e[0]+h*i,d),o=0!==f?c[0]+i*f:c,k=o*p*(1-p)/2,m=w(j),r=ta(j),q=p+k*(-.14861*m+1.78277*r),n=p+k*(-.29227*m-.90649*r),l=p+1.97294*k*m,s(t([255*q,255*n,255*l]))},i.start=function(b){return null==b?a:(a=b,i)},i.rotations=function(a){return null==a?b:(b=a,i)},i.gamma=function(a){return null==a?d:(d=a,i)},i.hue=function(a){return null==a?c:(c=a,"array"===wa(c)?(f=c[1]-c[0],0===f&&(c=c[1])):f=0,i)},i.lightness=function(a){return null==a?e:(e=a,"array"===wa(e)?(h=e[1]-e[0],0===h&&(e=e[1])):h=0,i)},i.scale=function(){return s.scale(i)},i.hue(c),i},s.random=function(){var b,c,d,e;for(c="0123456789abcdef",b="#",d=e=0;6>e;d=++e)b+=c.charAt(B(16*Math.random()));return new a(b)},s.average=function(b){var c,d,e,f,g,h,i,j,k;for(j=f=d=c=0,g=b.length,i=0,h=b.length;h>i;i++)e=b[i],k=s(e).rgba(),j+=k[0],f+=k[1],d+=k[2],c+=k[3];return new a(j/g,f/g,d/g,c/g)},j.rgb=function(){var a,b,c,d;b=xa(arguments),c=[];for(a in b)d=b[a],c.push(d);return c},s.rgb=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ba.call(arguments).concat(["rgb"]),function(){})},a.prototype.rgb=function(){return this._rgb.slice(0,3)},a.prototype.rgba=function(){return this._rgb},h.push({p:15,test:function(a){var b;return b=xa(arguments),"array"===wa(b)&&3===b.length?"rgb":4===b.length&&"number"===wa(b[3])&&b[3]>=0&&b[3]<=1?"rgb":void 0}}),D=function(a){var b,c,d,e,f,g;if(a.match(/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/))return(4===a.length||7===a.length)&&(a=a.substr(1)),3===a.length&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),g=parseInt(a,16),e=g>>16,d=g>>8&255,c=255&g,[e,d,c,1];if(a.match(/^#?([A-Fa-f0-9]{8})$/))return 9===a.length&&(a=a.substr(1)),g=parseInt(a,16),e=g>>24&255,d=g>>16&255,c=g>>8&255,b=ra((255&g)/255*100)/100,[e,d,c,b];if(null!=j.css&&(f=j.css(a)))return f;throw"unknown color: "+a},ea=function(a,b){var c,d,e,f,g,h,i;return null==b&&(b="rgb"),g=a[0],e=a[1],d=a[2],c=a[3],i=g<<16|e<<8|d,h="000000"+i.toString(16),h=h.substr(h.length-6),f="0"+ra(255*c).toString(16),f=f.substr(f.length-2),"#"+function(){switch(b.toLowerCase()){case"rgba":return h+f;case"argb":return f+h;default:return h}}()},j.hex=function(a){return D(a)},s.hex=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ba.call(arguments).concat(["hex"]),function(){})},a.prototype.hex=function(a){return null==a&&(a="rgb"),ea(this._rgb,a)},h.push({p:10,test:function(a){return 1===arguments.length&&"string"===wa(a)?"hex":void 0}}),G=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n;if(a=xa(arguments),e=a[0],k=a[1],g=a[2],0===k)i=d=b=255*g;else{for(n=[0,0,0],c=[0,0,0],m=.5>g?g*(1+k):g+k-g*k,l=2*g-m,e/=360,n[0]=e+1/3,n[1]=e,n[2]=e-1/3,f=h=0;2>=h;f=++h)n[f]<0&&(n[f]+=1),n[f]>1&&(n[f]-=1),6*n[f]<1?c[f]=l+6*(m-l)*n[f]:2*n[f]<1?c[f]=m:3*n[f]<2?c[f]=l+(m-l)*(2/3-n[f])*6:c[f]=l;j=[ra(255*c[0]),ra(255*c[1]),ra(255*c[2])],i=j[0],d=j[1],b=j[2]}return a.length>3?[i,d,b,a[3]]:[i,d,b]},ga=function(a,b,c){var d,e,f,g,h;return void 0!==a&&a.length>=3&&(g=a,a=g[0],b=g[1],c=g[2]),a/=255,b/=255,c/=255,f=Math.min(a,b,c),X=Math.max(a,b,c),e=(X+f)/2,X===f?(h=0,d=Number.NaN):h=.5>e?(X-f)/(X+f):(X-f)/(2-X-f),a===X?d=(b-c)/(X-f):b===X?d=2+(c-a)/(X-f):c===X&&(d=4+(a-b)/(X-f)),d*=60,0>d&&(d+=360),[d,h,e]},s.hsl=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ba.call(arguments).concat(["hsl"]),function(){})},j.hsl=G,a.prototype.hsl=function(){return ga(this._rgb)},H=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;if(a=xa(arguments),e=a[0],p=a[1],r=a[2],r*=255,0===p)i=d=b=r;else switch(360===e&&(e=0),e>360&&(e-=360),0>e&&(e+=360),e/=60,f=B(e),c=e-f,g=r*(1-p),h=r*(1-p*c),q=r*(1-p*(1-c)),f){case 0:j=[r,q,g],i=j[0],d=j[1],b=j[2];break;case 1:k=[h,r,g],i=k[0],d=k[1],b=k[2];break;case 2:l=[g,r,q],i=l[0],d=l[1],b=l[2];break;case 3:m=[g,h,r],i=m[0],d=m[1],b=m[2];break;case 4:n=[q,g,r],i=n[0],d=n[1],b=n[2];break;case 5:o=[r,g,h],i=o[0],d=o[1],b=o[2]}return i=ra(i),d=ra(d),b=ra(b),[i,d,b,a.length>3?a[3]:1]},ha=function(){var a,b,c,d,e,f,g,h,i;return g=xa(arguments),f=g[0],c=g[1],a=g[2],e=Math.min(f,c,a),X=Math.max(f,c,a),b=X-e,i=X/255,0===X?(d=Number.NaN,h=0):(h=b/X,f===X&&(d=(c-a)/b),c===X&&(d=2+(a-f)/b),a===X&&(d=4+(f-c)/b),d*=60,0>d&&(d+=360)),[d,h,i]},s.hsv=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ba.call(arguments).concat(["hsv"]),function(){})},j.hsv=H,a.prototype.hsv=function(){return ha(this._rgb)},$=function(a){var b,c,d;return"number"===wa(a)&&a>=0&&16777215>=a?(d=a>>16,c=a>>8&255,b=255&a,[d,c,b,1]):(console.warn("unknown num color: "+a),[0,0,0,1])},la=function(){var a,b,c,d;return d=xa(arguments),c=d[0],b=d[1],a=d[2],(c<<16)+(b<<8)+a},s.num=function(b){return new a(b,"num")},a.prototype.num=function(a){return null==a&&(a="rgb"),la(this._rgb,a)},j.num=$,h.push({p:10,test:function(a){return 1===arguments.length&&"number"===wa(a)&&a>=0&&16777215>=a?"num":void 0}}),C=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t;if(c=xa(arguments),h=c[0],e=c[1],b=c[2],e/=100,g=g/100*255,a=255*e,0===e)l=g=d=b;else switch(360===h&&(h=0),h>360&&(h-=360),0>h&&(h+=360),h/=60,i=B(h),f=h-i,j=b*(1-e),k=j+a*(1-f),s=j+a*f,t=j+a,i){case 0:m=[t,s,j],l=m[0],g=m[1],d=m[2];break;case 1:n=[k,t,j],l=n[0],g=n[1],d=n[2];break;case 2:o=[j,t,s],l=o[0],g=o[1],d=o[2];break;case 3:p=[j,k,t],l=p[0],g=p[1],d=p[2];break;case 4:q=[s,j,t],l=q[0],g=q[1],d=q[2];break;case 5:r=[t,j,k],l=r[0],g=r[1],d=r[2]}return l=ra(l),g=ra(g),d=ra(d),[l,g,d,c.length>3?c[3]:1]},da=function(){var a,b,c,d,e,f,g,h,i;return i=xa(arguments),h=i[0],e=i[1],b=i[2],g=Math.min(h,e,b),X=Math.max(h,e,b),d=X-g,c=100*d/255,a=g/(255-d)*100,0===d?f=Number.NaN:(h===X&&(f=(e-b)/d),e===X&&(f=2+(b-h)/d),b===X&&(f=4+(h-e)/d),f*=60,0>f&&(f+=360)),[f,c,a]},s.hcg=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ba.call(arguments).concat(["hcg"]),function(){})},j.hcg=C,a.prototype.hcg=function(){return da(this._rgb)},x=function(a){var b,c,d,e,f,g,h,i;if(a=a.toLowerCase(),null!=s.colors&&s.colors[a])return D(s.colors[a]);if(f=a.match(/rgb\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*\)/)){for(h=f.slice(1,4),e=g=0;2>=g;e=++g)h[e]=+h[e];h[3]=1}else if(f=a.match(/rgba\(\s*(\-?\d+),\s*(\-?\d+)\s*,\s*(\-?\d+)\s*,\s*([01]|[01]?\.\d+)\)/))for(h=f.slice(1,5),e=i=0;3>=i;e=++i)h[e]=+h[e];else if(f=a.match(/rgb\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/)){for(h=f.slice(1,4),e=b=0;2>=b;e=++b)h[e]=ra(2.55*h[e]);h[3]=1}else if(f=a.match(/rgba\(\s*(\-?\d+(?:\.\d+)?)%,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/)){for(h=f.slice(1,5),e=c=0;2>=c;e=++c)h[e]=ra(2.55*h[e]);h[3]=+h[3]}else(f=a.match(/hsl\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*\)/))?(d=f.slice(1,4),d[1]*=.01,d[2]*=.01,h=G(d),h[3]=1):(f=a.match(/hsla\(\s*(\-?\d+(?:\.\d+)?),\s*(\-?\d+(?:\.\d+)?)%\s*,\s*(\-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)/))&&(d=f.slice(1,4),d[1]*=.01,d[2]*=.01,h=G(d),h[3]=+f[4]);return h},ca=function(a){var b;return b=a[3]<1?"rgba":"rgb","rgb"===b?b+"("+a.slice(0,3).map(ra).join(",")+")":"rgba"===b?b+"("+a.slice(0,3).map(ra).join(",")+","+a[3]+")":void 0},pa=function(a){return ra(100*a)/100},F=function(a,b){var c;return c=1>b?"hsla":"hsl",a[0]=pa(a[0]||0),a[1]=pa(100*a[1])+"%",a[2]=pa(100*a[2])+"%","hsla"===c&&(a[3]=b),c+"("+a.join(",")+")"},j.css=function(a){return x(a)},s.css=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ba.call(arguments).concat(["css"]),function(){})},a.prototype.css=function(a){return null==a&&(a="rgb"),"rgb"===a.slice(0,3)?ca(this._rgb):"hsl"===a.slice(0,3)?F(this.hsl(),this.alpha()):void 0},j.named=function(a){return D(ya[a])},h.push({p:20,test:function(a){return 1===arguments.length&&null!=ya[a]?"named":void 0}}),a.prototype.name=function(a){var b,c;arguments.length&&(ya[a]&&(this._rgb=D(ya[a])),this._rgb[3]=1),b=this.hex();for(c in ya)if(b===ya[c])return c;return b},Q=function(){var a,c,d,e;return e=xa(arguments),d=e[0],a=e[1],c=e[2],c*=b,[d,w(c)*a,ta(c)*a]},R=function(){var a,b,c,d,e,f,g,h,i,j,k;return c=xa(arguments),h=c[0],e=c[1],g=c[2],j=Q(h,e,g),a=j[0],b=j[1],d=j[2],k=O(a,b,d),i=k[0],f=k[1],d=k[2],[T(i,0,255),T(f,0,255),T(d,0,255),c.length>3?c[3]:1]},N=function(){var a,b,c,d,e,g;return g=xa(arguments),e=g[0],a=g[1],b=g[2],c=ua(a*a+b*b),d=(m(b,a)*f+360)%360,0===ra(1e4*c)&&(d=Number.NaN),[e,c,d]},ja=function(){var a,b,c,d,e,f,g;return f=xa(arguments),e=f[0],c=f[1],b=f[2],g=ia(e,c,b),d=g[0],a=g[1],b=g[2],N(d,a,b)},s.lch=function(){var b;return b=xa(arguments),new a(b,"lch")},s.hcl=function(){var b;return b=xa(arguments),new a(b,"hcl")},j.lch=R,j.hcl=function(){var a,b,c,d;return d=xa(arguments),b=d[0],a=d[1],c=d[2],R([c,a,b])},a.prototype.lch=function(){return ja(this._rgb)},a.prototype.hcl=function(){return ja(this._rgb).reverse()},ba=function(a){var b,c,d,e,f,g,h,i,j;return null==a&&(a="rgb"),i=xa(arguments),h=i[0],e=i[1],b=i[2],h/=255,e/=255,b/=255,f=1-Math.max(h,Math.max(e,b)),d=1>f?1/(1-f):0,c=(1-h-f)*d,g=(1-e-f)*d,j=(1-b-f)*d,[c,g,j,f]},u=function(){var a,b,c,d,e,f,g,h,i;return b=xa(arguments),d=b[0],g=b[1],i=b[2],f=b[3],a=b.length>4?b[4]:1,1===f?[0,0,0,a]:(h=d>=1?0:ra(255*(1-d)*(1-f)),e=g>=1?0:ra(255*(1-g)*(1-f)),c=i>=1?0:ra(255*(1-i)*(1-f)),[h,e,c,a])},j.cmyk=function(){return u(xa(arguments))},s.cmyk=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ba.call(arguments).concat(["cmyk"]),function(){})},a.prototype.cmyk=function(){return ba(this._rgb)},j.gl=function(){var a,b,c,d,e;for(d=function(){var a,c;a=xa(arguments),c=[];for(b in a)e=a[b],c.push(e);return c}.apply(this,arguments),a=c=0;2>=c;a=++c)d[a]*=255;return d},s.gl=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ba.call(arguments).concat(["gl"]),function(){})},a.prototype.gl=function(){var a;return a=this._rgb,[a[0]/255,a[1]/255,a[2]/255,a[3]]},ka=function(a,b,c){var d;return d=xa(arguments),a=d[0],b=d[1],c=d[2],a=V(a),b=V(b),c=V(c),.2126*a+.7152*b+.0722*c},V=function(a){return a/=255,.03928>=a?a/12.92:aa((a+.055)/1.055,2.4)},k=[],I=function(a,b,c,d){var e,f,g,h;for(null==c&&(c=.5),null==d&&(d="rgb"),"object"!==wa(a)&&(a=s(a)),"object"!==wa(b)&&(b=s(b)),g=0,f=k.length;f>g;g++)if(e=k[g],d===e[0]){h=e[1](a,b,c,d);break}if(null==h)throw"color mode "+d+" is not supported";return h.alpha(a.alpha()+c*(b.alpha()-a.alpha()))},s.interpolate=I,a.prototype.interpolate=function(a,b,c){return I(this,a,b,c)},s.mix=I,a.prototype.mix=a.prototype.interpolate,M=function(b,c,d,e){var f,g;return f=b._rgb,g=c._rgb,new a(f[0]+d*(g[0]-f[0]),f[1]+d*(g[1]-f[1]),f[2]+d*(g[2]-f[2]),e)},k.push(["rgb",M]),a.prototype.luminance=function(a,b){var c,d,e,f;return null==b&&(b="rgb"),arguments.length?(0===a?this._rgb=[0,0,0,this._rgb[3]]:1===a?this._rgb=[255,255,255,this._rgb[3]]:(d=1e-7,e=20,f=function(c,g){var h,i;return i=c.interpolate(g,.5,b),h=i.luminance(),Math.abs(a-h)a?f(c,i):f(i,g)},c=ka(this._rgb),this._rgb=(c>a?f(s("black"),this):f(this,s("white"))).rgba()),this):ka(this._rgb)},va=function(a){var b,c,d,e;return e=a/100,66>e?(d=255,c=-155.25485562709179-.44596950469579133*(c=e-2)+104.49216199393888*U(c),b=20>e?0:-254.76935184120902+.8274096064007395*(b=e-10)+115.67994401066147*U(b)):(d=351.97690566805693+.114206453784165*(d=e-55)-40.25366309332127*U(d),c=325.4494125711974+.07943456536662342*(c=e-50)-28.0852963507957*U(c),b=255),t([d,c,b])},ma=function(){var a,b,c,d,e,f,g,h,i;for(g=xa(arguments),f=g[0],c=g[1],a=g[2],e=1e3,d=4e4,b=.4;d-e>b;)i=.5*(d+e),h=va(i),h[2]/h[0]>=a/f?d=i:e=i;return ra(i)},s.temperature=s.kelvin=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ba.call(arguments).concat(["temperature"]),function(){})},j.temperature=j.kelvin=j.K=va,a.prototype.temperature=function(){return ma(this._rgb)},a.prototype.kelvin=a.prototype.temperature,s.contrast=function(b,c){var d,e,f,g;return("string"===(f=wa(b))||"number"===f)&&(b=new a(b)),("string"===(g=wa(c))||"number"===g)&&(c=new a(c)),d=b.luminance(),e=c.luminance(),d>e?(d+.05)/(e+.05):(e+.05)/(d+.05)},a.prototype.get=function(a){var b,c,d,e,f,g;return d=this,f=a.split("."),e=f[0],b=f[1],g=d[e](),b?(c=e.indexOf(b),c>-1?g[c]:console.warn("unknown channel "+b+" in mode "+e)):g},a.prototype.set=function(a,b){var c,d,e,f,g,h;if(e=this,g=a.split("."),f=g[0],c=g[1],c)if(h=e[f](),d=f.indexOf(c),d>-1)if("string"===wa(b))switch(b.charAt(0)){case"+":h[d]+=+b;break;case"-":h[d]+=+b;break;case"*":h[d]*=+b.substr(1);break;case"/":h[d]/=+b.substr(1);break;default:h[d]=+b}else h[d]=b;else console.warn("unknown channel "+c+" in mode "+f);else h=b;return e._rgb=s(h,f).alpha(e.alpha())._rgb,e},a.prototype.alpha=function(a){var b,c,d;return arguments.length?(d=this._rgb[0],c=this._rgb[1],b=this._rgb[2],s.rgb([d,c,b,a])):this._rgb[3]},a.prototype.darken=function(a){var b,d;return null==a&&(a=1),d=this,b=d.lab(),b[0]-=c.Kn*a,s.lab(b).alpha(d.alpha())},a.prototype.brighten=function(a){return null==a&&(a=1),this.darken(-a)},a.prototype.darker=a.prototype.darken,a.prototype.brighter=a.prototype.brighten,a.prototype.saturate=function(a){var b,d;return null==a&&(a=1),d=this,b=d.lch(),b[1]+=a*c.Kn,b[1]<0&&(b[1]=0),s.lch(b).alpha(d.alpha())},a.prototype.desaturate=function(a){return null==a&&(a=1),this.saturate(-a)},a.prototype.premultiply=function(){var a,b;return b=this.rgb(),a=this.alpha(),s(b[0]*a,b[1]*a,b[2]*a,a)},o=function(a,b,c){if(!o[c])throw"unknown blend mode "+c;return o[c](a,b)},p=function(a){return function(b,c){var d,e;return d=s(c).rgb(),e=s(b).rgb(),s(a(d,e),"rgb")}},A=function(a){return function(b,c){var d,e,f;for(f=[],d=e=0;3>=e;d=++e)f[d]=a(b[d],c[d]);return f}},Z=function(a,b){return a},Y=function(a,b){return a*b/255},y=function(a,b){return a>b?b:a},S=function(a,b){return a>b?a:b},sa=function(a,b){return 255*(1-(1-a/255)*(1-b/255))},_=function(a,b){return 128>b?2*a*b/255:255*(1-2*(1-a/255)*(1-b/255))},r=function(a,b){return 255*(1-(1-b/255)/(a/255))},z=function(a,b){return 255===a?255:(a=255*(b/255)/(1-a/255),a>255?255:a)},o.normal=p(A(Z)),o.multiply=p(A(Y)),o.screen=p(A(sa)),o.overlay=p(A(_)),o.darken=p(A(y)),o.lighten=p(A(S)),o.dodge=p(A(z)),o.burn=p(A(r)),s.blend=o,s.analyze=function(a){var b,c,d,e;for(d={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0},c=0,b=a.length;b>c;c++)e=a[c],null==e||isNaN(e)||(d.values.push(e),d.sum+=e,ed.max&&(d.max=e),d.count+=1);return d.domain=[d.min,d.max],d.limits=function(a,b){return s.limits(d,a,b)},d},s.scale=function(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,t,u,v,w,x;return k="rgb",l=s("#ccc"),p=0,h=!1,g=[0,1],o=[],n=[0,0],c=!1,e=[],m=!1,j=0,i=1,f=!1,d={},w=function(a){var b,c,d,f,g,h;if(null==a&&(a=["#fff","#000"]),null!=a&&"string"===wa(a)&&null!=s.brewer&&(a=s.brewer[a]||s.brewer[a.toLowerCase()]||a),"array"===wa(a)){for(a=a.slice(0),b=d=0,f=a.length-1;f>=0?f>=d:d>=f;b=f>=0?++d:--d)c=a[b],"string"===wa(c)&&(a[b]=s(c));for(o.length=0,b=h=0,g=a.length-1;g>=0?g>=h:h>=g;b=g>=0?++h:--h)o.push(b/(a.length-1))}return v(),e=a},t=function(a){var b,d;if(null!=c){for(d=c.length-1,b=0;d>b&&a>=c[b];)b++;return b-1}return 0},x=function(a){return a},q=function(a){var b,d,e,f,g;return g=a,c.length>2&&(f=c.length-1,b=t(a),e=c[0]+(c[1]-c[0])*(0+.5*p),d=c[f-1]+(c[f]-c[f-1])*(1-.5*p),g=j+(c[b]+.5*(c[b+1]-c[b])-e)/(d-e)*(i-j)),g},u=function(a,b){var f,g,h,m,p,q,r,u;if(null==b&&(b=!1),isNaN(a))return l;if(b?u=a:c&&c.length>2?(f=t(a),u=f/(c.length-2),u=n[0]+u*(1-n[0]-n[1])):i!==j?(u=(a-j)/(i-j),u=n[0]+u*(1-n[0]-n[1]),u=Math.min(1,Math.max(0,u))):u=1,b||(u=x(u)),m=Math.floor(1e4*u),d[m])g=d[m];else{if("array"===wa(e))for(h=p=0,r=o.length-1;r>=0?r>=p:p>=r;h=r>=0?++p:--p){if(q=o[h],q>=u){g=e[h];break}if(u>=q&&h===o.length-1){g=e[h];break}if(u>q&&uh;h++)c=a[h],o.push((c-j)/(i-j));else for(b=l=0,k=d-1;k>=0?k>=l:l>=k;b=k>=0?++l:--l)o.push(b/(d-1));return g=[j,i],r},r.mode=function(a){return arguments.length?(k=a,v(),r):k},r.range=function(a,b){return w(a,b),r},r.out=function(a){return m=a,r},r.spread=function(a){return arguments.length?(p=a,r):p},r.correctLightness=function(a){return null==a&&(a=!0),f=a,v(),x=f?function(a){var b,c,d,e,f,g,h,i,j;for(b=u(0,!0).lab()[0],c=u(1,!0).lab()[0],h=b>c,d=u(a,!0).lab()[0],f=b+(c-b)*a,e=d-f,i=0,j=1,g=20;Math.abs(e)>.01&&g-->0;)!function(){return h&&(e*=-1),0>e?(i=a,a+=.5*(j-a)):(j=a,a+=.5*(i-a)),d=u(a,!0).lab()[0],e=d-f}();return a}:function(a){return a},r},r.padding=function(a){return null!=a?("number"===wa(a)&&(a=[a,a]),n=a,r):n},r.colors=function(){var b,d,f,h,i,j,k,l,m;if(h=0,i="hex",0===arguments.length)return e.map(function(a){return a[i]()});if(1===arguments.length&&("string"===wa(arguments[0])?i=arguments[0]:h=arguments[0]),2===arguments.length&&(h=arguments[0],i=arguments[1]),h)return d=g[0],b=g[1]-d,function(){k=[];for(var a=0;h>=0?h>a:a>h;h>=0?a++:a--)k.push(a);return k}.apply(this).map(function(a){return r(d+a/(h-1)*b)[i]()});if(a=[],l=[],c&&c.length>2)for(f=m=1,j=c.length;j>=1?j>m:m>j;f=j>=1?++m:--m)l.push(.5*(c[f-1]+c[f]));else l=g;return l.map(function(a){return r(a)[i]()})},r},null==s.scales&&(s.scales={}),s.scales.cool=function(){return s.scale([s.hsl(180,1,.9),s.hsl(250,.7,.4)])},s.scales.hot=function(){return s.scale(["#000","#f00","#ff0","#fff"],[0,.25,.75,1]).mode("rgb")},s.analyze=function(a,b,c){var d,e,f,g,h,i,j;if(h={min:Number.MAX_VALUE,max:-1*Number.MAX_VALUE,sum:0,values:[],count:0},null==c&&(c=function(){return!0}),d=function(a){null==a||isNaN(a)||(h.values.push(a),h.sum+=a,ah.max&&(h.max=a),h.count+=1)},j=function(a,e){return c(a,e)?d(null!=b&&"function"===wa(b)?b(a):null!=b&&"string"===wa(b)||"number"===wa(b)?a[b]:a):void 0},"array"===wa(a))for(g=0,f=a.length;f>g;g++)i=a[g],j(i);else for(e in a)i=a[e],j(i,e);return h.domain=[h.min,h.max],h.limits=function(a,b){return s.limits(h,a,b)},h},s.limits=function(a,b,c){var d,e,f,g,h,i,j,k,m,n,o,p,q,r,t,u,v,w,x,y,z,A,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,V,W,Y,Z,$,_,ba,ca,da,ea,fa,ga,ha,ia,ja;if(null==b&&(b="equal"),null==c&&(c=7),"array"===wa(a)&&(a=s.analyze(a)),E=a.min,X=a.max,fa=a.sum,ia=a.values.sort(function(a,b){return a-b}),C=[],"c"===b.substr(0,1)&&(C.push(E),C.push(X)),"e"===b.substr(0,1)){for(C.push(E),y=K=1,O=c-1;O>=1?O>=K:K>=O;y=O>=1?++K:--K)C.push(E+y/c*(X-E));C.push(X)}else if("l"===b.substr(0,1)){if(0>=E)throw"Logarithmic scales are only possible for values > 0";for(F=Math.LOG10E*U(E),D=Math.LOG10E*U(X),C.push(E),y=ja=1,P=c-1;P>=1?P>=ja:ja>=P;y=P>=1?++ja:--ja)C.push(aa(10,F+y/c*(D-F)));C.push(X)}else if("q"===b.substr(0,1)){for(C.push(E),y=d=1,W=c-1;W>=1?W>=d:d>=W;y=W>=1?++d:--d)L=ia.length*y/c,M=B(L),M===L?C.push(ia[M]):(N=L-M,C.push(ia[M]*N+ia[M+1]*(1-N)));C.push(X)}else if("k"===b.substr(0,1)){for(H=ia.length,r=new Array(H),w=new Array(c),ea=!0,I=0,u=null,u=[],u.push(E),y=e=1,Y=c-1;Y>=1?Y>=e:e>=Y;y=Y>=1?++e:--e)u.push(E+y/c*(X-E));for(u.push(X);ea;){for(z=f=0,Z=c-1;Z>=0?Z>=f:f>=Z;z=Z>=0?++f:--f)w[z]=0;for(y=g=0,$=H-1;$>=0?$>=g:g>=$;y=$>=0?++g:--g){for(ha=ia[y],G=Number.MAX_VALUE,z=h=0,_=c-1;_>=0?_>=h:h>=_;z=_>=0?++h:--h)x=l(u[z]-ha),G>x&&(G=x,t=z);w[t]++,r[y]=t}for(J=new Array(c),z=i=0,ba=c-1;ba>=0?ba>=i:i>=ba;z=ba>=0?++i:--i)J[z]=null;for(y=j=0,ca=H-1;ca>=0?ca>=j:j>=ca;y=ca>=0?++j:--j)v=r[y],null===J[v]?J[v]=ia[y]:J[v]+=ia[y];for(z=k=0,da=c-1;da>=0?da>=k:k>=da;z=da>=0?++k:--k)J[z]*=1/w[z];for(ea=!1,z=m=0,Q=c-1;Q>=0?Q>=m:m>=Q;z=Q>=0?++m:--m)if(J[z]!==u[y]){ea=!0;break}u=J,I++,I>200&&(ea=!1)}for(A={},z=n=0,R=c-1;R>=0?R>=n:n>=R;z=R>=0?++n:--n)A[z]=[];for(y=o=0,S=H-1;S>=0?S>=o:o>=S;y=S>=0?++o:--o)v=r[y],A[v].push(ia[y]);for(ga=[],z=p=0,T=c-1;T>=0?T>=p:p>=T;z=T>=0?++p:--p)ga.push(A[z][0]),ga.push(A[z][A[z].length-1]);for(ga=ga.sort(function(a,b){return a-b}),C.push(ga[0]),y=q=1,V=ga.length-1;V>=q;y=q+=2)isNaN(ga[y])||C.push(ga[y])}return C},E=function(a,b,c){var d,f,h,i;return d=xa(arguments),a=d[0],b=d[1],c=d[2],a/=360,1/3>a?(f=(1-b)/3,i=(1+b*w(g*a)/w(e-g*a))/3,h=1-(f+i)):2/3>a?(a-=1/3,
+i=(1-b)/3,h=(1+b*w(g*a)/w(e-g*a))/3,f=1-(i+h)):(a-=2/3,h=(1-b)/3,f=(1+b*w(g*a)/w(e-g*a))/3,i=1-(h+f)),i=T(c*i*3),h=T(c*h*3),f=T(c*f*3),[255*i,255*h,255*f,d.length>3?d[3]:1]},fa=function(){var a,b,c,d,e,f,h,i;return h=xa(arguments),f=h[0],b=h[1],a=h[2],g=2*Math.PI,f/=255,b/=255,a/=255,e=Math.min(f,b,a),d=(f+b+a)/3,i=1-e/d,0===i?c=0:(c=(f-b+(f-a))/2,c/=Math.sqrt((f-b)*(f-b)+(f-a)*(b-a)),c=Math.acos(c),a>b&&(c=g-c),c/=g),[360*c,i,d]},s.hsi=function(){return function(a,b,c){c.prototype=a.prototype;var d=new c,e=a.apply(d,b);return Object(e)===e?e:d}(a,Ba.call(arguments).concat(["hsi"]),function(){})},j.hsi=E,a.prototype.hsi=function(){return fa(this._rgb)},J=function(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q;return"hsl"===d?(p=a.hsl(),q=b.hsl()):"hsv"===d?(p=a.hsv(),q=b.hsv()):"hcg"===d?(p=a.hcg(),q=b.hcg()):"hsi"===d?(p=a.hsi(),q=b.hsi()):("lch"===d||"hcl"===d)&&(d="hcl",p=a.hcl(),q=b.hcl()),"h"===d.substr(0,1)&&(g=p[0],n=p[1],j=p[2],h=q[0],o=q[1],k=q[2]),isNaN(g)||isNaN(h)?isNaN(g)?isNaN(h)?f=Number.NaN:(f=h,1!==j&&0!==j||"hsv"===d||(m=o)):(f=g,1!==k&&0!==k||"hsv"===d||(m=n)):(e=h>g&&h-g>180?h-(g+360):g>h&&g-h>180?h+360-g:h-g,f=g+c*e),null==m&&(m=n+c*(o-n)),i=j+c*(k-j),l=s[d](f,m,i)},k=k.concat(function(){var a,b,c,d;for(c=["hsv","hsl","hsi","hcl","lch","hcg"],d=[],b=0,a=c.length;a>b;b++)W=c[b],d.push([W,J]);return d}()),L=function(a,b,c,d){var e,f;return e=a.num(),f=b.num(),s.num(e+(f-e)*c,"num")},k.push(["num",L]),K=function(b,c,d,e){var f,g,h;return g=b.lab(),h=c.lab(),f=new a(g[0]+d*(h[0]-g[0]),g[1]+d*(h[1]-g[1]),g[2]+d*(h[2]-g[2]),e)},k.push(["lab",K])}).call(this);
\ No newline at end of file
diff --git a/dkan/libraries/chroma/package.json b/dkan/libraries/chroma/package.json
index 59f0fd387..972a2b120 100644
--- a/dkan/libraries/chroma/package.json
+++ b/dkan/libraries/chroma/package.json
@@ -1,7 +1,7 @@
{
"name": "chroma-js",
"description": "JavaScript library for color conversions",
- "version": "1.2.1",
+ "version": "1.2.2",
"author": "Gregor Aisch",
"homepage": "https://github.com/gka/chroma.js",
"keywords": [
diff --git a/dkan/libraries/chroma/src/color.coffee b/dkan/libraries/chroma/src/color.coffee
index d9fb14a9c..06e9a7ffe 100644
--- a/dkan/libraries/chroma/src/color.coffee
+++ b/dkan/libraries/chroma/src/color.coffee
@@ -70,12 +70,6 @@ class Color
# add alpha
me._rgb.push 1 if me._rgb.length == 3
- alpha: (alpha) ->
- if arguments.length
- @_rgb[3] = alpha
- return @
- @_rgb[3]
-
toString: ->
@name()
diff --git a/dkan/libraries/chroma/src/colors/colorbrewer.coffee b/dkan/libraries/chroma/src/colors/colorbrewer.coffee
index 04a2f9e0e..62991875f 100644
--- a/dkan/libraries/chroma/src/colors/colorbrewer.coffee
+++ b/dkan/libraries/chroma/src/colors/colorbrewer.coffee
@@ -38,6 +38,7 @@ chroma.brewer = brewer =
PuRd: ['#f7f4f9', '#e7e1ef', '#d4b9da', '#c994c7', '#df65b0', '#e7298a', '#ce1256', '#980043', '#67001f']
Blues: ['#f7fbff', '#deebf7', '#c6dbef', '#9ecae1', '#6baed6', '#4292c6', '#2171b5', '#08519c', '#08306b']
PuBuGn: ['#fff7fb', '#ece2f0', '#d0d1e6', '#a6bddb', '#67a9cf', '#3690c0', '#02818a', '#016c59', '#014636']
+ Viridis: ['#440154', '#482777', '#3f4a8a', '#31678e', '#26838f', '#1f9d8a', '#6cce5a', '#b6de2b', '#fee825']
# diverging
@@ -61,3 +62,6 @@ chroma.brewer = brewer =
Paired: ['#a6cee3', '#1f78b4', '#b2df8a', '#33a02c', '#fb9a99', '#e31a1c', '#fdbf6f', '#ff7f00', '#cab2d6', '#6a3d9a', '#ffff99', '#b15928']
Pastel2: ['#b3e2cd', '#fdcdac', '#cbd5e8', '#f4cae4', '#e6f5c9', '#fff2ae', '#f1e2cc', '#cccccc']
Pastel1: ['#fbb4ae', '#b3cde3', '#ccebc5', '#decbe4', '#fed9a6', '#ffffcc', '#e5d8bd', '#fddaec', '#f2f2f2']
+
+# add lowercase aliases for case-insensitive matches
+do -> brewer[key.toLowerCase()] = brewer[key] for key of brewer
diff --git a/dkan/libraries/chroma/src/converter/in/hcg2rgb.coffee b/dkan/libraries/chroma/src/converter/in/hcg2rgb.coffee
new file mode 100644
index 000000000..f42f5686d
--- /dev/null
+++ b/dkan/libraries/chroma/src/converter/in/hcg2rgb.coffee
@@ -0,0 +1,31 @@
+
+hcg2rgb = () ->
+ args = unpack arguments
+ [h,c,_g] = args
+ c = c / 100
+ g = g / 100 * 255
+ _c = c * 255
+ if c is 0
+ r = g = b = _g
+ else
+ h = 0 if h is 360
+ h -= 360 if h > 360
+ h += 360 if h < 0
+ h /= 60
+ i = floor h
+ f = h - i
+ p = _g * (1 - c)
+ q = p + _c * (1 - f)
+ t = p + _c * f
+ v = p + _c
+ switch i
+ when 0 then [r,g,b] = [v, t, p]
+ when 1 then [r,g,b] = [q, v, p]
+ when 2 then [r,g,b] = [p, v, t]
+ when 3 then [r,g,b] = [p, q, v]
+ when 4 then [r,g,b] = [t, p, v]
+ when 5 then [r,g,b] = [v, p, q]
+ r = round r
+ g = round g
+ b = round b
+ [r, g, b, if args.length > 3 then args[3] else 1]
\ No newline at end of file
diff --git a/dkan/libraries/chroma/src/converter/out/rgb2hcg.coffee b/dkan/libraries/chroma/src/converter/out/rgb2hcg.coffee
new file mode 100644
index 000000000..cf8d5add0
--- /dev/null
+++ b/dkan/libraries/chroma/src/converter/out/rgb2hcg.coffee
@@ -0,0 +1,17 @@
+
+rgb2hcg = () ->
+ [r,g,b] = unpack arguments
+ min = Math.min(r, g, b)
+ max = Math.max(r, g, b)
+ delta = max - min
+ c = delta * 100 / 255
+ _g = min / (255 - delta) * 100
+ if delta == 0
+ h = Number.NaN
+ else
+ if r is max then h = (g - b) / delta
+ if g is max then h = 2+(b - r) / delta
+ if b is max then h = 4+(r - g) / delta
+ h *= 60
+ if h < 0 then h += 360
+ [h, c, _g]
diff --git a/dkan/libraries/chroma/src/index.coffee b/dkan/libraries/chroma/src/index.coffee
index c72af21c6..4481c6762 100644
--- a/dkan/libraries/chroma/src/index.coffee
+++ b/dkan/libraries/chroma/src/index.coffee
@@ -12,7 +12,7 @@
random
average
- rgb hex hsl hsv num
+ rgb hex hsl hsv num hcg
css named
lch lab
cmyk
@@ -23,7 +23,7 @@
get set
- darken saturate premultiply blend
+ alpha darken saturate premultiply blend
scale
limits
diff --git a/dkan/libraries/chroma/src/interpolator/interpolate-hsx.coffee b/dkan/libraries/chroma/src/interpolator/interpolate-hsx.coffee
index 469b2a0b5..eae6a730c 100644
--- a/dkan/libraries/chroma/src/interpolator/interpolate-hsx.coffee
+++ b/dkan/libraries/chroma/src/interpolator/interpolate-hsx.coffee
@@ -1,4 +1,4 @@
-# @requires interpolate hsl hsv hsi lch
+# @requires interpolate hsl hsv hsi lch hcg
interpolate_hsx = (col1, col2, f, m) ->
if m == 'hsl'
@@ -7,6 +7,9 @@ interpolate_hsx = (col1, col2, f, m) ->
else if m == 'hsv'
xyz0 = col1.hsv()
xyz1 = col2.hsv()
+ else if m == 'hcg'
+ xyz0 = col1.hcg()
+ xyz1 = col2.hcg()
else if m == 'hsi'
xyz0 = col1.hsi()
xyz1 = col2.hsi()
@@ -41,4 +44,4 @@ interpolate_hsx = (col1, col2, f, m) ->
res = chroma[m](hue, sat, lbv)
-_interpolators = _interpolators.concat ([m, interpolate_hsx] for m in ['hsv','hsl','hsi','hcl','lch'])
+_interpolators = _interpolators.concat ([m, interpolate_hsx] for m in ['hsv','hsl','hsi','hcl','lch','hcg'])
diff --git a/dkan/libraries/chroma/src/interpolator/interpolate.coffee b/dkan/libraries/chroma/src/interpolator/interpolate.coffee
index 90c79c21b..292dea981 100644
--- a/dkan/libraries/chroma/src/interpolator/interpolate.coffee
+++ b/dkan/libraries/chroma/src/interpolator/interpolate.coffee
@@ -23,8 +23,7 @@ interpolate = (col1, col2, f=0.5, m='rgb') ->
throw "color mode "+m+" is not supported" if not res?
# interpolate alpha at last
- res.alpha col1.alpha() + f * (col2.alpha() - col1.alpha())
- res
+ return res.alpha col1.alpha() + f * (col2.alpha() - col1.alpha())
chroma.interpolate = interpolate
@@ -32,4 +31,4 @@ Color::interpolate = (col2, f, m) ->
interpolate @, col2, f, m
chroma.mix = interpolate
-Color::mix = Color::interpolate
\ No newline at end of file
+Color::mix = Color::interpolate
diff --git a/dkan/libraries/chroma/src/io/hcg.coffee b/dkan/libraries/chroma/src/io/hcg.coffee
new file mode 100644
index 000000000..2a814d41a
--- /dev/null
+++ b/dkan/libraries/chroma/src/io/hcg.coffee
@@ -0,0 +1,9 @@
+# @require utils hcg2rgb rgb2hcg
+
+chroma.hcg = () ->
+ new Color arguments..., 'hcg'
+
+_input.hcg = hcg2rgb
+
+Color::hcg = () ->
+ rgb2hcg @_rgb
\ No newline at end of file
diff --git a/dkan/libraries/chroma/src/ops/alpha.coffee b/dkan/libraries/chroma/src/ops/alpha.coffee
new file mode 100644
index 000000000..32abca826
--- /dev/null
+++ b/dkan/libraries/chroma/src/ops/alpha.coffee
@@ -0,0 +1,9 @@
+# @require color
+
+Color::alpha = (a) ->
+ if arguments.length
+ r = @_rgb[0]
+ g = @_rgb[1]
+ b = @_rgb[2]
+ return chroma.rgb([r, g, b, a])
+ @_rgb[3]
diff --git a/dkan/libraries/chroma/src/scale.coffee b/dkan/libraries/chroma/src/scale.coffee
index 2bd0f9781..efb453023 100644
--- a/dkan/libraries/chroma/src/scale.coffee
+++ b/dkan/libraries/chroma/src/scale.coffee
@@ -26,8 +26,8 @@ chroma.scale = (colors, positions) ->
setColors = (colors) ->
if not colors?
colors = ['#fff', '#000']
- if colors? and type(colors) == 'string' and chroma.brewer?[colors]?
- colors = chroma.brewer[colors]
+ if colors? and type(colors) == 'string' and chroma.brewer?
+ colors = chroma.brewer[colors] || chroma.brewer[colors.toLowerCase()] || colors
if type(colors) == 'array'
# make a copy of the colors
colors = colors.slice(0)
@@ -213,6 +213,11 @@ chroma.scale = (colors, positions) ->
f.colors = () ->
numColors = 0
out = 'hex'
+
+ # If no arguments are given, return the original colors that were provided
+ if arguments.length == 0
+ return _colors.map (c) -> c[out]()
+
if arguments.length == 1
if type(arguments[0]) == 'string'
out = arguments[0]
@@ -220,12 +225,12 @@ chroma.scale = (colors, positions) ->
numColors = arguments[0]
if arguments.length == 2
[numColors, out] = arguments
-
+
if numColors
dm = _domain[0]
dd = _domain[1] - dm
return [0...numColors].map (i) -> f( dm + i/(numColors-1) * dd )[out]()
-
+
# returns all colors based on the defined classes
colors = []
samples = []
@@ -234,6 +239,7 @@ chroma.scale = (colors, positions) ->
samples.push (_classes[i-1]+_classes[i])*0.5
else
samples = _domain
+
samples.map (v) -> f(v)[out]()
f
diff --git a/dkan/libraries/chroma/test/alpha-test.coffee b/dkan/libraries/chroma/test/alpha-test.coffee
index b6ce5a510..7e115eb5b 100644
--- a/dkan/libraries/chroma/test/alpha-test.coffee
+++ b/dkan/libraries/chroma/test/alpha-test.coffee
@@ -11,14 +11,14 @@ vows
'setting & getting alpha channel':
topic: chroma 'red'
- 'default alpha is 1': (topic) -> assert.equal topic.alpha(), 1
- 'setting alpha to 0.5': (topic) -> assert.equal topic.alpha(0.5), topic
- 'alpha is now 0.5': (topic) -> assert.equal topic.alpha(), 0.5
+ 'no arguments gets alpha': (topic) -> assert.equal topic.alpha(), 1
+ 'setting alpha to 0.5': (topic) -> assert.equal topic.alpha(0.5).alpha(), 0.5
+ 'alpha is unchanged': (topic) -> assert.equal topic.alpha(), 1
'interpolating alpha channel':
topic: chroma.mix chroma('white').alpha(0), chroma('black').alpha(1), 0.3
'color is grey': (topic) -> assert.equal topic.hex(), '#b2b2b2'
- 'alpha is 50%': (topic) -> assert.equal topic.alpha(), 0.3
+ 'alpha is 30%': (topic) -> assert.equal topic.alpha(), 0.3
'constructing rgba color':
topic: new chroma 255,0,0,0.5,'rgb'
diff --git a/dkan/libraries/chroma/test/scales-test.coffee b/dkan/libraries/chroma/test/scales-test.coffee
index efa7bdcda..d6b8501b3 100644
--- a/dkan/libraries/chroma/test/scales-test.coffee
+++ b/dkan/libraries/chroma/test/scales-test.coffee
@@ -54,6 +54,13 @@ vows
'mid gray': (topic) -> assert.equal topic.f(50).hex(), '#ffffbf'
'ends black': (topic) -> assert.equal topic.f(100).hex(), '#006837'
+ 'colorbrewer scale - lowercase':
+ topic:
+ f: chroma.scale 'rdylgn'
+ 'starts white': (topic) -> assert.equal topic.f(0).hex(), '#a50026'
+ 'mid gray': (topic) -> assert.equal topic.f(0.5).hex(), '#ffffbf'
+ 'ends black': (topic) -> assert.equal topic.f(1).hex(), '#006837'
+
'colorbrewer scale - domained - classified':
topic:
f: chroma.scale('RdYlGn').domain([0, 100]).classes(5)
@@ -112,6 +119,11 @@ vows
'five hex colors': (topic) -> assert.deepEqual topic.f.colors(5), ['#ffff00', '#bfd800', '#7fb100', '#3f8a00', '#006400']
'three css colors': (topic) -> assert.deepEqual topic.f.colors(3,'css'), ['rgb(255,255,0)', 'rgb(128,178,0)', 'rgb(0,100,0)' ]
+ 'get colors from a scale with more than two colors':
+ topic:
+ f: chroma.scale(['yellow','orange', 'darkgreen'])
+ 'just origianl colors': (topic) -> assert.deepEqual topic.f.colors(), ['#ffff00', '#ffa500', '#006400']
+
'test example in readme':
topic:
f: chroma.scale('RdYlGn')
@@ -137,4 +149,10 @@ vows
'0.5': (topic) -> assert.equal topic.f(0.5).hex(), '#f16c4b'
'1': (topic) -> assert.equal topic.f(1).hex(), '#7f0000'
- .export(module)
\ No newline at end of file
+ 'colors return original colors':
+ topic:
+ f: chroma.scale(['red', 'white', 'blue'])
+ 'same colors': (topic) -> assert.deepEqual topic.f.colors(), ['#ff0000', '#ffffff', '#0000ff']
+
+
+ .export(module)
diff --git a/dkan/modules/contrib/feeds_flatstore_processor/FeedsFlatstoreProcessor.inc b/dkan/modules/contrib/feeds_flatstore_processor/FeedsFlatstoreProcessor.inc
index c7a24ddb3..778ed5da9 100644
--- a/dkan/modules/contrib/feeds_flatstore_processor/FeedsFlatstoreProcessor.inc
+++ b/dkan/modules/contrib/feeds_flatstore_processor/FeedsFlatstoreProcessor.inc
@@ -57,6 +57,13 @@ class FeedsFlatstoreProcessor extends FeedsProcessor {
$cleaned_data = $this->geocode($cleaned_data, $source_config['geolocate_addresses'], $source_config['geolocater']);
}
+ // Empty values should be nullified CIVIC-5364
+ foreach ($cleaned_data as $key => $value) {
+ if (empty($value) && !is_numeric($value)) {
+ $cleaned_data[$key] = NULL;
+ }
+ }
+
// We only save, never update, since there is only a flat table.
$this->handler($source)->save($cleaned_data);
}
diff --git a/dkan/modules/contrib/open_data_schema_map/CHANGELOG.txt b/dkan/modules/contrib/open_data_schema_map/CHANGELOG.txt
index 23c89a77d..8bf60e7c8 100644
--- a/dkan/modules/contrib/open_data_schema_map/CHANGELOG.txt
+++ b/dkan/modules/contrib/open_data_schema_map/CHANGELOG.txt
@@ -1,3 +1,9 @@
+
+7.x-1.13.x
+-------
+- #86 Fix validation page permission check using wrong permission name.
+- #85 Add checks for property existance during odsm features rebuild.
+
7.x-1.12.14
-----------
- Add support for validation of data.json files from sites with self-signed certificates.
diff --git a/dkan/modules/contrib/open_data_schema_map/modules/open_data_schema_ckan/open_data_schema_ckan.info b/dkan/modules/contrib/open_data_schema_map/modules/open_data_schema_ckan/open_data_schema_ckan.info
index 2d1a5888b..7c50557d7 100644
--- a/dkan/modules/contrib/open_data_schema_map/modules/open_data_schema_ckan/open_data_schema_ckan.info
+++ b/dkan/modules/contrib/open_data_schema_map/modules/open_data_schema_ckan/open_data_schema_ckan.info
@@ -5,4 +5,4 @@ package = Open Data
dependencies[] = features
dependencies[] = open_data_schema_map
dependencies[] = pathauto
-version = 7.x-1.13.1
+version = 7.x-1.13.2
diff --git a/dkan/modules/contrib/open_data_schema_map/modules/open_data_schema_dcat/open_data_schema_dcat.info b/dkan/modules/contrib/open_data_schema_map/modules/open_data_schema_dcat/open_data_schema_dcat.info
index 01d5810b2..a110575e5 100644
--- a/dkan/modules/contrib/open_data_schema_map/modules/open_data_schema_dcat/open_data_schema_dcat.info
+++ b/dkan/modules/contrib/open_data_schema_map/modules/open_data_schema_dcat/open_data_schema_dcat.info
@@ -6,4 +6,4 @@ dependencies[] = features
dependencies[] = open_data_schema_map
dependencies[] = open_data_schema_map_xml_output
dependencies[] = pathauto
-version = 7.x-1.13.1
+version = 7.x-1.13.2
diff --git a/dkan/modules/contrib/open_data_schema_map/modules/open_data_schema_map_xml_output/open_data_schema_map_xml_output.info b/dkan/modules/contrib/open_data_schema_map/modules/open_data_schema_map_xml_output/open_data_schema_map_xml_output.info
index 4964032fa..1f8f622a7 100644
--- a/dkan/modules/contrib/open_data_schema_map/modules/open_data_schema_map_xml_output/open_data_schema_map_xml_output.info
+++ b/dkan/modules/contrib/open_data_schema_map/modules/open_data_schema_map_xml_output/open_data_schema_map_xml_output.info
@@ -3,4 +3,4 @@ description = Provides xml output for for Open Data Schema Map.
core = 7.x
package = Open Data
dependencies[] = open_data_schema_map
-version = 7.x-1.13.1
+version = 7.x-1.13.2
diff --git a/dkan/modules/contrib/open_data_schema_map/modules/open_data_schema_pod/open_data_schema_pod.info b/dkan/modules/contrib/open_data_schema_map/modules/open_data_schema_pod/open_data_schema_pod.info
index 5c1bba1c3..a902bb2c2 100644
--- a/dkan/modules/contrib/open_data_schema_map/modules/open_data_schema_pod/open_data_schema_pod.info
+++ b/dkan/modules/contrib/open_data_schema_map/modules/open_data_schema_pod/open_data_schema_pod.info
@@ -4,4 +4,4 @@ core = 7.x
package = Open Data
dependencies[] = features
dependencies[] = open_data_schema_map
-version = 7.x-1.13.1
+version = 7.x-1.13.2
diff --git a/dkan/modules/contrib/open_data_schema_map/open_data_schema_map.features.inc b/dkan/modules/contrib/open_data_schema_map/open_data_schema_map.features.inc
index 78bef6259..37392cb2c 100644
--- a/dkan/modules/contrib/open_data_schema_map/open_data_schema_map.features.inc
+++ b/dkan/modules/contrib/open_data_schema_map/open_data_schema_map.features.inc
@@ -95,8 +95,8 @@ function open_data_schema_apis_features_rebuild($module) {
$existing = open_data_schema_map_api_load($machine_name);
// @todo add open_data_schema_map_schema_save() function to replace this
$record = (object) $definition;
- $record->id = $existing->id;
if ($existing && isset($existing->id)) {
+ $record->id = $existing->id;
drupal_write_record('open_data_schema_map', $record, 'id');
}
else {
diff --git a/dkan/modules/contrib/open_data_schema_map/open_data_schema_map.info b/dkan/modules/contrib/open_data_schema_map/open_data_schema_map.info
index cdeb902ac..df50c7e03 100644
--- a/dkan/modules/contrib/open_data_schema_map/open_data_schema_map.info
+++ b/dkan/modules/contrib/open_data_schema_map/open_data_schema_map.info
@@ -8,4 +8,4 @@ dependencies[] = features
dependencies[] = token
files[] = open_data_schema_map.features.inc
files[] = test/open_data_schema_map_api.test
-version = 7.x-1.13.1
+version = 7.x-1.13.2
diff --git a/dkan/modules/contrib/open_data_schema_map/open_data_schema_map.module b/dkan/modules/contrib/open_data_schema_map/open_data_schema_map.module
index 0a8fdf98d..a628d9bb6 100644
--- a/dkan/modules/contrib/open_data_schema_map/open_data_schema_map.module
+++ b/dkan/modules/contrib/open_data_schema_map/open_data_schema_map.module
@@ -126,7 +126,7 @@ function open_data_schema_map_menu() {
'title' => $data['title'],
'page callback' => $data['page callback'],
'page arguments' => array(),
- 'access arguments' => array('Administer Open Data Schema Mapper'),
+ 'access arguments' => array('administer open data schema mapper'),
'type' => MENU_NORMAL_ITEM,
'file' => $data['file'],
'file path' => $data['file path'],
diff --git a/dkan/modules/contrib/recline/recline.info b/dkan/modules/contrib/recline/recline.info
index b294ef91c..57a820f7d 100644
--- a/dkan/modules/contrib/recline/recline.info
+++ b/dkan/modules/contrib/recline/recline.info
@@ -6,4 +6,4 @@ dependencies[] = libraries
dependencies[] = file
scripts[] = js/jsondataview.js
scripts[] = js/restdataview.js
-version = 7.x-1.13.1
+version = 7.x-1.13.2
diff --git a/dkan/modules/contrib/remote_stream_wrapper/PATCHES.txt b/dkan/modules/contrib/remote_stream_wrapper/PATCHES.txt
index b4a9a03ee..c02d18718 100644
--- a/dkan/modules/contrib/remote_stream_wrapper/PATCHES.txt
+++ b/dkan/modules/contrib/remote_stream_wrapper/PATCHES.txt
@@ -1,4 +1,4 @@
The following patches have been applied to this project:
-- https://www.drupal.org/files/issues/prevent-download-intent-open-stream-2833837-1.patch
+- https://www.drupal.org/files/issues/prevent-download-intent-open-stream-2833837-4.patch
This file was automatically generated by Drush Make (http://drupal.org/project/drush).
diff --git a/dkan/modules/contrib/remote_stream_wrapper/remote_stream_wrapper.inc b/dkan/modules/contrib/remote_stream_wrapper/remote_stream_wrapper.inc
index 759b0c95d..1dcfab4c4 100644
--- a/dkan/modules/contrib/remote_stream_wrapper/remote_stream_wrapper.inc
+++ b/dkan/modules/contrib/remote_stream_wrapper/remote_stream_wrapper.inc
@@ -60,7 +60,7 @@ class DrupalRemoteStreamWrapper implements DrupalStreamWrapperInterface {
/**
* Performs a GET request without transfer the content.
*/
- function getHeaders() {
+ public static function getHeaders($uri) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
@@ -70,7 +70,7 @@ class DrupalRemoteStreamWrapper implements DrupalStreamWrapperInterface {
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET' );
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_NOBODY, TRUE);
- curl_setopt($ch, CURLOPT_URL, $this->getUri());
+ curl_setopt($ch, CURLOPT_URL, $uri);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$response = curl_exec($ch);
@@ -132,7 +132,7 @@ class DrupalRemoteStreamWrapper implements DrupalStreamWrapperInterface {
}
// Fallback to the 'Content-Type' header.
- $headers = $this->getHeaders();
+ $headers = DrupalRemoteStreamWrapper::getHeaders($uri);
if (!empty($headers) && !empty($headers['content-type'])) {
return $headers['content-type'];
}
@@ -314,7 +314,7 @@ class DrupalRemoteStreamWrapper implements DrupalStreamWrapperInterface {
*/
public function stream_stat() {
$stat = array();
- $headers = $this->getHeaders();
+ $headers = DrupalRemoteStreamWrapper::getHeaders($this->getUri());
if (!empty($headers)) {
if (isset($headers['content-length'])) {
$stat['size'] = $headers['content-length'];
diff --git a/dkan/modules/contrib/services/README.txt b/dkan/modules/contrib/services/README.txt
index 158b9a826..74e8c474a 100644
--- a/dkan/modules/contrib/services/README.txt
+++ b/dkan/modules/contrib/services/README.txt
@@ -31,3 +31,7 @@ Settings via variables
'services_{$resource}_index_page_size' -- this variable controls maximum number of results that
will be displayed by index query. See services_resource_build_index_query() for more information.
+
+'services_generate_error_body' -- boolean denoting whether a message body should be included with
+certain HTTP error-related status codes. (According to IETF's RFC2616, 204 and 304 responses must
+not include bodies.)
diff --git a/dkan/modules/contrib/services/auth/services_oauth/services_oauth.info b/dkan/modules/contrib/services/auth/services_oauth/services_oauth.info
index 7f387b440..4ae686e87 100644
--- a/dkan/modules/contrib/services/auth/services_oauth/services_oauth.info
+++ b/dkan/modules/contrib/services/auth/services_oauth/services_oauth.info
@@ -5,9 +5,9 @@ dependencies[] = services
dependencies[] = oauth_common
core = 7.x
php = 5.2
-; Information added by Drupal.org packaging script on 2016-08-22
-version = "7.x-3.17"
+; Information added by Drupal.org packaging script on 2017-03-07
+version = "7.x-3.19"
core = "7.x"
project = "services"
-datestamp = "1471899241"
+datestamp = "1488903487"
diff --git a/dkan/modules/contrib/services/includes/services.runtime.inc b/dkan/modules/contrib/services/includes/services.runtime.inc
index 8c3174665..b7c7d3cad 100644
--- a/dkan/modules/contrib/services/includes/services.runtime.inc
+++ b/dkan/modules/contrib/services/includes/services.runtime.inc
@@ -110,7 +110,11 @@ function services_controller_execute($controller, $args = array(), $options = ar
throw $exception;
}
- _services_controller_execute_restore_user();
+ // Restore user only if callback is not logout.
+ $restore_user = !is_string($controller['callback']) || strpos($controller['callback'], 'logout') === FALSE;
+ if ($restore_user) {
+ _services_controller_execute_restore_user();
+ }
if (!empty($server_info->debug)) {
watchdog('services', 'results: