diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7cdaffe2b..945505cb2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,8 +1,42 @@
-# 7.1 #
+# 8.0 #
+12/6/2019
+
+* New Features
+ * Portal Product
+ * Related Case Solutions
+ * Knowledge Base
+ * WYSIWYG Editor for Email Templates
+ * Nexmo Call Pop-up
+ * Sales Quotations Improvements
+ * Group Profiles
+ * Data Visualizations
+ * Appointment Calendar
+ * UI Update
+ * Listability Improvements
+
+* Extensions
+ * Billboard.js (replaced C3)
+ * D3.js v5 (from v3)
+ * Grapes.js (new)
+ * Font Awesome v5 (from v4)
+
+* Minimum Requirements
+ * PHP 7.0 (from 5.3)
+ * PHP 5.* no longer supported by maintainers
+ * MySQL 5.7 (from 5.6)
+ * InnoDB Full Text Index Support
-1/3/2019
-* General Changelog / Developer Notes
- * X2CRM is now compatible with PHP 7.1+
+* Miscellaneous bug fixes
+ * PHP 7.2 compatability fixes
+ * Login CSRF and duplicate primary key fix
+ * Fix for phone numbers not deleting from phone number table when deleted from record
+ * Fixed bug with accounts report failing if the grid view for accounts has the tag column but accounts don't have any tags
+ * Fixed issue with not being able to edit account lists if the criterion model is empty
+ * Total rows error on summation report fix
+ * Boolean fields and action eventSubType reportability fix
+
+# 7.1 #
+11/7/2018
* Miscellaneous bug fixes
* Fixed issue with emailing where mail servers which are not configured to use VERP can still send email
@@ -12,7 +46,6 @@
* Fixed issue where a 500 error would occur if the 'maxFileSize' attribute was not created correctly
* Fixed issue where X2Flow would incorrectly reference a workflow ID
* Fixed issue where logging time on a record would incorrectly calculate time spent
- * Fixed front-end with the complete stage action in X2Workflow where the note textarea was covering the stage selection dropdown
# 7.0 #
10/19/2018
@@ -21,18 +54,17 @@
* Accounts, Leads and Opportunities are now listable
* Contacts can now be converted to leads
* Campaigns
+ * Long-Term campaigns added
* A/B testing for campaigns added
* Account, Lead and Opportunity lists can now all be used in campaigns
+ * Campaign link clicks can now be easily and automatically tracked
+ * Suppression lists can now be used in campaigns
+ * Bounce hadling for campaigns added
+ * Workflows
+ * Frequency count of how many times a workflow is executed is now recorded and displayed to the user
+ * Integration with Outlook calendars
* Miscellaneous bug fixes
-# 6.9.3 #
-1/3/2018
-* Fixed unrecognized field lastModifies bug
-
-# 6.9.2 #
-12/29/2017
-* Fixed email bug
-
# 6.9.1 #
11/20/2017
* General Changelog / Developer Notes
diff --git a/README.md b/README.md
index da48e3dac..7f77b6798 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,34 @@
-NOTE: IF YOU ARE UPDATING FROM <7.0 YOU WILL NEED TO RE-ENTER YOUR THIRD-PARTY APP CREDENTIALS!
-THIS IS DUE TO THE REMOVAL OF MCRYPT IN PHP 7.2. FOR MORE INFO, PLEASE CONTACT customersupport@x2engine.com
+# 8.0 #
+
+12/6/2019
+* New Enterprise Features:
+ * Portal Product:
+ * Customer login and messaging for support cases
+ * Invite users to the portal through service case webform
+ * Related Case Solutions: Match service cases by issue for relevant resolutions
+ * Knowledge Base: Create documents that can be searched by keyword or phrase
+ * WYSIWYG Editor for Email Templates: New responsive editor for email templates
+ * Nexmo Call Pop-up: Links to contact with matching number if one exists
+
+* New Open Source Features:
+ * Sales Quotations Improvements:
+ * Comments are their own line item
+ * Adjustments are also their own line item, and percentage adjustments are based off the most previous line item
+ * Added tax modifier on the subtotal
+ * Added quote template insertable attribute "Packing Slip" that inserts quote item table without prices
+ * Group Profiles: Admins can set default homepage layouts.
+ * Data Visualizations
+ * Day/hour heat map for campaigns that shows number and time of open/click/sent events
+ * Added bubble, spline, and area spline charts to reports
+ * Appointment Calendar:
+ * Users profile setting for dedicated appointment calendar
+ * Guests can reserve appointments through invitation link
+ * UI Update:
+ * Publisher widget history items scrollable when too long
+ * General styling changes
+ * Listability Improvements: Account, lead, and opportunity lists are campaignable
+
+* Miscellaneous bug fixes (see Changelog)
# 7.1 #
@@ -17,17 +46,6 @@ THIS IS DUE TO THE REMOVAL OF MCRYPT IN PHP 7.2. FOR MORE INFO, PLEASE CONTACT c
* Fixed issue where logging time on a record would incorrectly calculate time spent
* Fixed front-end with the complete stage action in X2Workflow where the note textarea was covering the stage selection dropdown
-# 7.0 #
-10/19/2018
-
-* General Changelog / Developer Notes
- * Accounts, Leads and Opportunities are now listable
- * Contacts can now be converted to leads
- * Campaigns
- * A/B testing for campaigns added
- * Account, Lead and Opportunity lists can now all be used in campaigns
- * Miscellaneous bug fixes
-
# Introduction #
Welcome to X2CRM!
X2CRM is a next-generation, open source social sales application for small and
@@ -53,10 +71,10 @@ value to their customer interactions resulting in higher close rates.
# System Requirements #
* A web server that can execute PHP
-* A password-protected MySQL database server connection, and a database on
- which the user of the connection has full permissions rights (i.e. SELECT,
- DROP, CREATE and UPDATE)
-* PHP 5.3 or later
+* A password-protected MySQL (5.7 recommended) database server connection, and a
+ database on which the user of the connection has full permissions rights
+ (i.e. SELECT, DROP, CREATE and UPDATE)
+* PHP 7.0 or later (5.6 mostly works, but is no longer supported)
* PHP must be run as the same system user that owns the directory where X2CRM
will be installed
* The server must have internet access for automatic updates
diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md
index 9b18a6c03..af40a152c 100644
--- a/RELEASE-NOTES.md
+++ b/RELEASE-NOTES.md
@@ -1,8 +1,16 @@
-# 7.1 #
+# 8.0 #
+12/6/2019
+* Sales Quotations Improvements:
+ * Comments are their own line item
+ * Adjustments are also their own line item, and percentage adjustments are based off the most previous line item
+ * Added tax modifier on the subtotal
+ * Added quote template insertable attribute "Packing Slip" that inserts quote item table without prices
-1/3/2019
-* General Changelog / Developer Notes
- * X2CRM is now compatible with PHP 7.1+
+**Note for sales quotes after updating to 8.0**
+With the new quote creator changes, quotes appear differently. Quotes already stored in the database will still have comments for line items, but will not be seen on the view/update/print pages. In order to make sure comments show properly, you will need to run the FixOldQuotesCommand command. To do this, navigate to your application directory and then to the `protected/` directory. Then run `./yiic fixoldquotes` to move all line items' comments to it's own line item.
+
+# 7.1 #
+11/7/2018
* Miscellaneous bug fixes
* Fixed issue with emailing where mail servers which are not configured to use VERP can still send email
@@ -12,7 +20,6 @@
* Fixed issue where a 500 error would occur if the 'maxFileSize' attribute was not created correctly
* Fixed issue where X2Flow would incorrectly reference a workflow ID
* Fixed issue where logging time on a record would incorrectly calculate time spent
- * Fixed front-end with the complete stage action in X2Workflow where the note textarea was covering the stage selection dropdown
# 7.0 #
10/19/2018
@@ -21,402 +28,17 @@
* Accounts, Leads and Opportunities are now listable
* Contacts can now be converted to leads
* Campaigns
+ * Long-Term campaigns added
* A/B testing for campaigns added
* Account, Lead and Opportunity lists can now all be used in campaigns
+ * Campaign link clicks can now be easily and automatically tracked
+ * Suppression lists can now be used in campaigns
+ * Bounce hadling for campaigns added
+ * Workflows
+ * Frequency count of how many times a workflow is executed is now recorded and displayed to the user
+ * Integration with Outlook calendars
* Miscellaneous bug fixes
-# 6.9.3 #
-1/3/2018
-* Fixed unrecognized field lastModifies bug
-
-# 6.9.2 #
-12/29/2017
-* Fixed email bug
-
-# 6.9.1 #
-11/20/2017
-* General Changelog / Developer Notes
- * New Enterprise UI
- * New Paper-White UI default theme
- * Revamped Landing Page Designer
- * Top Menu Dropdowns
- * New X2HubServices integrations
- * Contact Twitter feed
- * LinkedIn user information autofill
- * Dropbox integration
- * Docusign Integration
- * Miscellaneous bug fixes
- * Workflow tag bug fix
- * Calendar empty tables bug fix
-
-# 6.9 #
-08/22/2017
-* General Changelog / Developer Notes
- * Miscellaneous UI enhancements
- * New Green login logo
- * New Enterprise edition released
- * The enterprise edition of X2CRM is developed with enterprise users in mind
- * New colorful icons for actions (these can be seen in the activity feed)
- * New Native Code Editor
- * The code editor allows the modification of the application code through the app itself. This allows power users to customize the app like never before! The code editor can be accessed via the X2Studio tools in the admin section of the app
- * X2Workflows
- * New stock X2Workflow rules added to the workflow system
- * Restricted non-compatible actions from being attached to triggers, this is introduced in order to prevent users from making broken workflows.
- * Miscellaneous bug fixes
- * Fixed an issue with login where users would get immediately get logged out
- * Fixed a UI bug where some smaller screens would prevent parts of the app from showing.
-
-# 6.6 #
-5/17/2017
-* General Changelog / Developer Notes
- * Campaign Improvements
- * Email campaigns can now be scheduled
- * Added email opened time and location to campaign launch grid
- * Improved database performance of campaign email sends
- * X2Touch Improvements
- * Added barcode scanner to import product barcode identifier
- * Mobile publisher now supports voice to text notes
- * X2Workflow Improvements
- * New Location Trigger to support general workflow operations when a Location is logged
- * Added AddToNewsletter workflow action to manage web leads on newsletter contact lists
- * Added new feature tours
- * Improved email client IMAP server compatibility, including with Dovecot, Exchange, Office365, and Rackspace
- * Added new import console command with 'rollback' operation
- * Added an admin page to locate missing records that may have been inadvertently hidden
- * New RackspaceEmail account type
- * Fixed bug in email subject replacement
- * Enabled mass execute macro on Contact list grids
- * Added option to weblead form designer to disable dupe detection by X2Identity on a per-form basis
- * X2Packager stability fixes
- * Fixed date format issue under French locale
- * Miscellaneous UI enhancements
- * Miscellaneous bug fixes
-* Tracked Bug Fixes:
- * [3703](http://x2software.com/index.php/bugReports/3703): Undefined index: X2List
- * [5825](http://x2software.com/index.php/bugReports/5825): Call to a member function asa() on null
- * [5966](http://x2software.com/index.php/bugReports/5966): Trying to get property of non-object
- * [5971](http://x2software.com/index.php/bugReports/5971): Function mcrypt_create_iv() is deprecated
-
-# 6.5.2 #
-12/23/2016
-* General Changelog / Developer Notes
- * X2Touch Improvements
- * Added video attachments on iOS
- * Added audio attachments on iOS and Android
- * New X2Workflow actions for creating notifications, emails, text messages, and activity feed posts with records in a specified proximity
- * Activity feed posts can now be associated with arbitrary records
- * Added Twilio account type and SMS-based two factor authentication
- * Checkin post formatting improvements
- * Added weblead form thank you text customization
- * Fixed Doc template usage with Opportunities
- * Added option to toggle geolocation functionality
- * Standard Actions can now be posted to a user's calendar
- * Added ability to relabel existing relationships
- * AnonContact webactivity visits can now be filtered from your notifications
- * Miscellaneous bug fixes
-
-# 6.5.1 #
-11/17/2016
-* General Changelog / Developer Notes
- * Added open rate, click rate, and unsubscribe rate attributes to Campaigns
- * Added ability to import Contacts from mobile devices
- * Added static maps to webapp check ins
- * Added mobile audio attachments
- * Resurfaced calendar event reminders
- * Fixed broken images in Image Gallery widget
-* Tracked Bug Fixes:
- * [3396](http://x2software.com/index.php/bugReports/3396): CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails (`nevulosa_x2153`.`x2_actions`, CONSTRAINT `fk_actions_workflow_id` FOREIGN KEY
- * [5375](http://x2software.com/index.php/bugReports/5375): syntax error, unexpected '}'
- * [5391](http://x2software.com/index.php/bugReports/5391): CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND x2_lo
- * [5416](http://x2software.com/index.php/bugReports/5416): Undefined variable: sessionTokenCookie
- * [5420](http://x2software.com/index.php/bugReports/5420): Argument 1 passed to RelationshipsBehavior::deleteRelationship() must be an instance of CActiveRecord, null given
-
-# 6.5 #
-10/7/2016
-* General Changelog / Developer Notes
- * New Location tracking features
- * Log locations when Contacts open emails, visit your webpage, etc.
- * Log locations of users when they log in to the system
- * Log periodic location updates from X2Touch mobile
- * Settings page to configure and enable user location logging
- * Google Maps API Re-enabled
- * Jasper Reporting Integration
- * Two-way Google Calendar sync
- * Support for multiple user calendars
- * Miscellaneous bug fixes and improvements
-* Tracked Bug Fixes:
- * [4858](http://x2software.com/index.php/bugReports/4858): The system is unable to find the requested action "configureMyInbox".
- * [4923](http://x2software.com/index.php/bugReports/4923): Trying to get property of non-object
- * [5288](http://x2software.com/index.php/bugReports/5288): Undefined variable: success
-
-# 6.0.4 #
-8/12/2016
-* General Changelog / Developer Notes
- * More improvements to Admin control panel
- * Fix inline email issue on Opportunities
- * Added ability to disable Email Inbox per credential
- * Miscellaneous bug fixes
-
-# 6.0.3 #
-8/3/2016
-* General Changelog / Developer Notes
- * Admin control panel UI overhaul
- * Ability to delete from mobile activity feed
- * Mobile login tokens persist longer
- * Miscellaneous bug fixes
-
-# 6.0.2 #
-7/14/2016
-* General Changelog / Developer Notes
- * Action history is now accessible from mobile
- * New "Change Record" flow action allows workflows to execute on related records
- * New "Mass Execute Macro" mass action allows execution of macro type workflows from the grids
- * More improvements to web capture API, including file upload fields
- * Miscellaneous bug fixes
-
-# 6.0.1 #
-5/26/2016
-* General Changelog / Developer Notes
- * X2Touch now supports persistent sessions
- * Improvements to web capture API
- * Miscellaneous bug fixes
-
-# 6.0 #
-4/26/2016
-* General Changelog / Developer Notes
- * X2CRM is now fully open source
- * UI tweaks and enhancements
- * Miscellaneous bug fixes
-
-# 5.5 #
-2/25/2016
-* General Changelog / Developer Notes
- * PHP7 compatibility
- * Yii updated to 1.1.17
- * PHPMailer updated to 5.2.14
- * File attachment feature added to most X2Touch modules, including custom modules
- * Added "Copy to Sent" dropdown to email client configuration to explicitly store sent messages
- * Added "Reply All" button to email client
- * New Office365 credentials type
- * Added web tracker JavaScript code export functionality
- * Fixed importer bug which created erroneous relationships
- * Automated email logging bugfixes
- * Fixed bug preventing records export download button from showing
- * Fixed email client quota issue with Office365
-* Tracked Bug Fixes:
- * [3335](http://x2software.com/index.php/bugReports/3335): CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'id' in where clause is ambiguous
- * [3336](http://x2software.com/index.php/bugReports/3336): Trying to get property of non-object
- * [3348](http://x2software.com/index.php/bugReports/3348): array_combine() expects parameter 1 to be array, null given
- * [3358](http://x2software.com/index.php/bugReports/3358): User Report
- * [3363](http://x2software.com/index.php/bugReports/3363): Undefined variable: id
- * [3367](http://x2software.com/index.php/bugReports/3367): Undefined index: dupeCheck
- * [3376](http://x2software.com/index.php/bugReports/3376): User Report
- * [3379](http://x2software.com/index.php/bugReports/3379): file_exists(): open_basedir restriction in effect.
- * [3383](http://x2software.com/index.php/bugReports/3383): User Report
- * [3643](http://x2software.com/index.php/bugReports/3643): User Report
-
-# 5.4.3 #
-1/9/2016
-* General Changelog / Developer Notes
- * Fixed a bug with web lead capture
- * Fixed a broken form layout in X2Touch
- * Fixed a bug in Lists
-
-# 5.4.2 #
-1/7/2016
-* General Changelog / Developer Notes
- * X2Touch changes:
- * Added support for the Topics module
- * Module form layouts can now be customized from the new "Mobile App Form Editor" admin page
- * Improved error handling of automated email logging
- * Action History "Email From" filter now includes logged inbound emails
- * New option on the "Email Settings" admin page to enable List-Unsubscribe email header
- * Updated module delete functionality to clean up associated custom module summary widgets
- * Updated Process module to allow for financial information on any module type
-* Tracked Bug Fixes:
- * [3189](http://x2software.com/index.php/bugReports/3189): CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 't.createDate' in 'having clause'
- * [3283](http://x2software.com/index.php/bugReports/3283): file_exists(): open_basedir restriction in effect. File is not within the allowed path(s)
- * [3296](http://x2software.com/index.php/bugReports/3296): CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Admin' for key 'PRIMARY'
- * [3300](http://x2software.com/index.php/bugReports/3300): array_flip(): Can only flip STRING and INTEGER values!
- * [3302](http://x2software.com/index.php/bugReports/3302): CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'active' at row 1
- * [3303](http://x2software.com/index.php/bugReports/3303): CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'tags' in 'where clause'
- * [3310](http://x2software.com/index.php/bugReports/3310): X2MergeableBehavior and its behaviors do not have a method or closure named "setMergedField".
- * [3312](http://x2software.com/index.php/bugReports/3312): The system is unable to find the requested action "id".
- * [3323](http://x2software.com/index.php/bugReports/3323): Trying to get property of non-object
- * [3324](http://x2software.com/index.php/bugReports/3324): Eigenschaft "Contacts.Array ist nicht definiert."
- * [3330](http://x2software.com/index.php/bugReports/3330): Relationships labelling bug
-
-# 5.4.1 #
-12/18/2015
-* General Changelog / Developer Notes
- * Fixed opened email display in action history
- * Fixed mass action menu displaying when scrolling up
- * Fixed 404 error caused by clicking on a user profile from the activity feed
- * Fixed avatars not displaying correctly
- * Fixes and improvements to X2Touch
-
-# 5.4 #
-12/17/2015
-
-* Highlights
- * Platinum Edition Changes:
- * Added Role and permissions support to X2Packager
- * Configure user password complexity requirements
- * Failed login grid now maintains historical records
- * Professional Edition Changes:
- * Native X2CRM Android App (Beta)
- * Manage Contacts, Accounts, Opportunities and more
- * Get activity feed updates, comment on feed events, and post photos
- * View interactive Charts Dashboard
- * Access records from custom modules
- * Automatic inbound and outbound email logging in Email Inboxes
- * New email related triggers and conditions in X2Workflow
- * New email opened trigger and condition for X2Workflow
- * New export target options allowing data exports to an FTP or SSH server, Amazon S3, and Google Drive, as well as optionally compressing the export to a ZIP archive
- * Added ability to shard static assets over multiple domains
- * Process module visualization now supports any record type
- * New "Favorites" widget replaces "Top Contacts", allowing quick access to frequently used records of any type
- * New top bar customization options:
- * Add links to external URLs
- * Add links to arbitrary records inside X2CRM
- * Improved importer link field controls allowing selection of attribute to match for linked records
-* General Changelog / Developer Notes
- * Added ability to rename folders in Docs module
- * Process stage order can now be edited without the risk of data loss
- * Back end code refactoring and stability improvements
- * Major translation updates to remove unused text
- * Fixed a bug where campaign text could be deleted when using inline editing
- * Fixed a bug that caused Calendar events to show up in the activity feed as "Calendar event not found"
- * Fixed a bug in module delete functionality that failed to remove associated Fields records
- * Fixed a bug in Email Inboxes when selecting and moving messages to a folder whose name uses UTF8 encoded characters
-* Tracked Bug Fixes:
- * [2956](http://x2software.com/index.php/bugReports/2956): Undefined index: notificationUsers
- * [3046](http://x2software.com/index.php/bugReports/3046): mb_convert_encoding(): Illegal character encoding specified
- * [3082](http://x2software.com/index.php/bugReports/3082): User Report
- * [3084](http://x2software.com/index.php/bugReports/3084): Undefined index: wide
- * [3085](http://x2software.com/index.php/bugReports/3085): Report settings could not be saved.
- * [3089](http://x2software.com/index.php/bugReports/3089): Undefined index: notificationUsers
- * [3095](http://x2software.com/index.php/bugReports/3095): Report settings could not be saved.
- * [3099](http://x2software.com/index.php/bugReports/3099): Missing argument 1 for Google_Client::authenticate(), called in GoogleAuthenticator.php on line 146 and defined
- * [3115](http://x2software.com/index.php/bugReports/3115): Undefined offset: 0
- * [3131](http://x2software.com/index.php/bugReports/3131): Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'X2CRM.t.id' which is not functionally dependent on colu
- * [3133](http://x2software.com/index.php/bugReports/3133): Property "Testmodule.c_Client_ID" is not defined.
- * [3137](http://x2software.com/index.php/bugReports/3137): Missing argument 1 for Google_Client::authenticate(), called in GoogleAuthenticator.php on line 146 and defined
- * [3150](http://x2software.com/index.php/bugReports/3150): EmailConfigException
- * [3203](http://x2software.com/index.php/bugReports/3203): fgetcsv(): delimiter must be a character
- * [3244](http://x2software.com/index.php/bugReports/3244): Trying to get property of non-object
- * [3255](http://x2software.com/index.php/bugReports/3255): Quick Create Form
- * [3258](http://x2software.com/index.php/bugReports/3258): No such file or directory
- * [3259](http://x2software.com/index.php/bugReports/3259): French date picker issue
- * [3265](http://x2software.com/index.php/bugReports/3265): array_combine(): Both parameters should have at least 1 element
-
-# 5.3.1 #
-11/5/2015
-
-* General Changelog / Developer Notes:
- * Fixed bug which caused "Discard unsaved changes?" dialog to display incorrectly in certain cases
- * Fixed bug in module import which could break link-type fields
- * Fixed bug in records export which caused the custom delimiter/enclosure to be ignored in the resulting CSV header
- * Fixed bug in records import causing Action descriptions to be ignored if the ID field was mapped
- * Fixed bug in records import which attempted to insert ActionText even if the Actions model failed validation, resulting in a constraint violation
-* Tracked Bug Fixes:
- * [3099](http://x2software.com/index.php/bugReports/3099): Missing argument 1 for Google_Client::authenticate(), called in /var/www/html/crm/protected/components/GoogleAuthenticator.php on line 146 and defined
- * [3115](http://x2software.com/index.php/bugReports/3115): Undefined offset: 0
-
-# 5.3 #
-10/15/2015
-
-* Highlights
- * Professional Edition Changes:
- * Google+ integration:
- * Google+ Profile widget allows display of Google+ Profile data on record view screens.
- * Google+ Profile search feature
- * New X2Workflow Splitter enables concurrent execution of flow branches, simplifying creation of complex flow logic.
- * Added mass actions to Email Inbox profile widget. It's now possible to delete, log, and flag emails directly from the profile page.
- * X2Workflow Remote API Call action now supports nested JSON payloads
- * Default processes can now be set on a per module basis.
- * New "Redirect URL" option in web form designer
- * Tags column now available in more module grid views, including custom modules.
- * Added ability to select and move multiple Docs or folders at a time from the Docs grid view
-* General Changelog / Developer Notes:
- * The Calendar Module now only displays events and actions. Logged time, logged calls, comments, and emails will no longer show in the calendar view.
- * In order to simplify Lead conversion reporting, Leads are now preserved after conversion to Contact or Opportunity and designated as "Converted". Two new fields have been added, "Converted" and "Conversion Date", which get set automatically upon Lead conversion.
- * Fixed bug which prevented Actions from being synced with Google Calendar
- * SASS-generated CSS has been minified. CSS customizations can be made by regenerating the CSS
- from customized SASS.
- * Updated Google PHP API client Library to version 1.1.5
- * Fixed bug which broke inline editing on Service Cases with associated Contacts.
- * Fixed bug which caused an error when attempting to create a reminder from the Action update page
- * Added back red asterisks appearing alongside required fields on record edit pages.
- * Fixed off-by-one bugs in X2Workflow Periodic Trigger scheduling
- * "Disable automatic record tagging?" option moved out of user preferences. Automatic record tagging can now be disabled globally from the "General Settings" admin page.
- * Added print view feature to Opportunities
-* Tracked Bug Fixes:
- * [2877](http://x2software.com/index.php/bugReports/2877): "Assigned To" grid filter cannot be used to retrieve multi-assigned records
- * [2888](http://x2software.com/index.php/bugReports/2888): array_merge(): Argument #1 is not an array
- * [2889](http://x2software.com/index.php/bugReports/2889): Invalid argument supplied for foreach()
- * [2891](http://x2software.com/index.php/bugReports/2891): Trying to get property of non-object
- * [2896](http://x2software.com/index.php/bugReports/2896): Unable to resolve the request "/index.php/contacts/contacts/weblead".
- * [2931](http://x2software.com/index.php/bugReports/2931): Trying to get property of non-object
- * [2969](http://x2software.com/index.php/bugReports/2969): AdminController cannot find the requested view "deleteDropdowns".
- * [2972](http://x2software.com/index.php/bugReports/2972): Property "Docs.editPermissions" is not defined.
- * [2980](http://x2software.com/index.php/bugReports/2980): Property "Contacts.private" is not defined.
- * [2984](http://x2software.com/index.php/bugReports/2984): Undefined index: notificationUsers
-
-# 5.2.1 #
-8/26/2015
-
-* General Changelog / Developer Notes:
- * Fixed backwards compatibility issue affecting custom modules
- * Added public info settings validation which prevents issues with public base URI/URL formatting
- * Fixed bug which caused logged calls to display in the Actions module list view
- * Fixed bug affecting cookie-based web tracking on servers whose hostname lacked a subdomain
- * New admin option to upload a login screen logo (Professional Edition Only)
-
-# 5.2 #
-8/19/2015
-
-* Highlights
- * Platinum Edition Changes
- * New auto-merge admin tool automatically merges duplicate records
- * Professional Edition Changes
- * New Execute Workflow sidebar widget enables execution of individual workflows created in the X2Workflow Studio Designer
- * New Email Inbox Profile Dashboard widget
- * New grid view mass actions:
- * Mass convert leads
- * Mass publish comments, actions, calls, and logged time
- * Mass create relationships
- * New importer option to update existing records on import
- * New Topics module offers an integrated discussion board
- * Create topic discussion threads
- * Relate topics to Contact and Account records
- * Tag/pin topics
- * New Profile Dashboard widgets:
- * Docs Summary
- * New Web Leads
- * New mass dedupe admin tool simplifies duplicate record management
- * Tags can now be exported
- * Docs can now be grouped inside nestable folders
- * New drag and drop media upload options and simplified email image attachment
- * New Web Activity record view widget
- * New interactive tips system provides step-by-step feature introductions
- * Application-wide UI improvements to record view layouts
- * New Module-specific theming options
- * New Edit Global CSS admin page
- * Themes selected on the preferences page now apply to the login screen and to X2Touch
- * New preferences option to apply background image to login screen
- * Admin index organizational improvements
-* General Changelog / Developer Notes:
- * "X2Flow" has been renamed "X2Workflow"
- * Contact "Record Aliases" have been renamed "Social Profiles"
-* Tracked Bug Fixes:
- * [2631](http://x2software.com/index.php/bugReports/2631): Invalid address:
- * [2731](http://x2software.com/index.php/bugReports/2731): import mapping name
- * [2769](http://x2software.com/index.php/bugReports/2769): Undefined index:
- * [2778](http://x2software.com/index.php/bugReports/2778): AdminController and its behaviors do not have a method or closure named "fixupImportedModuleDropdowns".
- * [2862](http://x2software.com/index.php/bugReports/2862): Invalid argument supplied for foreach()
- * [2872](http://x2software.com/index.php/bugReports/2872): fopen(/public_html/protected/data/records_export.csv): failed to open stream: Permission denied
-
# 5.0.9 #
7/13/2015
diff --git a/x2engine/LICENSE.txt b/x2engine/LICENSE.txt
index dd1a53647..d806d12ec 100644
--- a/x2engine/LICENSE.txt
+++ b/x2engine/LICENSE.txt
@@ -1,617 +1,21 @@
- GNU AFFERO GENERAL PUBLIC LICENSE
- Version 3, 19 November 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU Affero General Public License is a free, copyleft license for
-software and other kinds of works, specifically designed to ensure
-cooperation with the community in the case of network server software.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-our General Public Licenses are intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- Developers that use our General Public Licenses protect your rights
-with two steps: (1) assert copyright on the software, and (2) offer
-you this License which gives you legal permission to copy, distribute
-and/or modify the software.
-
- A secondary benefit of defending all users' freedom is that
-improvements made in alternate versions of the program, if they
-receive widespread use, become available for other developers to
-incorporate. Many developers of free software are heartened and
-encouraged by the resulting cooperation. However, in the case of
-software used on network servers, this result may fail to come about.
-The GNU General Public License permits making a modified version and
-letting the public access it on a server without ever releasing its
-source code to the public.
-
- The GNU Affero General Public License is designed specifically to
-ensure that, in such cases, the modified source code becomes available
-to the community. It requires the operator of a network server to
-provide the source code of the modified version running there to the
-users of that server. Therefore, public use of a modified version, on
-a publicly accessible server, gives the public access to the source
-code of the modified version.
-
- An older license, called the Affero General Public License and
-published by Affero, was designed to accomplish similar goals. This is
-a different license, not a version of the Affero GPL, but Affero has
-released a new version of the Affero GPL which permits relicensing under
-this license.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU Affero General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Remote Network Interaction; Use with the GNU General Public License.
-
- Notwithstanding any other provision of this License, if you modify the
-Program, your modified version must prominently offer all users
-interacting with it remotely through a computer network (if your version
-supports such interaction) an opportunity to receive the Corresponding
-Source of your version by providing access to the Corresponding Source
-from a network server at no charge, through some standard or customary
-means of facilitating copying of software. This Corresponding Source
-shall include the Corresponding Source for any work covered by version 3
-of the GNU General Public License that is incorporated pursuant to the
-following paragraph.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the work with which it is combined will remain governed by version
-3 of the GNU General Public License.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU Affero General Public License from time to time. Such new versions
-will be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU Affero General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU Affero General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU Affero General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
+Copyright (C) 2011-2019 X2 Engine Inc. All Rights Reserved.
+
+X2 Engine Inc.
+P.O. Box 64061
+Redwood City, California 94061 USA
+Company website: http://www.x2engine.com
+
+X2 Engine Inc. grants you a perpetual, non-exclusive, non-transferable license
+to install and use this Software for your internal business purposes only
+for the number of users purchased by you. Your use of this Software for
+additional users is not covered by this license and requires a separate
+license purchase for such users. You shall not distribute, license, or
+sublicense the Software. Title, ownership, and all intellectual property
+rights in the Software belong exclusively to X2 Engine. You agree not to file
+any patent applications covering, relating to, or depicting this Software
+or modifications thereto, and you agree to assign any patentable inventions
+resulting from your use of this Software to X2 Engine.
+
+THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EITHER
+EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT.
diff --git a/x2engine/compass/css/lib/_colors.scss b/x2engine/compass/css/lib/_colors.scss
index 9ce144aaf..7080b81d1 100644
--- a/x2engine/compass/css/lib/_colors.scss
+++ b/x2engine/compass/css/lib/_colors.scss
@@ -76,14 +76,15 @@ $errorLightRed: rgb(255, 238, 238);
* Greens
***********************************************************************/
$highlightGreen: #01b701;
-$selectionGreen: mix(white, $highlightGreen, 52%);
+$selectionGreen: mix(white, $highlightGreen, 52%);
+$lightPastelGreen: #e7fbdd;
/***********************************************************************
* This section is made to correspond with the theme keys in ThemeGenerator
***********************************************************************/
-$background: white;
+$background: #EFF3F5;
$content: white;
$text: $nearBlack;
$link: $darkBlue;
diff --git a/x2engine/compass/css/lib/scss/_animated.scss b/x2engine/compass/css/lib/scss/_animated.scss
new file mode 100644
index 000000000..7c7c0e173
--- /dev/null
+++ b/x2engine/compass/css/lib/scss/_animated.scss
@@ -0,0 +1,20 @@
+// Animated Icons
+// --------------------------
+
+.#{$fa-css-prefix}-spin {
+ animation: fa-spin 2s infinite linear;
+}
+
+.#{$fa-css-prefix}-pulse {
+ animation: fa-spin 1s infinite steps(8);
+}
+
+@keyframes fa-spin {
+ 0% {
+ transform: rotate(0deg);
+ }
+
+ 100% {
+ transform: rotate(360deg);
+ }
+}
diff --git a/x2engine/compass/css/lib/scss/_bordered-pulled.scss b/x2engine/compass/css/lib/scss/_bordered-pulled.scss
new file mode 100644
index 000000000..c8c4274c4
--- /dev/null
+++ b/x2engine/compass/css/lib/scss/_bordered-pulled.scss
@@ -0,0 +1,20 @@
+// Bordered & Pulled
+// -------------------------
+
+.#{$fa-css-prefix}-border {
+ border: solid .08em $fa-border-color;
+ border-radius: .1em;
+ padding: .2em .25em .15em;
+}
+
+.#{$fa-css-prefix}-pull-left { float: left; }
+.#{$fa-css-prefix}-pull-right { float: right; }
+
+.#{$fa-css-prefix},
+.fas,
+.far,
+.fal,
+.fab {
+ &.#{$fa-css-prefix}-pull-left { margin-right: .3em; }
+ &.#{$fa-css-prefix}-pull-right { margin-left: .3em; }
+}
diff --git a/x2engine/compass/css/lib/scss/_core.scss b/x2engine/compass/css/lib/scss/_core.scss
new file mode 100644
index 000000000..cbd4cf7c1
--- /dev/null
+++ b/x2engine/compass/css/lib/scss/_core.scss
@@ -0,0 +1,21 @@
+// Base Class Definition
+// -------------------------
+
+.#{$fa-css-prefix},
+.fas,
+.far,
+.fal,
+.fad,
+.fab {
+ -moz-osx-font-smoothing: grayscale;
+ -webkit-font-smoothing: antialiased;
+ display: inline-block;
+ font-style: normal;
+ font-variant: normal;
+ text-rendering: auto;
+ line-height: 1;
+}
+
+%fa-icon {
+ @include fa-icon;
+}
diff --git a/x2engine/compass/css/lib/scss/_fixed-width.scss b/x2engine/compass/css/lib/scss/_fixed-width.scss
new file mode 100644
index 000000000..970641ff4
--- /dev/null
+++ b/x2engine/compass/css/lib/scss/_fixed-width.scss
@@ -0,0 +1,6 @@
+// Fixed Width Icons
+// -------------------------
+.#{$fa-css-prefix}-fw {
+ text-align: center;
+ width: $fa-fw-width;
+}
diff --git a/x2engine/compass/css/lib/scss/_icons.scss b/x2engine/compass/css/lib/scss/_icons.scss
new file mode 100644
index 000000000..a9ea8598d
--- /dev/null
+++ b/x2engine/compass/css/lib/scss/_icons.scss
@@ -0,0 +1,1397 @@
+/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
+readers do not read off random characters that represent icons */
+
+.#{$fa-css-prefix}-500px:before { content: fa-content($fa-var-500px); }
+.#{$fa-css-prefix}-accessible-icon:before { content: fa-content($fa-var-accessible-icon); }
+.#{$fa-css-prefix}-accusoft:before { content: fa-content($fa-var-accusoft); }
+.#{$fa-css-prefix}-acquisitions-incorporated:before { content: fa-content($fa-var-acquisitions-incorporated); }
+.#{$fa-css-prefix}-ad:before { content: fa-content($fa-var-ad); }
+.#{$fa-css-prefix}-address-book:before { content: fa-content($fa-var-address-book); }
+.#{$fa-css-prefix}-address-card:before { content: fa-content($fa-var-address-card); }
+.#{$fa-css-prefix}-adjust:before { content: fa-content($fa-var-adjust); }
+.#{$fa-css-prefix}-adn:before { content: fa-content($fa-var-adn); }
+.#{$fa-css-prefix}-adobe:before { content: fa-content($fa-var-adobe); }
+.#{$fa-css-prefix}-adversal:before { content: fa-content($fa-var-adversal); }
+.#{$fa-css-prefix}-affiliatetheme:before { content: fa-content($fa-var-affiliatetheme); }
+.#{$fa-css-prefix}-air-freshener:before { content: fa-content($fa-var-air-freshener); }
+.#{$fa-css-prefix}-airbnb:before { content: fa-content($fa-var-airbnb); }
+.#{$fa-css-prefix}-algolia:before { content: fa-content($fa-var-algolia); }
+.#{$fa-css-prefix}-align-center:before { content: fa-content($fa-var-align-center); }
+.#{$fa-css-prefix}-align-justify:before { content: fa-content($fa-var-align-justify); }
+.#{$fa-css-prefix}-align-left:before { content: fa-content($fa-var-align-left); }
+.#{$fa-css-prefix}-align-right:before { content: fa-content($fa-var-align-right); }
+.#{$fa-css-prefix}-alipay:before { content: fa-content($fa-var-alipay); }
+.#{$fa-css-prefix}-allergies:before { content: fa-content($fa-var-allergies); }
+.#{$fa-css-prefix}-amazon:before { content: fa-content($fa-var-amazon); }
+.#{$fa-css-prefix}-amazon-pay:before { content: fa-content($fa-var-amazon-pay); }
+.#{$fa-css-prefix}-ambulance:before { content: fa-content($fa-var-ambulance); }
+.#{$fa-css-prefix}-american-sign-language-interpreting:before { content: fa-content($fa-var-american-sign-language-interpreting); }
+.#{$fa-css-prefix}-amilia:before { content: fa-content($fa-var-amilia); }
+.#{$fa-css-prefix}-anchor:before { content: fa-content($fa-var-anchor); }
+.#{$fa-css-prefix}-android:before { content: fa-content($fa-var-android); }
+.#{$fa-css-prefix}-angellist:before { content: fa-content($fa-var-angellist); }
+.#{$fa-css-prefix}-angle-double-down:before { content: fa-content($fa-var-angle-double-down); }
+.#{$fa-css-prefix}-angle-double-left:before { content: fa-content($fa-var-angle-double-left); }
+.#{$fa-css-prefix}-angle-double-right:before { content: fa-content($fa-var-angle-double-right); }
+.#{$fa-css-prefix}-angle-double-up:before { content: fa-content($fa-var-angle-double-up); }
+.#{$fa-css-prefix}-angle-down:before { content: fa-content($fa-var-angle-down); }
+.#{$fa-css-prefix}-angle-left:before { content: fa-content($fa-var-angle-left); }
+.#{$fa-css-prefix}-angle-right:before { content: fa-content($fa-var-angle-right); }
+.#{$fa-css-prefix}-angle-up:before { content: fa-content($fa-var-angle-up); }
+.#{$fa-css-prefix}-angry:before { content: fa-content($fa-var-angry); }
+.#{$fa-css-prefix}-angrycreative:before { content: fa-content($fa-var-angrycreative); }
+.#{$fa-css-prefix}-angular:before { content: fa-content($fa-var-angular); }
+.#{$fa-css-prefix}-ankh:before { content: fa-content($fa-var-ankh); }
+.#{$fa-css-prefix}-app-store:before { content: fa-content($fa-var-app-store); }
+.#{$fa-css-prefix}-app-store-ios:before { content: fa-content($fa-var-app-store-ios); }
+.#{$fa-css-prefix}-apper:before { content: fa-content($fa-var-apper); }
+.#{$fa-css-prefix}-apple:before { content: fa-content($fa-var-apple); }
+.#{$fa-css-prefix}-apple-alt:before { content: fa-content($fa-var-apple-alt); }
+.#{$fa-css-prefix}-apple-pay:before { content: fa-content($fa-var-apple-pay); }
+.#{$fa-css-prefix}-archive:before { content: fa-content($fa-var-archive); }
+.#{$fa-css-prefix}-archway:before { content: fa-content($fa-var-archway); }
+.#{$fa-css-prefix}-arrow-alt-circle-down:before { content: fa-content($fa-var-arrow-alt-circle-down); }
+.#{$fa-css-prefix}-arrow-alt-circle-left:before { content: fa-content($fa-var-arrow-alt-circle-left); }
+.#{$fa-css-prefix}-arrow-alt-circle-right:before { content: fa-content($fa-var-arrow-alt-circle-right); }
+.#{$fa-css-prefix}-arrow-alt-circle-up:before { content: fa-content($fa-var-arrow-alt-circle-up); }
+.#{$fa-css-prefix}-arrow-circle-down:before { content: fa-content($fa-var-arrow-circle-down); }
+.#{$fa-css-prefix}-arrow-circle-left:before { content: fa-content($fa-var-arrow-circle-left); }
+.#{$fa-css-prefix}-arrow-circle-right:before { content: fa-content($fa-var-arrow-circle-right); }
+.#{$fa-css-prefix}-arrow-circle-up:before { content: fa-content($fa-var-arrow-circle-up); }
+.#{$fa-css-prefix}-arrow-down:before { content: fa-content($fa-var-arrow-down); }
+.#{$fa-css-prefix}-arrow-left:before { content: fa-content($fa-var-arrow-left); }
+.#{$fa-css-prefix}-arrow-right:before { content: fa-content($fa-var-arrow-right); }
+.#{$fa-css-prefix}-arrow-up:before { content: fa-content($fa-var-arrow-up); }
+.#{$fa-css-prefix}-arrows-alt:before { content: fa-content($fa-var-arrows-alt); }
+.#{$fa-css-prefix}-arrows-alt-h:before { content: fa-content($fa-var-arrows-alt-h); }
+.#{$fa-css-prefix}-arrows-alt-v:before { content: fa-content($fa-var-arrows-alt-v); }
+.#{$fa-css-prefix}-artstation:before { content: fa-content($fa-var-artstation); }
+.#{$fa-css-prefix}-assistive-listening-systems:before { content: fa-content($fa-var-assistive-listening-systems); }
+.#{$fa-css-prefix}-asterisk:before { content: fa-content($fa-var-asterisk); }
+.#{$fa-css-prefix}-asymmetrik:before { content: fa-content($fa-var-asymmetrik); }
+.#{$fa-css-prefix}-at:before { content: fa-content($fa-var-at); }
+.#{$fa-css-prefix}-atlas:before { content: fa-content($fa-var-atlas); }
+.#{$fa-css-prefix}-atlassian:before { content: fa-content($fa-var-atlassian); }
+.#{$fa-css-prefix}-atom:before { content: fa-content($fa-var-atom); }
+.#{$fa-css-prefix}-audible:before { content: fa-content($fa-var-audible); }
+.#{$fa-css-prefix}-audio-description:before { content: fa-content($fa-var-audio-description); }
+.#{$fa-css-prefix}-autoprefixer:before { content: fa-content($fa-var-autoprefixer); }
+.#{$fa-css-prefix}-avianex:before { content: fa-content($fa-var-avianex); }
+.#{$fa-css-prefix}-aviato:before { content: fa-content($fa-var-aviato); }
+.#{$fa-css-prefix}-award:before { content: fa-content($fa-var-award); }
+.#{$fa-css-prefix}-aws:before { content: fa-content($fa-var-aws); }
+.#{$fa-css-prefix}-baby:before { content: fa-content($fa-var-baby); }
+.#{$fa-css-prefix}-baby-carriage:before { content: fa-content($fa-var-baby-carriage); }
+.#{$fa-css-prefix}-backspace:before { content: fa-content($fa-var-backspace); }
+.#{$fa-css-prefix}-backward:before { content: fa-content($fa-var-backward); }
+.#{$fa-css-prefix}-bacon:before { content: fa-content($fa-var-bacon); }
+.#{$fa-css-prefix}-balance-scale:before { content: fa-content($fa-var-balance-scale); }
+.#{$fa-css-prefix}-balance-scale-left:before { content: fa-content($fa-var-balance-scale-left); }
+.#{$fa-css-prefix}-balance-scale-right:before { content: fa-content($fa-var-balance-scale-right); }
+.#{$fa-css-prefix}-ban:before { content: fa-content($fa-var-ban); }
+.#{$fa-css-prefix}-band-aid:before { content: fa-content($fa-var-band-aid); }
+.#{$fa-css-prefix}-bandcamp:before { content: fa-content($fa-var-bandcamp); }
+.#{$fa-css-prefix}-barcode:before { content: fa-content($fa-var-barcode); }
+.#{$fa-css-prefix}-bars:before { content: fa-content($fa-var-bars); }
+.#{$fa-css-prefix}-baseball-ball:before { content: fa-content($fa-var-baseball-ball); }
+.#{$fa-css-prefix}-basketball-ball:before { content: fa-content($fa-var-basketball-ball); }
+.#{$fa-css-prefix}-bath:before { content: fa-content($fa-var-bath); }
+.#{$fa-css-prefix}-battery-empty:before { content: fa-content($fa-var-battery-empty); }
+.#{$fa-css-prefix}-battery-full:before { content: fa-content($fa-var-battery-full); }
+.#{$fa-css-prefix}-battery-half:before { content: fa-content($fa-var-battery-half); }
+.#{$fa-css-prefix}-battery-quarter:before { content: fa-content($fa-var-battery-quarter); }
+.#{$fa-css-prefix}-battery-three-quarters:before { content: fa-content($fa-var-battery-three-quarters); }
+.#{$fa-css-prefix}-battle-net:before { content: fa-content($fa-var-battle-net); }
+.#{$fa-css-prefix}-bed:before { content: fa-content($fa-var-bed); }
+.#{$fa-css-prefix}-beer:before { content: fa-content($fa-var-beer); }
+.#{$fa-css-prefix}-behance:before { content: fa-content($fa-var-behance); }
+.#{$fa-css-prefix}-behance-square:before { content: fa-content($fa-var-behance-square); }
+.#{$fa-css-prefix}-bell:before { content: fa-content($fa-var-bell); }
+.#{$fa-css-prefix}-bell-slash:before { content: fa-content($fa-var-bell-slash); }
+.#{$fa-css-prefix}-bezier-curve:before { content: fa-content($fa-var-bezier-curve); }
+.#{$fa-css-prefix}-bible:before { content: fa-content($fa-var-bible); }
+.#{$fa-css-prefix}-bicycle:before { content: fa-content($fa-var-bicycle); }
+.#{$fa-css-prefix}-biking:before { content: fa-content($fa-var-biking); }
+.#{$fa-css-prefix}-bimobject:before { content: fa-content($fa-var-bimobject); }
+.#{$fa-css-prefix}-binoculars:before { content: fa-content($fa-var-binoculars); }
+.#{$fa-css-prefix}-biohazard:before { content: fa-content($fa-var-biohazard); }
+.#{$fa-css-prefix}-birthday-cake:before { content: fa-content($fa-var-birthday-cake); }
+.#{$fa-css-prefix}-bitbucket:before { content: fa-content($fa-var-bitbucket); }
+.#{$fa-css-prefix}-bitcoin:before { content: fa-content($fa-var-bitcoin); }
+.#{$fa-css-prefix}-bity:before { content: fa-content($fa-var-bity); }
+.#{$fa-css-prefix}-black-tie:before { content: fa-content($fa-var-black-tie); }
+.#{$fa-css-prefix}-blackberry:before { content: fa-content($fa-var-blackberry); }
+.#{$fa-css-prefix}-blender:before { content: fa-content($fa-var-blender); }
+.#{$fa-css-prefix}-blender-phone:before { content: fa-content($fa-var-blender-phone); }
+.#{$fa-css-prefix}-blind:before { content: fa-content($fa-var-blind); }
+.#{$fa-css-prefix}-blog:before { content: fa-content($fa-var-blog); }
+.#{$fa-css-prefix}-blogger:before { content: fa-content($fa-var-blogger); }
+.#{$fa-css-prefix}-blogger-b:before { content: fa-content($fa-var-blogger-b); }
+.#{$fa-css-prefix}-bluetooth:before { content: fa-content($fa-var-bluetooth); }
+.#{$fa-css-prefix}-bluetooth-b:before { content: fa-content($fa-var-bluetooth-b); }
+.#{$fa-css-prefix}-bold:before { content: fa-content($fa-var-bold); }
+.#{$fa-css-prefix}-bolt:before { content: fa-content($fa-var-bolt); }
+.#{$fa-css-prefix}-bomb:before { content: fa-content($fa-var-bomb); }
+.#{$fa-css-prefix}-bone:before { content: fa-content($fa-var-bone); }
+.#{$fa-css-prefix}-bong:before { content: fa-content($fa-var-bong); }
+.#{$fa-css-prefix}-book:before { content: fa-content($fa-var-book); }
+.#{$fa-css-prefix}-book-dead:before { content: fa-content($fa-var-book-dead); }
+.#{$fa-css-prefix}-book-medical:before { content: fa-content($fa-var-book-medical); }
+.#{$fa-css-prefix}-book-open:before { content: fa-content($fa-var-book-open); }
+.#{$fa-css-prefix}-book-reader:before { content: fa-content($fa-var-book-reader); }
+.#{$fa-css-prefix}-bookmark:before { content: fa-content($fa-var-bookmark); }
+.#{$fa-css-prefix}-bootstrap:before { content: fa-content($fa-var-bootstrap); }
+.#{$fa-css-prefix}-border-all:before { content: fa-content($fa-var-border-all); }
+.#{$fa-css-prefix}-border-none:before { content: fa-content($fa-var-border-none); }
+.#{$fa-css-prefix}-border-style:before { content: fa-content($fa-var-border-style); }
+.#{$fa-css-prefix}-bowling-ball:before { content: fa-content($fa-var-bowling-ball); }
+.#{$fa-css-prefix}-box:before { content: fa-content($fa-var-box); }
+.#{$fa-css-prefix}-box-open:before { content: fa-content($fa-var-box-open); }
+.#{$fa-css-prefix}-boxes:before { content: fa-content($fa-var-boxes); }
+.#{$fa-css-prefix}-braille:before { content: fa-content($fa-var-braille); }
+.#{$fa-css-prefix}-brain:before { content: fa-content($fa-var-brain); }
+.#{$fa-css-prefix}-bread-slice:before { content: fa-content($fa-var-bread-slice); }
+.#{$fa-css-prefix}-briefcase:before { content: fa-content($fa-var-briefcase); }
+.#{$fa-css-prefix}-briefcase-medical:before { content: fa-content($fa-var-briefcase-medical); }
+.#{$fa-css-prefix}-broadcast-tower:before { content: fa-content($fa-var-broadcast-tower); }
+.#{$fa-css-prefix}-broom:before { content: fa-content($fa-var-broom); }
+.#{$fa-css-prefix}-brush:before { content: fa-content($fa-var-brush); }
+.#{$fa-css-prefix}-btc:before { content: fa-content($fa-var-btc); }
+.#{$fa-css-prefix}-buffer:before { content: fa-content($fa-var-buffer); }
+.#{$fa-css-prefix}-bug:before { content: fa-content($fa-var-bug); }
+.#{$fa-css-prefix}-building:before { content: fa-content($fa-var-building); }
+.#{$fa-css-prefix}-bullhorn:before { content: fa-content($fa-var-bullhorn); }
+.#{$fa-css-prefix}-bullseye:before { content: fa-content($fa-var-bullseye); }
+.#{$fa-css-prefix}-burn:before { content: fa-content($fa-var-burn); }
+.#{$fa-css-prefix}-buromobelexperte:before { content: fa-content($fa-var-buromobelexperte); }
+.#{$fa-css-prefix}-bus:before { content: fa-content($fa-var-bus); }
+.#{$fa-css-prefix}-bus-alt:before { content: fa-content($fa-var-bus-alt); }
+.#{$fa-css-prefix}-business-time:before { content: fa-content($fa-var-business-time); }
+.#{$fa-css-prefix}-buy-n-large:before { content: fa-content($fa-var-buy-n-large); }
+.#{$fa-css-prefix}-buysellads:before { content: fa-content($fa-var-buysellads); }
+.#{$fa-css-prefix}-calculator:before { content: fa-content($fa-var-calculator); }
+.#{$fa-css-prefix}-calendar:before { content: fa-content($fa-var-calendar); }
+.#{$fa-css-prefix}-calendar-alt:before { content: fa-content($fa-var-calendar-alt); }
+.#{$fa-css-prefix}-calendar-check:before { content: fa-content($fa-var-calendar-check); }
+.#{$fa-css-prefix}-calendar-day:before { content: fa-content($fa-var-calendar-day); }
+.#{$fa-css-prefix}-calendar-minus:before { content: fa-content($fa-var-calendar-minus); }
+.#{$fa-css-prefix}-calendar-plus:before { content: fa-content($fa-var-calendar-plus); }
+.#{$fa-css-prefix}-calendar-times:before { content: fa-content($fa-var-calendar-times); }
+.#{$fa-css-prefix}-calendar-week:before { content: fa-content($fa-var-calendar-week); }
+.#{$fa-css-prefix}-camera:before { content: fa-content($fa-var-camera); }
+.#{$fa-css-prefix}-camera-retro:before { content: fa-content($fa-var-camera-retro); }
+.#{$fa-css-prefix}-campground:before { content: fa-content($fa-var-campground); }
+.#{$fa-css-prefix}-canadian-maple-leaf:before { content: fa-content($fa-var-canadian-maple-leaf); }
+.#{$fa-css-prefix}-candy-cane:before { content: fa-content($fa-var-candy-cane); }
+.#{$fa-css-prefix}-cannabis:before { content: fa-content($fa-var-cannabis); }
+.#{$fa-css-prefix}-capsules:before { content: fa-content($fa-var-capsules); }
+.#{$fa-css-prefix}-car:before { content: fa-content($fa-var-car); }
+.#{$fa-css-prefix}-car-alt:before { content: fa-content($fa-var-car-alt); }
+.#{$fa-css-prefix}-car-battery:before { content: fa-content($fa-var-car-battery); }
+.#{$fa-css-prefix}-car-crash:before { content: fa-content($fa-var-car-crash); }
+.#{$fa-css-prefix}-car-side:before { content: fa-content($fa-var-car-side); }
+.#{$fa-css-prefix}-caret-down:before { content: fa-content($fa-var-caret-down); }
+.#{$fa-css-prefix}-caret-left:before { content: fa-content($fa-var-caret-left); }
+.#{$fa-css-prefix}-caret-right:before { content: fa-content($fa-var-caret-right); }
+.#{$fa-css-prefix}-caret-square-down:before { content: fa-content($fa-var-caret-square-down); }
+.#{$fa-css-prefix}-caret-square-left:before { content: fa-content($fa-var-caret-square-left); }
+.#{$fa-css-prefix}-caret-square-right:before { content: fa-content($fa-var-caret-square-right); }
+.#{$fa-css-prefix}-caret-square-up:before { content: fa-content($fa-var-caret-square-up); }
+.#{$fa-css-prefix}-caret-up:before { content: fa-content($fa-var-caret-up); }
+.#{$fa-css-prefix}-carrot:before { content: fa-content($fa-var-carrot); }
+.#{$fa-css-prefix}-cart-arrow-down:before { content: fa-content($fa-var-cart-arrow-down); }
+.#{$fa-css-prefix}-cart-plus:before { content: fa-content($fa-var-cart-plus); }
+.#{$fa-css-prefix}-cash-register:before { content: fa-content($fa-var-cash-register); }
+.#{$fa-css-prefix}-cat:before { content: fa-content($fa-var-cat); }
+.#{$fa-css-prefix}-cc-amazon-pay:before { content: fa-content($fa-var-cc-amazon-pay); }
+.#{$fa-css-prefix}-cc-amex:before { content: fa-content($fa-var-cc-amex); }
+.#{$fa-css-prefix}-cc-apple-pay:before { content: fa-content($fa-var-cc-apple-pay); }
+.#{$fa-css-prefix}-cc-diners-club:before { content: fa-content($fa-var-cc-diners-club); }
+.#{$fa-css-prefix}-cc-discover:before { content: fa-content($fa-var-cc-discover); }
+.#{$fa-css-prefix}-cc-jcb:before { content: fa-content($fa-var-cc-jcb); }
+.#{$fa-css-prefix}-cc-mastercard:before { content: fa-content($fa-var-cc-mastercard); }
+.#{$fa-css-prefix}-cc-paypal:before { content: fa-content($fa-var-cc-paypal); }
+.#{$fa-css-prefix}-cc-stripe:before { content: fa-content($fa-var-cc-stripe); }
+.#{$fa-css-prefix}-cc-visa:before { content: fa-content($fa-var-cc-visa); }
+.#{$fa-css-prefix}-centercode:before { content: fa-content($fa-var-centercode); }
+.#{$fa-css-prefix}-centos:before { content: fa-content($fa-var-centos); }
+.#{$fa-css-prefix}-certificate:before { content: fa-content($fa-var-certificate); }
+.#{$fa-css-prefix}-chair:before { content: fa-content($fa-var-chair); }
+.#{$fa-css-prefix}-chalkboard:before { content: fa-content($fa-var-chalkboard); }
+.#{$fa-css-prefix}-chalkboard-teacher:before { content: fa-content($fa-var-chalkboard-teacher); }
+.#{$fa-css-prefix}-charging-station:before { content: fa-content($fa-var-charging-station); }
+.#{$fa-css-prefix}-chart-area:before { content: fa-content($fa-var-chart-area); }
+.#{$fa-css-prefix}-chart-bar:before { content: fa-content($fa-var-chart-bar); }
+.#{$fa-css-prefix}-chart-line:before { content: fa-content($fa-var-chart-line); }
+.#{$fa-css-prefix}-chart-pie:before { content: fa-content($fa-var-chart-pie); }
+.#{$fa-css-prefix}-check:before { content: fa-content($fa-var-check); }
+.#{$fa-css-prefix}-check-circle:before { content: fa-content($fa-var-check-circle); }
+.#{$fa-css-prefix}-check-double:before { content: fa-content($fa-var-check-double); }
+.#{$fa-css-prefix}-check-square:before { content: fa-content($fa-var-check-square); }
+.#{$fa-css-prefix}-cheese:before { content: fa-content($fa-var-cheese); }
+.#{$fa-css-prefix}-chess:before { content: fa-content($fa-var-chess); }
+.#{$fa-css-prefix}-chess-bishop:before { content: fa-content($fa-var-chess-bishop); }
+.#{$fa-css-prefix}-chess-board:before { content: fa-content($fa-var-chess-board); }
+.#{$fa-css-prefix}-chess-king:before { content: fa-content($fa-var-chess-king); }
+.#{$fa-css-prefix}-chess-knight:before { content: fa-content($fa-var-chess-knight); }
+.#{$fa-css-prefix}-chess-pawn:before { content: fa-content($fa-var-chess-pawn); }
+.#{$fa-css-prefix}-chess-queen:before { content: fa-content($fa-var-chess-queen); }
+.#{$fa-css-prefix}-chess-rook:before { content: fa-content($fa-var-chess-rook); }
+.#{$fa-css-prefix}-chevron-circle-down:before { content: fa-content($fa-var-chevron-circle-down); }
+.#{$fa-css-prefix}-chevron-circle-left:before { content: fa-content($fa-var-chevron-circle-left); }
+.#{$fa-css-prefix}-chevron-circle-right:before { content: fa-content($fa-var-chevron-circle-right); }
+.#{$fa-css-prefix}-chevron-circle-up:before { content: fa-content($fa-var-chevron-circle-up); }
+.#{$fa-css-prefix}-chevron-down:before { content: fa-content($fa-var-chevron-down); }
+.#{$fa-css-prefix}-chevron-left:before { content: fa-content($fa-var-chevron-left); }
+.#{$fa-css-prefix}-chevron-right:before { content: fa-content($fa-var-chevron-right); }
+.#{$fa-css-prefix}-chevron-up:before { content: fa-content($fa-var-chevron-up); }
+.#{$fa-css-prefix}-child:before { content: fa-content($fa-var-child); }
+.#{$fa-css-prefix}-chrome:before { content: fa-content($fa-var-chrome); }
+.#{$fa-css-prefix}-chromecast:before { content: fa-content($fa-var-chromecast); }
+.#{$fa-css-prefix}-church:before { content: fa-content($fa-var-church); }
+.#{$fa-css-prefix}-circle:before { content: fa-content($fa-var-circle); }
+.#{$fa-css-prefix}-circle-notch:before { content: fa-content($fa-var-circle-notch); }
+.#{$fa-css-prefix}-city:before { content: fa-content($fa-var-city); }
+.#{$fa-css-prefix}-clinic-medical:before { content: fa-content($fa-var-clinic-medical); }
+.#{$fa-css-prefix}-clipboard:before { content: fa-content($fa-var-clipboard); }
+.#{$fa-css-prefix}-clipboard-check:before { content: fa-content($fa-var-clipboard-check); }
+.#{$fa-css-prefix}-clipboard-list:before { content: fa-content($fa-var-clipboard-list); }
+.#{$fa-css-prefix}-clock:before { content: fa-content($fa-var-clock); }
+.#{$fa-css-prefix}-clone:before { content: fa-content($fa-var-clone); }
+.#{$fa-css-prefix}-closed-captioning:before { content: fa-content($fa-var-closed-captioning); }
+.#{$fa-css-prefix}-cloud:before { content: fa-content($fa-var-cloud); }
+.#{$fa-css-prefix}-cloud-download-alt:before { content: fa-content($fa-var-cloud-download-alt); }
+.#{$fa-css-prefix}-cloud-meatball:before { content: fa-content($fa-var-cloud-meatball); }
+.#{$fa-css-prefix}-cloud-moon:before { content: fa-content($fa-var-cloud-moon); }
+.#{$fa-css-prefix}-cloud-moon-rain:before { content: fa-content($fa-var-cloud-moon-rain); }
+.#{$fa-css-prefix}-cloud-rain:before { content: fa-content($fa-var-cloud-rain); }
+.#{$fa-css-prefix}-cloud-showers-heavy:before { content: fa-content($fa-var-cloud-showers-heavy); }
+.#{$fa-css-prefix}-cloud-sun:before { content: fa-content($fa-var-cloud-sun); }
+.#{$fa-css-prefix}-cloud-sun-rain:before { content: fa-content($fa-var-cloud-sun-rain); }
+.#{$fa-css-prefix}-cloud-upload-alt:before { content: fa-content($fa-var-cloud-upload-alt); }
+.#{$fa-css-prefix}-cloudscale:before { content: fa-content($fa-var-cloudscale); }
+.#{$fa-css-prefix}-cloudsmith:before { content: fa-content($fa-var-cloudsmith); }
+.#{$fa-css-prefix}-cloudversify:before { content: fa-content($fa-var-cloudversify); }
+.#{$fa-css-prefix}-cocktail:before { content: fa-content($fa-var-cocktail); }
+.#{$fa-css-prefix}-code:before { content: fa-content($fa-var-code); }
+.#{$fa-css-prefix}-code-branch:before { content: fa-content($fa-var-code-branch); }
+.#{$fa-css-prefix}-codepen:before { content: fa-content($fa-var-codepen); }
+.#{$fa-css-prefix}-codiepie:before { content: fa-content($fa-var-codiepie); }
+.#{$fa-css-prefix}-coffee:before { content: fa-content($fa-var-coffee); }
+.#{$fa-css-prefix}-cog:before { content: fa-content($fa-var-cog); }
+.#{$fa-css-prefix}-cogs:before { content: fa-content($fa-var-cogs); }
+.#{$fa-css-prefix}-coins:before { content: fa-content($fa-var-coins); }
+.#{$fa-css-prefix}-columns:before { content: fa-content($fa-var-columns); }
+.#{$fa-css-prefix}-comment:before { content: fa-content($fa-var-comment); }
+.#{$fa-css-prefix}-comment-alt:before { content: fa-content($fa-var-comment-alt); }
+.#{$fa-css-prefix}-comment-dollar:before { content: fa-content($fa-var-comment-dollar); }
+.#{$fa-css-prefix}-comment-dots:before { content: fa-content($fa-var-comment-dots); }
+.#{$fa-css-prefix}-comment-medical:before { content: fa-content($fa-var-comment-medical); }
+.#{$fa-css-prefix}-comment-slash:before { content: fa-content($fa-var-comment-slash); }
+.#{$fa-css-prefix}-comments:before { content: fa-content($fa-var-comments); }
+.#{$fa-css-prefix}-comments-dollar:before { content: fa-content($fa-var-comments-dollar); }
+.#{$fa-css-prefix}-compact-disc:before { content: fa-content($fa-var-compact-disc); }
+.#{$fa-css-prefix}-compass:before { content: fa-content($fa-var-compass); }
+.#{$fa-css-prefix}-compress:before { content: fa-content($fa-var-compress); }
+.#{$fa-css-prefix}-compress-arrows-alt:before { content: fa-content($fa-var-compress-arrows-alt); }
+.#{$fa-css-prefix}-concierge-bell:before { content: fa-content($fa-var-concierge-bell); }
+.#{$fa-css-prefix}-confluence:before { content: fa-content($fa-var-confluence); }
+.#{$fa-css-prefix}-connectdevelop:before { content: fa-content($fa-var-connectdevelop); }
+.#{$fa-css-prefix}-contao:before { content: fa-content($fa-var-contao); }
+.#{$fa-css-prefix}-cookie:before { content: fa-content($fa-var-cookie); }
+.#{$fa-css-prefix}-cookie-bite:before { content: fa-content($fa-var-cookie-bite); }
+.#{$fa-css-prefix}-copy:before { content: fa-content($fa-var-copy); }
+.#{$fa-css-prefix}-copyright:before { content: fa-content($fa-var-copyright); }
+.#{$fa-css-prefix}-cotton-bureau:before { content: fa-content($fa-var-cotton-bureau); }
+.#{$fa-css-prefix}-couch:before { content: fa-content($fa-var-couch); }
+.#{$fa-css-prefix}-cpanel:before { content: fa-content($fa-var-cpanel); }
+.#{$fa-css-prefix}-creative-commons:before { content: fa-content($fa-var-creative-commons); }
+.#{$fa-css-prefix}-creative-commons-by:before { content: fa-content($fa-var-creative-commons-by); }
+.#{$fa-css-prefix}-creative-commons-nc:before { content: fa-content($fa-var-creative-commons-nc); }
+.#{$fa-css-prefix}-creative-commons-nc-eu:before { content: fa-content($fa-var-creative-commons-nc-eu); }
+.#{$fa-css-prefix}-creative-commons-nc-jp:before { content: fa-content($fa-var-creative-commons-nc-jp); }
+.#{$fa-css-prefix}-creative-commons-nd:before { content: fa-content($fa-var-creative-commons-nd); }
+.#{$fa-css-prefix}-creative-commons-pd:before { content: fa-content($fa-var-creative-commons-pd); }
+.#{$fa-css-prefix}-creative-commons-pd-alt:before { content: fa-content($fa-var-creative-commons-pd-alt); }
+.#{$fa-css-prefix}-creative-commons-remix:before { content: fa-content($fa-var-creative-commons-remix); }
+.#{$fa-css-prefix}-creative-commons-sa:before { content: fa-content($fa-var-creative-commons-sa); }
+.#{$fa-css-prefix}-creative-commons-sampling:before { content: fa-content($fa-var-creative-commons-sampling); }
+.#{$fa-css-prefix}-creative-commons-sampling-plus:before { content: fa-content($fa-var-creative-commons-sampling-plus); }
+.#{$fa-css-prefix}-creative-commons-share:before { content: fa-content($fa-var-creative-commons-share); }
+.#{$fa-css-prefix}-creative-commons-zero:before { content: fa-content($fa-var-creative-commons-zero); }
+.#{$fa-css-prefix}-credit-card:before { content: fa-content($fa-var-credit-card); }
+.#{$fa-css-prefix}-critical-role:before { content: fa-content($fa-var-critical-role); }
+.#{$fa-css-prefix}-crop:before { content: fa-content($fa-var-crop); }
+.#{$fa-css-prefix}-crop-alt:before { content: fa-content($fa-var-crop-alt); }
+.#{$fa-css-prefix}-cross:before { content: fa-content($fa-var-cross); }
+.#{$fa-css-prefix}-crosshairs:before { content: fa-content($fa-var-crosshairs); }
+.#{$fa-css-prefix}-crow:before { content: fa-content($fa-var-crow); }
+.#{$fa-css-prefix}-crown:before { content: fa-content($fa-var-crown); }
+.#{$fa-css-prefix}-crutch:before { content: fa-content($fa-var-crutch); }
+.#{$fa-css-prefix}-css3:before { content: fa-content($fa-var-css3); }
+.#{$fa-css-prefix}-css3-alt:before { content: fa-content($fa-var-css3-alt); }
+.#{$fa-css-prefix}-cube:before { content: fa-content($fa-var-cube); }
+.#{$fa-css-prefix}-cubes:before { content: fa-content($fa-var-cubes); }
+.#{$fa-css-prefix}-cut:before { content: fa-content($fa-var-cut); }
+.#{$fa-css-prefix}-cuttlefish:before { content: fa-content($fa-var-cuttlefish); }
+.#{$fa-css-prefix}-d-and-d:before { content: fa-content($fa-var-d-and-d); }
+.#{$fa-css-prefix}-d-and-d-beyond:before { content: fa-content($fa-var-d-and-d-beyond); }
+.#{$fa-css-prefix}-dashcube:before { content: fa-content($fa-var-dashcube); }
+.#{$fa-css-prefix}-database:before { content: fa-content($fa-var-database); }
+.#{$fa-css-prefix}-deaf:before { content: fa-content($fa-var-deaf); }
+.#{$fa-css-prefix}-delicious:before { content: fa-content($fa-var-delicious); }
+.#{$fa-css-prefix}-democrat:before { content: fa-content($fa-var-democrat); }
+.#{$fa-css-prefix}-deploydog:before { content: fa-content($fa-var-deploydog); }
+.#{$fa-css-prefix}-deskpro:before { content: fa-content($fa-var-deskpro); }
+.#{$fa-css-prefix}-desktop:before { content: fa-content($fa-var-desktop); }
+.#{$fa-css-prefix}-dev:before { content: fa-content($fa-var-dev); }
+.#{$fa-css-prefix}-deviantart:before { content: fa-content($fa-var-deviantart); }
+.#{$fa-css-prefix}-dharmachakra:before { content: fa-content($fa-var-dharmachakra); }
+.#{$fa-css-prefix}-dhl:before { content: fa-content($fa-var-dhl); }
+.#{$fa-css-prefix}-diagnoses:before { content: fa-content($fa-var-diagnoses); }
+.#{$fa-css-prefix}-diaspora:before { content: fa-content($fa-var-diaspora); }
+.#{$fa-css-prefix}-dice:before { content: fa-content($fa-var-dice); }
+.#{$fa-css-prefix}-dice-d20:before { content: fa-content($fa-var-dice-d20); }
+.#{$fa-css-prefix}-dice-d6:before { content: fa-content($fa-var-dice-d6); }
+.#{$fa-css-prefix}-dice-five:before { content: fa-content($fa-var-dice-five); }
+.#{$fa-css-prefix}-dice-four:before { content: fa-content($fa-var-dice-four); }
+.#{$fa-css-prefix}-dice-one:before { content: fa-content($fa-var-dice-one); }
+.#{$fa-css-prefix}-dice-six:before { content: fa-content($fa-var-dice-six); }
+.#{$fa-css-prefix}-dice-three:before { content: fa-content($fa-var-dice-three); }
+.#{$fa-css-prefix}-dice-two:before { content: fa-content($fa-var-dice-two); }
+.#{$fa-css-prefix}-digg:before { content: fa-content($fa-var-digg); }
+.#{$fa-css-prefix}-digital-ocean:before { content: fa-content($fa-var-digital-ocean); }
+.#{$fa-css-prefix}-digital-tachograph:before { content: fa-content($fa-var-digital-tachograph); }
+.#{$fa-css-prefix}-directions:before { content: fa-content($fa-var-directions); }
+.#{$fa-css-prefix}-discord:before { content: fa-content($fa-var-discord); }
+.#{$fa-css-prefix}-discourse:before { content: fa-content($fa-var-discourse); }
+.#{$fa-css-prefix}-divide:before { content: fa-content($fa-var-divide); }
+.#{$fa-css-prefix}-dizzy:before { content: fa-content($fa-var-dizzy); }
+.#{$fa-css-prefix}-dna:before { content: fa-content($fa-var-dna); }
+.#{$fa-css-prefix}-dochub:before { content: fa-content($fa-var-dochub); }
+.#{$fa-css-prefix}-docker:before { content: fa-content($fa-var-docker); }
+.#{$fa-css-prefix}-dog:before { content: fa-content($fa-var-dog); }
+.#{$fa-css-prefix}-dollar-sign:before { content: fa-content($fa-var-dollar-sign); }
+.#{$fa-css-prefix}-dolly:before { content: fa-content($fa-var-dolly); }
+.#{$fa-css-prefix}-dolly-flatbed:before { content: fa-content($fa-var-dolly-flatbed); }
+.#{$fa-css-prefix}-donate:before { content: fa-content($fa-var-donate); }
+.#{$fa-css-prefix}-door-closed:before { content: fa-content($fa-var-door-closed); }
+.#{$fa-css-prefix}-door-open:before { content: fa-content($fa-var-door-open); }
+.#{$fa-css-prefix}-dot-circle:before { content: fa-content($fa-var-dot-circle); }
+.#{$fa-css-prefix}-dove:before { content: fa-content($fa-var-dove); }
+.#{$fa-css-prefix}-download:before { content: fa-content($fa-var-download); }
+.#{$fa-css-prefix}-draft2digital:before { content: fa-content($fa-var-draft2digital); }
+.#{$fa-css-prefix}-drafting-compass:before { content: fa-content($fa-var-drafting-compass); }
+.#{$fa-css-prefix}-dragon:before { content: fa-content($fa-var-dragon); }
+.#{$fa-css-prefix}-draw-polygon:before { content: fa-content($fa-var-draw-polygon); }
+.#{$fa-css-prefix}-dribbble:before { content: fa-content($fa-var-dribbble); }
+.#{$fa-css-prefix}-dribbble-square:before { content: fa-content($fa-var-dribbble-square); }
+.#{$fa-css-prefix}-dropbox:before { content: fa-content($fa-var-dropbox); }
+.#{$fa-css-prefix}-drum:before { content: fa-content($fa-var-drum); }
+.#{$fa-css-prefix}-drum-steelpan:before { content: fa-content($fa-var-drum-steelpan); }
+.#{$fa-css-prefix}-drumstick-bite:before { content: fa-content($fa-var-drumstick-bite); }
+.#{$fa-css-prefix}-drupal:before { content: fa-content($fa-var-drupal); }
+.#{$fa-css-prefix}-dumbbell:before { content: fa-content($fa-var-dumbbell); }
+.#{$fa-css-prefix}-dumpster:before { content: fa-content($fa-var-dumpster); }
+.#{$fa-css-prefix}-dumpster-fire:before { content: fa-content($fa-var-dumpster-fire); }
+.#{$fa-css-prefix}-dungeon:before { content: fa-content($fa-var-dungeon); }
+.#{$fa-css-prefix}-dyalog:before { content: fa-content($fa-var-dyalog); }
+.#{$fa-css-prefix}-earlybirds:before { content: fa-content($fa-var-earlybirds); }
+.#{$fa-css-prefix}-ebay:before { content: fa-content($fa-var-ebay); }
+.#{$fa-css-prefix}-edge:before { content: fa-content($fa-var-edge); }
+.#{$fa-css-prefix}-edit:before { content: fa-content($fa-var-edit); }
+.#{$fa-css-prefix}-egg:before { content: fa-content($fa-var-egg); }
+.#{$fa-css-prefix}-eject:before { content: fa-content($fa-var-eject); }
+.#{$fa-css-prefix}-elementor:before { content: fa-content($fa-var-elementor); }
+.#{$fa-css-prefix}-ellipsis-h:before { content: fa-content($fa-var-ellipsis-h); }
+.#{$fa-css-prefix}-ellipsis-v:before { content: fa-content($fa-var-ellipsis-v); }
+.#{$fa-css-prefix}-ello:before { content: fa-content($fa-var-ello); }
+.#{$fa-css-prefix}-ember:before { content: fa-content($fa-var-ember); }
+.#{$fa-css-prefix}-empire:before { content: fa-content($fa-var-empire); }
+.#{$fa-css-prefix}-envelope:before { content: fa-content($fa-var-envelope); }
+.#{$fa-css-prefix}-envelope-open:before { content: fa-content($fa-var-envelope-open); }
+.#{$fa-css-prefix}-envelope-open-text:before { content: fa-content($fa-var-envelope-open-text); }
+.#{$fa-css-prefix}-envelope-square:before { content: fa-content($fa-var-envelope-square); }
+.#{$fa-css-prefix}-envira:before { content: fa-content($fa-var-envira); }
+.#{$fa-css-prefix}-equals:before { content: fa-content($fa-var-equals); }
+.#{$fa-css-prefix}-eraser:before { content: fa-content($fa-var-eraser); }
+.#{$fa-css-prefix}-erlang:before { content: fa-content($fa-var-erlang); }
+.#{$fa-css-prefix}-ethereum:before { content: fa-content($fa-var-ethereum); }
+.#{$fa-css-prefix}-ethernet:before { content: fa-content($fa-var-ethernet); }
+.#{$fa-css-prefix}-etsy:before { content: fa-content($fa-var-etsy); }
+.#{$fa-css-prefix}-euro-sign:before { content: fa-content($fa-var-euro-sign); }
+.#{$fa-css-prefix}-evernote:before { content: fa-content($fa-var-evernote); }
+.#{$fa-css-prefix}-exchange-alt:before { content: fa-content($fa-var-exchange-alt); }
+.#{$fa-css-prefix}-exclamation:before { content: fa-content($fa-var-exclamation); }
+.#{$fa-css-prefix}-exclamation-circle:before { content: fa-content($fa-var-exclamation-circle); }
+.#{$fa-css-prefix}-exclamation-triangle:before { content: fa-content($fa-var-exclamation-triangle); }
+.#{$fa-css-prefix}-expand:before { content: fa-content($fa-var-expand); }
+.#{$fa-css-prefix}-expand-arrows-alt:before { content: fa-content($fa-var-expand-arrows-alt); }
+.#{$fa-css-prefix}-expeditedssl:before { content: fa-content($fa-var-expeditedssl); }
+.#{$fa-css-prefix}-external-link-alt:before { content: fa-content($fa-var-external-link-alt); }
+.#{$fa-css-prefix}-external-link-square-alt:before { content: fa-content($fa-var-external-link-square-alt); }
+.#{$fa-css-prefix}-eye:before { content: fa-content($fa-var-eye); }
+.#{$fa-css-prefix}-eye-dropper:before { content: fa-content($fa-var-eye-dropper); }
+.#{$fa-css-prefix}-eye-slash:before { content: fa-content($fa-var-eye-slash); }
+.#{$fa-css-prefix}-facebook:before { content: fa-content($fa-var-facebook); }
+.#{$fa-css-prefix}-facebook-f:before { content: fa-content($fa-var-facebook-f); }
+.#{$fa-css-prefix}-facebook-messenger:before { content: fa-content($fa-var-facebook-messenger); }
+.#{$fa-css-prefix}-facebook-square:before { content: fa-content($fa-var-facebook-square); }
+.#{$fa-css-prefix}-fan:before { content: fa-content($fa-var-fan); }
+.#{$fa-css-prefix}-fantasy-flight-games:before { content: fa-content($fa-var-fantasy-flight-games); }
+.#{$fa-css-prefix}-fast-backward:before { content: fa-content($fa-var-fast-backward); }
+.#{$fa-css-prefix}-fast-forward:before { content: fa-content($fa-var-fast-forward); }
+.#{$fa-css-prefix}-fax:before { content: fa-content($fa-var-fax); }
+.#{$fa-css-prefix}-feather:before { content: fa-content($fa-var-feather); }
+.#{$fa-css-prefix}-feather-alt:before { content: fa-content($fa-var-feather-alt); }
+.#{$fa-css-prefix}-fedex:before { content: fa-content($fa-var-fedex); }
+.#{$fa-css-prefix}-fedora:before { content: fa-content($fa-var-fedora); }
+.#{$fa-css-prefix}-female:before { content: fa-content($fa-var-female); }
+.#{$fa-css-prefix}-fighter-jet:before { content: fa-content($fa-var-fighter-jet); }
+.#{$fa-css-prefix}-figma:before { content: fa-content($fa-var-figma); }
+.#{$fa-css-prefix}-file:before { content: fa-content($fa-var-file); }
+.#{$fa-css-prefix}-file-alt:before { content: fa-content($fa-var-file-alt); }
+.#{$fa-css-prefix}-file-archive:before { content: fa-content($fa-var-file-archive); }
+.#{$fa-css-prefix}-file-audio:before { content: fa-content($fa-var-file-audio); }
+.#{$fa-css-prefix}-file-code:before { content: fa-content($fa-var-file-code); }
+.#{$fa-css-prefix}-file-contract:before { content: fa-content($fa-var-file-contract); }
+.#{$fa-css-prefix}-file-csv:before { content: fa-content($fa-var-file-csv); }
+.#{$fa-css-prefix}-file-download:before { content: fa-content($fa-var-file-download); }
+.#{$fa-css-prefix}-file-excel:before { content: fa-content($fa-var-file-excel); }
+.#{$fa-css-prefix}-file-export:before { content: fa-content($fa-var-file-export); }
+.#{$fa-css-prefix}-file-image:before { content: fa-content($fa-var-file-image); }
+.#{$fa-css-prefix}-file-import:before { content: fa-content($fa-var-file-import); }
+.#{$fa-css-prefix}-file-invoice:before { content: fa-content($fa-var-file-invoice); }
+.#{$fa-css-prefix}-file-invoice-dollar:before { content: fa-content($fa-var-file-invoice-dollar); }
+.#{$fa-css-prefix}-file-medical:before { content: fa-content($fa-var-file-medical); }
+.#{$fa-css-prefix}-file-medical-alt:before { content: fa-content($fa-var-file-medical-alt); }
+.#{$fa-css-prefix}-file-pdf:before { content: fa-content($fa-var-file-pdf); }
+.#{$fa-css-prefix}-file-powerpoint:before { content: fa-content($fa-var-file-powerpoint); }
+.#{$fa-css-prefix}-file-prescription:before { content: fa-content($fa-var-file-prescription); }
+.#{$fa-css-prefix}-file-signature:before { content: fa-content($fa-var-file-signature); }
+.#{$fa-css-prefix}-file-upload:before { content: fa-content($fa-var-file-upload); }
+.#{$fa-css-prefix}-file-video:before { content: fa-content($fa-var-file-video); }
+.#{$fa-css-prefix}-file-word:before { content: fa-content($fa-var-file-word); }
+.#{$fa-css-prefix}-fill:before { content: fa-content($fa-var-fill); }
+.#{$fa-css-prefix}-fill-drip:before { content: fa-content($fa-var-fill-drip); }
+.#{$fa-css-prefix}-film:before { content: fa-content($fa-var-film); }
+.#{$fa-css-prefix}-filter:before { content: fa-content($fa-var-filter); }
+.#{$fa-css-prefix}-fingerprint:before { content: fa-content($fa-var-fingerprint); }
+.#{$fa-css-prefix}-fire:before { content: fa-content($fa-var-fire); }
+.#{$fa-css-prefix}-fire-alt:before { content: fa-content($fa-var-fire-alt); }
+.#{$fa-css-prefix}-fire-extinguisher:before { content: fa-content($fa-var-fire-extinguisher); }
+.#{$fa-css-prefix}-firefox:before { content: fa-content($fa-var-firefox); }
+.#{$fa-css-prefix}-first-aid:before { content: fa-content($fa-var-first-aid); }
+.#{$fa-css-prefix}-first-order:before { content: fa-content($fa-var-first-order); }
+.#{$fa-css-prefix}-first-order-alt:before { content: fa-content($fa-var-first-order-alt); }
+.#{$fa-css-prefix}-firstdraft:before { content: fa-content($fa-var-firstdraft); }
+.#{$fa-css-prefix}-fish:before { content: fa-content($fa-var-fish); }
+.#{$fa-css-prefix}-fist-raised:before { content: fa-content($fa-var-fist-raised); }
+.#{$fa-css-prefix}-flag:before { content: fa-content($fa-var-flag); }
+.#{$fa-css-prefix}-flag-checkered:before { content: fa-content($fa-var-flag-checkered); }
+.#{$fa-css-prefix}-flag-usa:before { content: fa-content($fa-var-flag-usa); }
+.#{$fa-css-prefix}-flask:before { content: fa-content($fa-var-flask); }
+.#{$fa-css-prefix}-flickr:before { content: fa-content($fa-var-flickr); }
+.#{$fa-css-prefix}-flipboard:before { content: fa-content($fa-var-flipboard); }
+.#{$fa-css-prefix}-flushed:before { content: fa-content($fa-var-flushed); }
+.#{$fa-css-prefix}-fly:before { content: fa-content($fa-var-fly); }
+.#{$fa-css-prefix}-folder:before { content: fa-content($fa-var-folder); }
+.#{$fa-css-prefix}-folder-minus:before { content: fa-content($fa-var-folder-minus); }
+.#{$fa-css-prefix}-folder-open:before { content: fa-content($fa-var-folder-open); }
+.#{$fa-css-prefix}-folder-plus:before { content: fa-content($fa-var-folder-plus); }
+.#{$fa-css-prefix}-font:before { content: fa-content($fa-var-font); }
+.#{$fa-css-prefix}-font-awesome:before { content: fa-content($fa-var-font-awesome); }
+.#{$fa-css-prefix}-font-awesome-alt:before { content: fa-content($fa-var-font-awesome-alt); }
+.#{$fa-css-prefix}-font-awesome-flag:before { content: fa-content($fa-var-font-awesome-flag); }
+.#{$fa-css-prefix}-font-awesome-logo-full:before { content: fa-content($fa-var-font-awesome-logo-full); }
+.#{$fa-css-prefix}-fonticons:before { content: fa-content($fa-var-fonticons); }
+.#{$fa-css-prefix}-fonticons-fi:before { content: fa-content($fa-var-fonticons-fi); }
+.#{$fa-css-prefix}-football-ball:before { content: fa-content($fa-var-football-ball); }
+.#{$fa-css-prefix}-fort-awesome:before { content: fa-content($fa-var-fort-awesome); }
+.#{$fa-css-prefix}-fort-awesome-alt:before { content: fa-content($fa-var-fort-awesome-alt); }
+.#{$fa-css-prefix}-forumbee:before { content: fa-content($fa-var-forumbee); }
+.#{$fa-css-prefix}-forward:before { content: fa-content($fa-var-forward); }
+.#{$fa-css-prefix}-foursquare:before { content: fa-content($fa-var-foursquare); }
+.#{$fa-css-prefix}-free-code-camp:before { content: fa-content($fa-var-free-code-camp); }
+.#{$fa-css-prefix}-freebsd:before { content: fa-content($fa-var-freebsd); }
+.#{$fa-css-prefix}-frog:before { content: fa-content($fa-var-frog); }
+.#{$fa-css-prefix}-frown:before { content: fa-content($fa-var-frown); }
+.#{$fa-css-prefix}-frown-open:before { content: fa-content($fa-var-frown-open); }
+.#{$fa-css-prefix}-fulcrum:before { content: fa-content($fa-var-fulcrum); }
+.#{$fa-css-prefix}-funnel-dollar:before { content: fa-content($fa-var-funnel-dollar); }
+.#{$fa-css-prefix}-futbol:before { content: fa-content($fa-var-futbol); }
+.#{$fa-css-prefix}-galactic-republic:before { content: fa-content($fa-var-galactic-republic); }
+.#{$fa-css-prefix}-galactic-senate:before { content: fa-content($fa-var-galactic-senate); }
+.#{$fa-css-prefix}-gamepad:before { content: fa-content($fa-var-gamepad); }
+.#{$fa-css-prefix}-gas-pump:before { content: fa-content($fa-var-gas-pump); }
+.#{$fa-css-prefix}-gavel:before { content: fa-content($fa-var-gavel); }
+.#{$fa-css-prefix}-gem:before { content: fa-content($fa-var-gem); }
+.#{$fa-css-prefix}-genderless:before { content: fa-content($fa-var-genderless); }
+.#{$fa-css-prefix}-get-pocket:before { content: fa-content($fa-var-get-pocket); }
+.#{$fa-css-prefix}-gg:before { content: fa-content($fa-var-gg); }
+.#{$fa-css-prefix}-gg-circle:before { content: fa-content($fa-var-gg-circle); }
+.#{$fa-css-prefix}-ghost:before { content: fa-content($fa-var-ghost); }
+.#{$fa-css-prefix}-gift:before { content: fa-content($fa-var-gift); }
+.#{$fa-css-prefix}-gifts:before { content: fa-content($fa-var-gifts); }
+.#{$fa-css-prefix}-git:before { content: fa-content($fa-var-git); }
+.#{$fa-css-prefix}-git-alt:before { content: fa-content($fa-var-git-alt); }
+.#{$fa-css-prefix}-git-square:before { content: fa-content($fa-var-git-square); }
+.#{$fa-css-prefix}-github:before { content: fa-content($fa-var-github); }
+.#{$fa-css-prefix}-github-alt:before { content: fa-content($fa-var-github-alt); }
+.#{$fa-css-prefix}-github-square:before { content: fa-content($fa-var-github-square); }
+.#{$fa-css-prefix}-gitkraken:before { content: fa-content($fa-var-gitkraken); }
+.#{$fa-css-prefix}-gitlab:before { content: fa-content($fa-var-gitlab); }
+.#{$fa-css-prefix}-gitter:before { content: fa-content($fa-var-gitter); }
+.#{$fa-css-prefix}-glass-cheers:before { content: fa-content($fa-var-glass-cheers); }
+.#{$fa-css-prefix}-glass-martini:before { content: fa-content($fa-var-glass-martini); }
+.#{$fa-css-prefix}-glass-martini-alt:before { content: fa-content($fa-var-glass-martini-alt); }
+.#{$fa-css-prefix}-glass-whiskey:before { content: fa-content($fa-var-glass-whiskey); }
+.#{$fa-css-prefix}-glasses:before { content: fa-content($fa-var-glasses); }
+.#{$fa-css-prefix}-glide:before { content: fa-content($fa-var-glide); }
+.#{$fa-css-prefix}-glide-g:before { content: fa-content($fa-var-glide-g); }
+.#{$fa-css-prefix}-globe:before { content: fa-content($fa-var-globe); }
+.#{$fa-css-prefix}-globe-africa:before { content: fa-content($fa-var-globe-africa); }
+.#{$fa-css-prefix}-globe-americas:before { content: fa-content($fa-var-globe-americas); }
+.#{$fa-css-prefix}-globe-asia:before { content: fa-content($fa-var-globe-asia); }
+.#{$fa-css-prefix}-globe-europe:before { content: fa-content($fa-var-globe-europe); }
+.#{$fa-css-prefix}-gofore:before { content: fa-content($fa-var-gofore); }
+.#{$fa-css-prefix}-golf-ball:before { content: fa-content($fa-var-golf-ball); }
+.#{$fa-css-prefix}-goodreads:before { content: fa-content($fa-var-goodreads); }
+.#{$fa-css-prefix}-goodreads-g:before { content: fa-content($fa-var-goodreads-g); }
+.#{$fa-css-prefix}-google:before { content: fa-content($fa-var-google); }
+.#{$fa-css-prefix}-google-drive:before { content: fa-content($fa-var-google-drive); }
+.#{$fa-css-prefix}-google-play:before { content: fa-content($fa-var-google-play); }
+.#{$fa-css-prefix}-google-plus:before { content: fa-content($fa-var-google-plus); }
+.#{$fa-css-prefix}-google-plus-g:before { content: fa-content($fa-var-google-plus-g); }
+.#{$fa-css-prefix}-google-plus-square:before { content: fa-content($fa-var-google-plus-square); }
+.#{$fa-css-prefix}-google-wallet:before { content: fa-content($fa-var-google-wallet); }
+.#{$fa-css-prefix}-gopuram:before { content: fa-content($fa-var-gopuram); }
+.#{$fa-css-prefix}-graduation-cap:before { content: fa-content($fa-var-graduation-cap); }
+.#{$fa-css-prefix}-gratipay:before { content: fa-content($fa-var-gratipay); }
+.#{$fa-css-prefix}-grav:before { content: fa-content($fa-var-grav); }
+.#{$fa-css-prefix}-greater-than:before { content: fa-content($fa-var-greater-than); }
+.#{$fa-css-prefix}-greater-than-equal:before { content: fa-content($fa-var-greater-than-equal); }
+.#{$fa-css-prefix}-grimace:before { content: fa-content($fa-var-grimace); }
+.#{$fa-css-prefix}-grin:before { content: fa-content($fa-var-grin); }
+.#{$fa-css-prefix}-grin-alt:before { content: fa-content($fa-var-grin-alt); }
+.#{$fa-css-prefix}-grin-beam:before { content: fa-content($fa-var-grin-beam); }
+.#{$fa-css-prefix}-grin-beam-sweat:before { content: fa-content($fa-var-grin-beam-sweat); }
+.#{$fa-css-prefix}-grin-hearts:before { content: fa-content($fa-var-grin-hearts); }
+.#{$fa-css-prefix}-grin-squint:before { content: fa-content($fa-var-grin-squint); }
+.#{$fa-css-prefix}-grin-squint-tears:before { content: fa-content($fa-var-grin-squint-tears); }
+.#{$fa-css-prefix}-grin-stars:before { content: fa-content($fa-var-grin-stars); }
+.#{$fa-css-prefix}-grin-tears:before { content: fa-content($fa-var-grin-tears); }
+.#{$fa-css-prefix}-grin-tongue:before { content: fa-content($fa-var-grin-tongue); }
+.#{$fa-css-prefix}-grin-tongue-squint:before { content: fa-content($fa-var-grin-tongue-squint); }
+.#{$fa-css-prefix}-grin-tongue-wink:before { content: fa-content($fa-var-grin-tongue-wink); }
+.#{$fa-css-prefix}-grin-wink:before { content: fa-content($fa-var-grin-wink); }
+.#{$fa-css-prefix}-grip-horizontal:before { content: fa-content($fa-var-grip-horizontal); }
+.#{$fa-css-prefix}-grip-lines:before { content: fa-content($fa-var-grip-lines); }
+.#{$fa-css-prefix}-grip-lines-vertical:before { content: fa-content($fa-var-grip-lines-vertical); }
+.#{$fa-css-prefix}-grip-vertical:before { content: fa-content($fa-var-grip-vertical); }
+.#{$fa-css-prefix}-gripfire:before { content: fa-content($fa-var-gripfire); }
+.#{$fa-css-prefix}-grunt:before { content: fa-content($fa-var-grunt); }
+.#{$fa-css-prefix}-guitar:before { content: fa-content($fa-var-guitar); }
+.#{$fa-css-prefix}-gulp:before { content: fa-content($fa-var-gulp); }
+.#{$fa-css-prefix}-h-square:before { content: fa-content($fa-var-h-square); }
+.#{$fa-css-prefix}-hacker-news:before { content: fa-content($fa-var-hacker-news); }
+.#{$fa-css-prefix}-hacker-news-square:before { content: fa-content($fa-var-hacker-news-square); }
+.#{$fa-css-prefix}-hackerrank:before { content: fa-content($fa-var-hackerrank); }
+.#{$fa-css-prefix}-hamburger:before { content: fa-content($fa-var-hamburger); }
+.#{$fa-css-prefix}-hammer:before { content: fa-content($fa-var-hammer); }
+.#{$fa-css-prefix}-hamsa:before { content: fa-content($fa-var-hamsa); }
+.#{$fa-css-prefix}-hand-holding:before { content: fa-content($fa-var-hand-holding); }
+.#{$fa-css-prefix}-hand-holding-heart:before { content: fa-content($fa-var-hand-holding-heart); }
+.#{$fa-css-prefix}-hand-holding-usd:before { content: fa-content($fa-var-hand-holding-usd); }
+.#{$fa-css-prefix}-hand-lizard:before { content: fa-content($fa-var-hand-lizard); }
+.#{$fa-css-prefix}-hand-middle-finger:before { content: fa-content($fa-var-hand-middle-finger); }
+.#{$fa-css-prefix}-hand-paper:before { content: fa-content($fa-var-hand-paper); }
+.#{$fa-css-prefix}-hand-peace:before { content: fa-content($fa-var-hand-peace); }
+.#{$fa-css-prefix}-hand-point-down:before { content: fa-content($fa-var-hand-point-down); }
+.#{$fa-css-prefix}-hand-point-left:before { content: fa-content($fa-var-hand-point-left); }
+.#{$fa-css-prefix}-hand-point-right:before { content: fa-content($fa-var-hand-point-right); }
+.#{$fa-css-prefix}-hand-point-up:before { content: fa-content($fa-var-hand-point-up); }
+.#{$fa-css-prefix}-hand-pointer:before { content: fa-content($fa-var-hand-pointer); }
+.#{$fa-css-prefix}-hand-rock:before { content: fa-content($fa-var-hand-rock); }
+.#{$fa-css-prefix}-hand-scissors:before { content: fa-content($fa-var-hand-scissors); }
+.#{$fa-css-prefix}-hand-spock:before { content: fa-content($fa-var-hand-spock); }
+.#{$fa-css-prefix}-hands:before { content: fa-content($fa-var-hands); }
+.#{$fa-css-prefix}-hands-helping:before { content: fa-content($fa-var-hands-helping); }
+.#{$fa-css-prefix}-handshake:before { content: fa-content($fa-var-handshake); }
+.#{$fa-css-prefix}-hanukiah:before { content: fa-content($fa-var-hanukiah); }
+.#{$fa-css-prefix}-hard-hat:before { content: fa-content($fa-var-hard-hat); }
+.#{$fa-css-prefix}-hashtag:before { content: fa-content($fa-var-hashtag); }
+.#{$fa-css-prefix}-hat-cowboy:before { content: fa-content($fa-var-hat-cowboy); }
+.#{$fa-css-prefix}-hat-cowboy-side:before { content: fa-content($fa-var-hat-cowboy-side); }
+.#{$fa-css-prefix}-hat-wizard:before { content: fa-content($fa-var-hat-wizard); }
+.#{$fa-css-prefix}-haykal:before { content: fa-content($fa-var-haykal); }
+.#{$fa-css-prefix}-hdd:before { content: fa-content($fa-var-hdd); }
+.#{$fa-css-prefix}-heading:before { content: fa-content($fa-var-heading); }
+.#{$fa-css-prefix}-headphones:before { content: fa-content($fa-var-headphones); }
+.#{$fa-css-prefix}-headphones-alt:before { content: fa-content($fa-var-headphones-alt); }
+.#{$fa-css-prefix}-headset:before { content: fa-content($fa-var-headset); }
+.#{$fa-css-prefix}-heart:before { content: fa-content($fa-var-heart); }
+.#{$fa-css-prefix}-heart-broken:before { content: fa-content($fa-var-heart-broken); }
+.#{$fa-css-prefix}-heartbeat:before { content: fa-content($fa-var-heartbeat); }
+.#{$fa-css-prefix}-helicopter:before { content: fa-content($fa-var-helicopter); }
+.#{$fa-css-prefix}-highlighter:before { content: fa-content($fa-var-highlighter); }
+.#{$fa-css-prefix}-hiking:before { content: fa-content($fa-var-hiking); }
+.#{$fa-css-prefix}-hippo:before { content: fa-content($fa-var-hippo); }
+.#{$fa-css-prefix}-hips:before { content: fa-content($fa-var-hips); }
+.#{$fa-css-prefix}-hire-a-helper:before { content: fa-content($fa-var-hire-a-helper); }
+.#{$fa-css-prefix}-history:before { content: fa-content($fa-var-history); }
+.#{$fa-css-prefix}-hockey-puck:before { content: fa-content($fa-var-hockey-puck); }
+.#{$fa-css-prefix}-holly-berry:before { content: fa-content($fa-var-holly-berry); }
+.#{$fa-css-prefix}-home:before { content: fa-content($fa-var-home); }
+.#{$fa-css-prefix}-hooli:before { content: fa-content($fa-var-hooli); }
+.#{$fa-css-prefix}-hornbill:before { content: fa-content($fa-var-hornbill); }
+.#{$fa-css-prefix}-horse:before { content: fa-content($fa-var-horse); }
+.#{$fa-css-prefix}-horse-head:before { content: fa-content($fa-var-horse-head); }
+.#{$fa-css-prefix}-hospital:before { content: fa-content($fa-var-hospital); }
+.#{$fa-css-prefix}-hospital-alt:before { content: fa-content($fa-var-hospital-alt); }
+.#{$fa-css-prefix}-hospital-symbol:before { content: fa-content($fa-var-hospital-symbol); }
+.#{$fa-css-prefix}-hot-tub:before { content: fa-content($fa-var-hot-tub); }
+.#{$fa-css-prefix}-hotdog:before { content: fa-content($fa-var-hotdog); }
+.#{$fa-css-prefix}-hotel:before { content: fa-content($fa-var-hotel); }
+.#{$fa-css-prefix}-hotjar:before { content: fa-content($fa-var-hotjar); }
+.#{$fa-css-prefix}-hourglass:before { content: fa-content($fa-var-hourglass); }
+.#{$fa-css-prefix}-hourglass-end:before { content: fa-content($fa-var-hourglass-end); }
+.#{$fa-css-prefix}-hourglass-half:before { content: fa-content($fa-var-hourglass-half); }
+.#{$fa-css-prefix}-hourglass-start:before { content: fa-content($fa-var-hourglass-start); }
+.#{$fa-css-prefix}-house-damage:before { content: fa-content($fa-var-house-damage); }
+.#{$fa-css-prefix}-houzz:before { content: fa-content($fa-var-houzz); }
+.#{$fa-css-prefix}-hryvnia:before { content: fa-content($fa-var-hryvnia); }
+.#{$fa-css-prefix}-html5:before { content: fa-content($fa-var-html5); }
+.#{$fa-css-prefix}-hubspot:before { content: fa-content($fa-var-hubspot); }
+.#{$fa-css-prefix}-i-cursor:before { content: fa-content($fa-var-i-cursor); }
+.#{$fa-css-prefix}-ice-cream:before { content: fa-content($fa-var-ice-cream); }
+.#{$fa-css-prefix}-icicles:before { content: fa-content($fa-var-icicles); }
+.#{$fa-css-prefix}-icons:before { content: fa-content($fa-var-icons); }
+.#{$fa-css-prefix}-id-badge:before { content: fa-content($fa-var-id-badge); }
+.#{$fa-css-prefix}-id-card:before { content: fa-content($fa-var-id-card); }
+.#{$fa-css-prefix}-id-card-alt:before { content: fa-content($fa-var-id-card-alt); }
+.#{$fa-css-prefix}-igloo:before { content: fa-content($fa-var-igloo); }
+.#{$fa-css-prefix}-image:before { content: fa-content($fa-var-image); }
+.#{$fa-css-prefix}-images:before { content: fa-content($fa-var-images); }
+.#{$fa-css-prefix}-imdb:before { content: fa-content($fa-var-imdb); }
+.#{$fa-css-prefix}-inbox:before { content: fa-content($fa-var-inbox); }
+.#{$fa-css-prefix}-indent:before { content: fa-content($fa-var-indent); }
+.#{$fa-css-prefix}-industry:before { content: fa-content($fa-var-industry); }
+.#{$fa-css-prefix}-infinity:before { content: fa-content($fa-var-infinity); }
+.#{$fa-css-prefix}-info:before { content: fa-content($fa-var-info); }
+.#{$fa-css-prefix}-info-circle:before { content: fa-content($fa-var-info-circle); }
+.#{$fa-css-prefix}-instagram:before { content: fa-content($fa-var-instagram); }
+.#{$fa-css-prefix}-intercom:before { content: fa-content($fa-var-intercom); }
+.#{$fa-css-prefix}-internet-explorer:before { content: fa-content($fa-var-internet-explorer); }
+.#{$fa-css-prefix}-invision:before { content: fa-content($fa-var-invision); }
+.#{$fa-css-prefix}-ioxhost:before { content: fa-content($fa-var-ioxhost); }
+.#{$fa-css-prefix}-italic:before { content: fa-content($fa-var-italic); }
+.#{$fa-css-prefix}-itch-io:before { content: fa-content($fa-var-itch-io); }
+.#{$fa-css-prefix}-itunes:before { content: fa-content($fa-var-itunes); }
+.#{$fa-css-prefix}-itunes-note:before { content: fa-content($fa-var-itunes-note); }
+.#{$fa-css-prefix}-java:before { content: fa-content($fa-var-java); }
+.#{$fa-css-prefix}-jedi:before { content: fa-content($fa-var-jedi); }
+.#{$fa-css-prefix}-jedi-order:before { content: fa-content($fa-var-jedi-order); }
+.#{$fa-css-prefix}-jenkins:before { content: fa-content($fa-var-jenkins); }
+.#{$fa-css-prefix}-jira:before { content: fa-content($fa-var-jira); }
+.#{$fa-css-prefix}-joget:before { content: fa-content($fa-var-joget); }
+.#{$fa-css-prefix}-joint:before { content: fa-content($fa-var-joint); }
+.#{$fa-css-prefix}-joomla:before { content: fa-content($fa-var-joomla); }
+.#{$fa-css-prefix}-journal-whills:before { content: fa-content($fa-var-journal-whills); }
+.#{$fa-css-prefix}-js:before { content: fa-content($fa-var-js); }
+.#{$fa-css-prefix}-js-square:before { content: fa-content($fa-var-js-square); }
+.#{$fa-css-prefix}-jsfiddle:before { content: fa-content($fa-var-jsfiddle); }
+.#{$fa-css-prefix}-kaaba:before { content: fa-content($fa-var-kaaba); }
+.#{$fa-css-prefix}-kaggle:before { content: fa-content($fa-var-kaggle); }
+.#{$fa-css-prefix}-key:before { content: fa-content($fa-var-key); }
+.#{$fa-css-prefix}-keybase:before { content: fa-content($fa-var-keybase); }
+.#{$fa-css-prefix}-keyboard:before { content: fa-content($fa-var-keyboard); }
+.#{$fa-css-prefix}-keycdn:before { content: fa-content($fa-var-keycdn); }
+.#{$fa-css-prefix}-khanda:before { content: fa-content($fa-var-khanda); }
+.#{$fa-css-prefix}-kickstarter:before { content: fa-content($fa-var-kickstarter); }
+.#{$fa-css-prefix}-kickstarter-k:before { content: fa-content($fa-var-kickstarter-k); }
+.#{$fa-css-prefix}-kiss:before { content: fa-content($fa-var-kiss); }
+.#{$fa-css-prefix}-kiss-beam:before { content: fa-content($fa-var-kiss-beam); }
+.#{$fa-css-prefix}-kiss-wink-heart:before { content: fa-content($fa-var-kiss-wink-heart); }
+.#{$fa-css-prefix}-kiwi-bird:before { content: fa-content($fa-var-kiwi-bird); }
+.#{$fa-css-prefix}-korvue:before { content: fa-content($fa-var-korvue); }
+.#{$fa-css-prefix}-landmark:before { content: fa-content($fa-var-landmark); }
+.#{$fa-css-prefix}-language:before { content: fa-content($fa-var-language); }
+.#{$fa-css-prefix}-laptop:before { content: fa-content($fa-var-laptop); }
+.#{$fa-css-prefix}-laptop-code:before { content: fa-content($fa-var-laptop-code); }
+.#{$fa-css-prefix}-laptop-medical:before { content: fa-content($fa-var-laptop-medical); }
+.#{$fa-css-prefix}-laravel:before { content: fa-content($fa-var-laravel); }
+.#{$fa-css-prefix}-lastfm:before { content: fa-content($fa-var-lastfm); }
+.#{$fa-css-prefix}-lastfm-square:before { content: fa-content($fa-var-lastfm-square); }
+.#{$fa-css-prefix}-laugh:before { content: fa-content($fa-var-laugh); }
+.#{$fa-css-prefix}-laugh-beam:before { content: fa-content($fa-var-laugh-beam); }
+.#{$fa-css-prefix}-laugh-squint:before { content: fa-content($fa-var-laugh-squint); }
+.#{$fa-css-prefix}-laugh-wink:before { content: fa-content($fa-var-laugh-wink); }
+.#{$fa-css-prefix}-layer-group:before { content: fa-content($fa-var-layer-group); }
+.#{$fa-css-prefix}-leaf:before { content: fa-content($fa-var-leaf); }
+.#{$fa-css-prefix}-leanpub:before { content: fa-content($fa-var-leanpub); }
+.#{$fa-css-prefix}-lemon:before { content: fa-content($fa-var-lemon); }
+.#{$fa-css-prefix}-less:before { content: fa-content($fa-var-less); }
+.#{$fa-css-prefix}-less-than:before { content: fa-content($fa-var-less-than); }
+.#{$fa-css-prefix}-less-than-equal:before { content: fa-content($fa-var-less-than-equal); }
+.#{$fa-css-prefix}-level-down-alt:before { content: fa-content($fa-var-level-down-alt); }
+.#{$fa-css-prefix}-level-up-alt:before { content: fa-content($fa-var-level-up-alt); }
+.#{$fa-css-prefix}-life-ring:before { content: fa-content($fa-var-life-ring); }
+.#{$fa-css-prefix}-lightbulb:before { content: fa-content($fa-var-lightbulb); }
+.#{$fa-css-prefix}-line:before { content: fa-content($fa-var-line); }
+.#{$fa-css-prefix}-link:before { content: fa-content($fa-var-link); }
+.#{$fa-css-prefix}-linkedin:before { content: fa-content($fa-var-linkedin); }
+.#{$fa-css-prefix}-linkedin-in:before { content: fa-content($fa-var-linkedin-in); }
+.#{$fa-css-prefix}-linode:before { content: fa-content($fa-var-linode); }
+.#{$fa-css-prefix}-linux:before { content: fa-content($fa-var-linux); }
+.#{$fa-css-prefix}-lira-sign:before { content: fa-content($fa-var-lira-sign); }
+.#{$fa-css-prefix}-list:before { content: fa-content($fa-var-list); }
+.#{$fa-css-prefix}-list-alt:before { content: fa-content($fa-var-list-alt); }
+.#{$fa-css-prefix}-list-ol:before { content: fa-content($fa-var-list-ol); }
+.#{$fa-css-prefix}-list-ul:before { content: fa-content($fa-var-list-ul); }
+.#{$fa-css-prefix}-location-arrow:before { content: fa-content($fa-var-location-arrow); }
+.#{$fa-css-prefix}-lock:before { content: fa-content($fa-var-lock); }
+.#{$fa-css-prefix}-lock-open:before { content: fa-content($fa-var-lock-open); }
+.#{$fa-css-prefix}-long-arrow-alt-down:before { content: fa-content($fa-var-long-arrow-alt-down); }
+.#{$fa-css-prefix}-long-arrow-alt-left:before { content: fa-content($fa-var-long-arrow-alt-left); }
+.#{$fa-css-prefix}-long-arrow-alt-right:before { content: fa-content($fa-var-long-arrow-alt-right); }
+.#{$fa-css-prefix}-long-arrow-alt-up:before { content: fa-content($fa-var-long-arrow-alt-up); }
+.#{$fa-css-prefix}-low-vision:before { content: fa-content($fa-var-low-vision); }
+.#{$fa-css-prefix}-luggage-cart:before { content: fa-content($fa-var-luggage-cart); }
+.#{$fa-css-prefix}-lyft:before { content: fa-content($fa-var-lyft); }
+.#{$fa-css-prefix}-magento:before { content: fa-content($fa-var-magento); }
+.#{$fa-css-prefix}-magic:before { content: fa-content($fa-var-magic); }
+.#{$fa-css-prefix}-magnet:before { content: fa-content($fa-var-magnet); }
+.#{$fa-css-prefix}-mail-bulk:before { content: fa-content($fa-var-mail-bulk); }
+.#{$fa-css-prefix}-mailchimp:before { content: fa-content($fa-var-mailchimp); }
+.#{$fa-css-prefix}-male:before { content: fa-content($fa-var-male); }
+.#{$fa-css-prefix}-mandalorian:before { content: fa-content($fa-var-mandalorian); }
+.#{$fa-css-prefix}-map:before { content: fa-content($fa-var-map); }
+.#{$fa-css-prefix}-map-marked:before { content: fa-content($fa-var-map-marked); }
+.#{$fa-css-prefix}-map-marked-alt:before { content: fa-content($fa-var-map-marked-alt); }
+.#{$fa-css-prefix}-map-marker:before { content: fa-content($fa-var-map-marker); }
+.#{$fa-css-prefix}-map-marker-alt:before { content: fa-content($fa-var-map-marker-alt); }
+.#{$fa-css-prefix}-map-pin:before { content: fa-content($fa-var-map-pin); }
+.#{$fa-css-prefix}-map-signs:before { content: fa-content($fa-var-map-signs); }
+.#{$fa-css-prefix}-markdown:before { content: fa-content($fa-var-markdown); }
+.#{$fa-css-prefix}-marker:before { content: fa-content($fa-var-marker); }
+.#{$fa-css-prefix}-mars:before { content: fa-content($fa-var-mars); }
+.#{$fa-css-prefix}-mars-double:before { content: fa-content($fa-var-mars-double); }
+.#{$fa-css-prefix}-mars-stroke:before { content: fa-content($fa-var-mars-stroke); }
+.#{$fa-css-prefix}-mars-stroke-h:before { content: fa-content($fa-var-mars-stroke-h); }
+.#{$fa-css-prefix}-mars-stroke-v:before { content: fa-content($fa-var-mars-stroke-v); }
+.#{$fa-css-prefix}-mask:before { content: fa-content($fa-var-mask); }
+.#{$fa-css-prefix}-mastodon:before { content: fa-content($fa-var-mastodon); }
+.#{$fa-css-prefix}-maxcdn:before { content: fa-content($fa-var-maxcdn); }
+.#{$fa-css-prefix}-mdb:before { content: fa-content($fa-var-mdb); }
+.#{$fa-css-prefix}-medal:before { content: fa-content($fa-var-medal); }
+.#{$fa-css-prefix}-medapps:before { content: fa-content($fa-var-medapps); }
+.#{$fa-css-prefix}-medium:before { content: fa-content($fa-var-medium); }
+.#{$fa-css-prefix}-medium-m:before { content: fa-content($fa-var-medium-m); }
+.#{$fa-css-prefix}-medkit:before { content: fa-content($fa-var-medkit); }
+.#{$fa-css-prefix}-medrt:before { content: fa-content($fa-var-medrt); }
+.#{$fa-css-prefix}-meetup:before { content: fa-content($fa-var-meetup); }
+.#{$fa-css-prefix}-megaport:before { content: fa-content($fa-var-megaport); }
+.#{$fa-css-prefix}-meh:before { content: fa-content($fa-var-meh); }
+.#{$fa-css-prefix}-meh-blank:before { content: fa-content($fa-var-meh-blank); }
+.#{$fa-css-prefix}-meh-rolling-eyes:before { content: fa-content($fa-var-meh-rolling-eyes); }
+.#{$fa-css-prefix}-memory:before { content: fa-content($fa-var-memory); }
+.#{$fa-css-prefix}-mendeley:before { content: fa-content($fa-var-mendeley); }
+.#{$fa-css-prefix}-menorah:before { content: fa-content($fa-var-menorah); }
+.#{$fa-css-prefix}-mercury:before { content: fa-content($fa-var-mercury); }
+.#{$fa-css-prefix}-meteor:before { content: fa-content($fa-var-meteor); }
+.#{$fa-css-prefix}-microchip:before { content: fa-content($fa-var-microchip); }
+.#{$fa-css-prefix}-microphone:before { content: fa-content($fa-var-microphone); }
+.#{$fa-css-prefix}-microphone-alt:before { content: fa-content($fa-var-microphone-alt); }
+.#{$fa-css-prefix}-microphone-alt-slash:before { content: fa-content($fa-var-microphone-alt-slash); }
+.#{$fa-css-prefix}-microphone-slash:before { content: fa-content($fa-var-microphone-slash); }
+.#{$fa-css-prefix}-microscope:before { content: fa-content($fa-var-microscope); }
+.#{$fa-css-prefix}-microsoft:before { content: fa-content($fa-var-microsoft); }
+.#{$fa-css-prefix}-minus:before { content: fa-content($fa-var-minus); }
+.#{$fa-css-prefix}-minus-circle:before { content: fa-content($fa-var-minus-circle); }
+.#{$fa-css-prefix}-minus-square:before { content: fa-content($fa-var-minus-square); }
+.#{$fa-css-prefix}-mitten:before { content: fa-content($fa-var-mitten); }
+.#{$fa-css-prefix}-mix:before { content: fa-content($fa-var-mix); }
+.#{$fa-css-prefix}-mixcloud:before { content: fa-content($fa-var-mixcloud); }
+.#{$fa-css-prefix}-mizuni:before { content: fa-content($fa-var-mizuni); }
+.#{$fa-css-prefix}-mobile:before { content: fa-content($fa-var-mobile); }
+.#{$fa-css-prefix}-mobile-alt:before { content: fa-content($fa-var-mobile-alt); }
+.#{$fa-css-prefix}-modx:before { content: fa-content($fa-var-modx); }
+.#{$fa-css-prefix}-monero:before { content: fa-content($fa-var-monero); }
+.#{$fa-css-prefix}-money-bill:before { content: fa-content($fa-var-money-bill); }
+.#{$fa-css-prefix}-money-bill-alt:before { content: fa-content($fa-var-money-bill-alt); }
+.#{$fa-css-prefix}-money-bill-wave:before { content: fa-content($fa-var-money-bill-wave); }
+.#{$fa-css-prefix}-money-bill-wave-alt:before { content: fa-content($fa-var-money-bill-wave-alt); }
+.#{$fa-css-prefix}-money-check:before { content: fa-content($fa-var-money-check); }
+.#{$fa-css-prefix}-money-check-alt:before { content: fa-content($fa-var-money-check-alt); }
+.#{$fa-css-prefix}-monument:before { content: fa-content($fa-var-monument); }
+.#{$fa-css-prefix}-moon:before { content: fa-content($fa-var-moon); }
+.#{$fa-css-prefix}-mortar-pestle:before { content: fa-content($fa-var-mortar-pestle); }
+.#{$fa-css-prefix}-mosque:before { content: fa-content($fa-var-mosque); }
+.#{$fa-css-prefix}-motorcycle:before { content: fa-content($fa-var-motorcycle); }
+.#{$fa-css-prefix}-mountain:before { content: fa-content($fa-var-mountain); }
+.#{$fa-css-prefix}-mouse:before { content: fa-content($fa-var-mouse); }
+.#{$fa-css-prefix}-mouse-pointer:before { content: fa-content($fa-var-mouse-pointer); }
+.#{$fa-css-prefix}-mug-hot:before { content: fa-content($fa-var-mug-hot); }
+.#{$fa-css-prefix}-music:before { content: fa-content($fa-var-music); }
+.#{$fa-css-prefix}-napster:before { content: fa-content($fa-var-napster); }
+.#{$fa-css-prefix}-neos:before { content: fa-content($fa-var-neos); }
+.#{$fa-css-prefix}-network-wired:before { content: fa-content($fa-var-network-wired); }
+.#{$fa-css-prefix}-neuter:before { content: fa-content($fa-var-neuter); }
+.#{$fa-css-prefix}-newspaper:before { content: fa-content($fa-var-newspaper); }
+.#{$fa-css-prefix}-nimblr:before { content: fa-content($fa-var-nimblr); }
+.#{$fa-css-prefix}-node:before { content: fa-content($fa-var-node); }
+.#{$fa-css-prefix}-node-js:before { content: fa-content($fa-var-node-js); }
+.#{$fa-css-prefix}-not-equal:before { content: fa-content($fa-var-not-equal); }
+.#{$fa-css-prefix}-notes-medical:before { content: fa-content($fa-var-notes-medical); }
+.#{$fa-css-prefix}-npm:before { content: fa-content($fa-var-npm); }
+.#{$fa-css-prefix}-ns8:before { content: fa-content($fa-var-ns8); }
+.#{$fa-css-prefix}-nutritionix:before { content: fa-content($fa-var-nutritionix); }
+.#{$fa-css-prefix}-object-group:before { content: fa-content($fa-var-object-group); }
+.#{$fa-css-prefix}-object-ungroup:before { content: fa-content($fa-var-object-ungroup); }
+.#{$fa-css-prefix}-odnoklassniki:before { content: fa-content($fa-var-odnoklassniki); }
+.#{$fa-css-prefix}-odnoklassniki-square:before { content: fa-content($fa-var-odnoklassniki-square); }
+.#{$fa-css-prefix}-oil-can:before { content: fa-content($fa-var-oil-can); }
+.#{$fa-css-prefix}-old-republic:before { content: fa-content($fa-var-old-republic); }
+.#{$fa-css-prefix}-om:before { content: fa-content($fa-var-om); }
+.#{$fa-css-prefix}-opencart:before { content: fa-content($fa-var-opencart); }
+.#{$fa-css-prefix}-openid:before { content: fa-content($fa-var-openid); }
+.#{$fa-css-prefix}-opera:before { content: fa-content($fa-var-opera); }
+.#{$fa-css-prefix}-optin-monster:before { content: fa-content($fa-var-optin-monster); }
+.#{$fa-css-prefix}-orcid:before { content: fa-content($fa-var-orcid); }
+.#{$fa-css-prefix}-osi:before { content: fa-content($fa-var-osi); }
+.#{$fa-css-prefix}-otter:before { content: fa-content($fa-var-otter); }
+.#{$fa-css-prefix}-outdent:before { content: fa-content($fa-var-outdent); }
+.#{$fa-css-prefix}-page4:before { content: fa-content($fa-var-page4); }
+.#{$fa-css-prefix}-pagelines:before { content: fa-content($fa-var-pagelines); }
+.#{$fa-css-prefix}-pager:before { content: fa-content($fa-var-pager); }
+.#{$fa-css-prefix}-paint-brush:before { content: fa-content($fa-var-paint-brush); }
+.#{$fa-css-prefix}-paint-roller:before { content: fa-content($fa-var-paint-roller); }
+.#{$fa-css-prefix}-palette:before { content: fa-content($fa-var-palette); }
+.#{$fa-css-prefix}-palfed:before { content: fa-content($fa-var-palfed); }
+.#{$fa-css-prefix}-pallet:before { content: fa-content($fa-var-pallet); }
+.#{$fa-css-prefix}-paper-plane:before { content: fa-content($fa-var-paper-plane); }
+.#{$fa-css-prefix}-paperclip:before { content: fa-content($fa-var-paperclip); }
+.#{$fa-css-prefix}-parachute-box:before { content: fa-content($fa-var-parachute-box); }
+.#{$fa-css-prefix}-paragraph:before { content: fa-content($fa-var-paragraph); }
+.#{$fa-css-prefix}-parking:before { content: fa-content($fa-var-parking); }
+.#{$fa-css-prefix}-passport:before { content: fa-content($fa-var-passport); }
+.#{$fa-css-prefix}-pastafarianism:before { content: fa-content($fa-var-pastafarianism); }
+.#{$fa-css-prefix}-paste:before { content: fa-content($fa-var-paste); }
+.#{$fa-css-prefix}-patreon:before { content: fa-content($fa-var-patreon); }
+.#{$fa-css-prefix}-pause:before { content: fa-content($fa-var-pause); }
+.#{$fa-css-prefix}-pause-circle:before { content: fa-content($fa-var-pause-circle); }
+.#{$fa-css-prefix}-paw:before { content: fa-content($fa-var-paw); }
+.#{$fa-css-prefix}-paypal:before { content: fa-content($fa-var-paypal); }
+.#{$fa-css-prefix}-peace:before { content: fa-content($fa-var-peace); }
+.#{$fa-css-prefix}-pen:before { content: fa-content($fa-var-pen); }
+.#{$fa-css-prefix}-pen-alt:before { content: fa-content($fa-var-pen-alt); }
+.#{$fa-css-prefix}-pen-fancy:before { content: fa-content($fa-var-pen-fancy); }
+.#{$fa-css-prefix}-pen-nib:before { content: fa-content($fa-var-pen-nib); }
+.#{$fa-css-prefix}-pen-square:before { content: fa-content($fa-var-pen-square); }
+.#{$fa-css-prefix}-pencil-alt:before { content: fa-content($fa-var-pencil-alt); }
+.#{$fa-css-prefix}-pencil-ruler:before { content: fa-content($fa-var-pencil-ruler); }
+.#{$fa-css-prefix}-penny-arcade:before { content: fa-content($fa-var-penny-arcade); }
+.#{$fa-css-prefix}-people-carry:before { content: fa-content($fa-var-people-carry); }
+.#{$fa-css-prefix}-pepper-hot:before { content: fa-content($fa-var-pepper-hot); }
+.#{$fa-css-prefix}-percent:before { content: fa-content($fa-var-percent); }
+.#{$fa-css-prefix}-percentage:before { content: fa-content($fa-var-percentage); }
+.#{$fa-css-prefix}-periscope:before { content: fa-content($fa-var-periscope); }
+.#{$fa-css-prefix}-person-booth:before { content: fa-content($fa-var-person-booth); }
+.#{$fa-css-prefix}-phabricator:before { content: fa-content($fa-var-phabricator); }
+.#{$fa-css-prefix}-phoenix-framework:before { content: fa-content($fa-var-phoenix-framework); }
+.#{$fa-css-prefix}-phoenix-squadron:before { content: fa-content($fa-var-phoenix-squadron); }
+.#{$fa-css-prefix}-phone:before { content: fa-content($fa-var-phone); }
+.#{$fa-css-prefix}-phone-alt:before { content: fa-content($fa-var-phone-alt); }
+.#{$fa-css-prefix}-phone-slash:before { content: fa-content($fa-var-phone-slash); }
+.#{$fa-css-prefix}-phone-square:before { content: fa-content($fa-var-phone-square); }
+.#{$fa-css-prefix}-phone-square-alt:before { content: fa-content($fa-var-phone-square-alt); }
+.#{$fa-css-prefix}-phone-volume:before { content: fa-content($fa-var-phone-volume); }
+.#{$fa-css-prefix}-photo-video:before { content: fa-content($fa-var-photo-video); }
+.#{$fa-css-prefix}-php:before { content: fa-content($fa-var-php); }
+.#{$fa-css-prefix}-pied-piper:before { content: fa-content($fa-var-pied-piper); }
+.#{$fa-css-prefix}-pied-piper-alt:before { content: fa-content($fa-var-pied-piper-alt); }
+.#{$fa-css-prefix}-pied-piper-hat:before { content: fa-content($fa-var-pied-piper-hat); }
+.#{$fa-css-prefix}-pied-piper-pp:before { content: fa-content($fa-var-pied-piper-pp); }
+.#{$fa-css-prefix}-piggy-bank:before { content: fa-content($fa-var-piggy-bank); }
+.#{$fa-css-prefix}-pills:before { content: fa-content($fa-var-pills); }
+.#{$fa-css-prefix}-pinterest:before { content: fa-content($fa-var-pinterest); }
+.#{$fa-css-prefix}-pinterest-p:before { content: fa-content($fa-var-pinterest-p); }
+.#{$fa-css-prefix}-pinterest-square:before { content: fa-content($fa-var-pinterest-square); }
+.#{$fa-css-prefix}-pizza-slice:before { content: fa-content($fa-var-pizza-slice); }
+.#{$fa-css-prefix}-place-of-worship:before { content: fa-content($fa-var-place-of-worship); }
+.#{$fa-css-prefix}-plane:before { content: fa-content($fa-var-plane); }
+.#{$fa-css-prefix}-plane-arrival:before { content: fa-content($fa-var-plane-arrival); }
+.#{$fa-css-prefix}-plane-departure:before { content: fa-content($fa-var-plane-departure); }
+.#{$fa-css-prefix}-play:before { content: fa-content($fa-var-play); }
+.#{$fa-css-prefix}-play-circle:before { content: fa-content($fa-var-play-circle); }
+.#{$fa-css-prefix}-playstation:before { content: fa-content($fa-var-playstation); }
+.#{$fa-css-prefix}-plug:before { content: fa-content($fa-var-plug); }
+.#{$fa-css-prefix}-plus:before { content: fa-content($fa-var-plus); }
+.#{$fa-css-prefix}-plus-circle:before { content: fa-content($fa-var-plus-circle); }
+.#{$fa-css-prefix}-plus-square:before { content: fa-content($fa-var-plus-square); }
+.#{$fa-css-prefix}-podcast:before { content: fa-content($fa-var-podcast); }
+.#{$fa-css-prefix}-poll:before { content: fa-content($fa-var-poll); }
+.#{$fa-css-prefix}-poll-h:before { content: fa-content($fa-var-poll-h); }
+.#{$fa-css-prefix}-poo:before { content: fa-content($fa-var-poo); }
+.#{$fa-css-prefix}-poo-storm:before { content: fa-content($fa-var-poo-storm); }
+.#{$fa-css-prefix}-poop:before { content: fa-content($fa-var-poop); }
+.#{$fa-css-prefix}-portrait:before { content: fa-content($fa-var-portrait); }
+.#{$fa-css-prefix}-pound-sign:before { content: fa-content($fa-var-pound-sign); }
+.#{$fa-css-prefix}-power-off:before { content: fa-content($fa-var-power-off); }
+.#{$fa-css-prefix}-pray:before { content: fa-content($fa-var-pray); }
+.#{$fa-css-prefix}-praying-hands:before { content: fa-content($fa-var-praying-hands); }
+.#{$fa-css-prefix}-prescription:before { content: fa-content($fa-var-prescription); }
+.#{$fa-css-prefix}-prescription-bottle:before { content: fa-content($fa-var-prescription-bottle); }
+.#{$fa-css-prefix}-prescription-bottle-alt:before { content: fa-content($fa-var-prescription-bottle-alt); }
+.#{$fa-css-prefix}-print:before { content: fa-content($fa-var-print); }
+.#{$fa-css-prefix}-procedures:before { content: fa-content($fa-var-procedures); }
+.#{$fa-css-prefix}-product-hunt:before { content: fa-content($fa-var-product-hunt); }
+.#{$fa-css-prefix}-project-diagram:before { content: fa-content($fa-var-project-diagram); }
+.#{$fa-css-prefix}-pushed:before { content: fa-content($fa-var-pushed); }
+.#{$fa-css-prefix}-puzzle-piece:before { content: fa-content($fa-var-puzzle-piece); }
+.#{$fa-css-prefix}-python:before { content: fa-content($fa-var-python); }
+.#{$fa-css-prefix}-qq:before { content: fa-content($fa-var-qq); }
+.#{$fa-css-prefix}-qrcode:before { content: fa-content($fa-var-qrcode); }
+.#{$fa-css-prefix}-question:before { content: fa-content($fa-var-question); }
+.#{$fa-css-prefix}-question-circle:before { content: fa-content($fa-var-question-circle); }
+.#{$fa-css-prefix}-quidditch:before { content: fa-content($fa-var-quidditch); }
+.#{$fa-css-prefix}-quinscape:before { content: fa-content($fa-var-quinscape); }
+.#{$fa-css-prefix}-quora:before { content: fa-content($fa-var-quora); }
+.#{$fa-css-prefix}-quote-left:before { content: fa-content($fa-var-quote-left); }
+.#{$fa-css-prefix}-quote-right:before { content: fa-content($fa-var-quote-right); }
+.#{$fa-css-prefix}-quran:before { content: fa-content($fa-var-quran); }
+.#{$fa-css-prefix}-r-project:before { content: fa-content($fa-var-r-project); }
+.#{$fa-css-prefix}-radiation:before { content: fa-content($fa-var-radiation); }
+.#{$fa-css-prefix}-radiation-alt:before { content: fa-content($fa-var-radiation-alt); }
+.#{$fa-css-prefix}-rainbow:before { content: fa-content($fa-var-rainbow); }
+.#{$fa-css-prefix}-random:before { content: fa-content($fa-var-random); }
+.#{$fa-css-prefix}-raspberry-pi:before { content: fa-content($fa-var-raspberry-pi); }
+.#{$fa-css-prefix}-ravelry:before { content: fa-content($fa-var-ravelry); }
+.#{$fa-css-prefix}-react:before { content: fa-content($fa-var-react); }
+.#{$fa-css-prefix}-reacteurope:before { content: fa-content($fa-var-reacteurope); }
+.#{$fa-css-prefix}-readme:before { content: fa-content($fa-var-readme); }
+.#{$fa-css-prefix}-rebel:before { content: fa-content($fa-var-rebel); }
+.#{$fa-css-prefix}-receipt:before { content: fa-content($fa-var-receipt); }
+.#{$fa-css-prefix}-record-vinyl:before { content: fa-content($fa-var-record-vinyl); }
+.#{$fa-css-prefix}-recycle:before { content: fa-content($fa-var-recycle); }
+.#{$fa-css-prefix}-red-river:before { content: fa-content($fa-var-red-river); }
+.#{$fa-css-prefix}-reddit:before { content: fa-content($fa-var-reddit); }
+.#{$fa-css-prefix}-reddit-alien:before { content: fa-content($fa-var-reddit-alien); }
+.#{$fa-css-prefix}-reddit-square:before { content: fa-content($fa-var-reddit-square); }
+.#{$fa-css-prefix}-redhat:before { content: fa-content($fa-var-redhat); }
+.#{$fa-css-prefix}-redo:before { content: fa-content($fa-var-redo); }
+.#{$fa-css-prefix}-redo-alt:before { content: fa-content($fa-var-redo-alt); }
+.#{$fa-css-prefix}-registered:before { content: fa-content($fa-var-registered); }
+.#{$fa-css-prefix}-remove-format:before { content: fa-content($fa-var-remove-format); }
+.#{$fa-css-prefix}-renren:before { content: fa-content($fa-var-renren); }
+.#{$fa-css-prefix}-reply:before { content: fa-content($fa-var-reply); }
+.#{$fa-css-prefix}-reply-all:before { content: fa-content($fa-var-reply-all); }
+.#{$fa-css-prefix}-replyd:before { content: fa-content($fa-var-replyd); }
+.#{$fa-css-prefix}-republican:before { content: fa-content($fa-var-republican); }
+.#{$fa-css-prefix}-researchgate:before { content: fa-content($fa-var-researchgate); }
+.#{$fa-css-prefix}-resolving:before { content: fa-content($fa-var-resolving); }
+.#{$fa-css-prefix}-restroom:before { content: fa-content($fa-var-restroom); }
+.#{$fa-css-prefix}-retweet:before { content: fa-content($fa-var-retweet); }
+.#{$fa-css-prefix}-rev:before { content: fa-content($fa-var-rev); }
+.#{$fa-css-prefix}-ribbon:before { content: fa-content($fa-var-ribbon); }
+.#{$fa-css-prefix}-ring:before { content: fa-content($fa-var-ring); }
+.#{$fa-css-prefix}-road:before { content: fa-content($fa-var-road); }
+.#{$fa-css-prefix}-robot:before { content: fa-content($fa-var-robot); }
+.#{$fa-css-prefix}-rocket:before { content: fa-content($fa-var-rocket); }
+.#{$fa-css-prefix}-rocketchat:before { content: fa-content($fa-var-rocketchat); }
+.#{$fa-css-prefix}-rockrms:before { content: fa-content($fa-var-rockrms); }
+.#{$fa-css-prefix}-route:before { content: fa-content($fa-var-route); }
+.#{$fa-css-prefix}-rss:before { content: fa-content($fa-var-rss); }
+.#{$fa-css-prefix}-rss-square:before { content: fa-content($fa-var-rss-square); }
+.#{$fa-css-prefix}-ruble-sign:before { content: fa-content($fa-var-ruble-sign); }
+.#{$fa-css-prefix}-ruler:before { content: fa-content($fa-var-ruler); }
+.#{$fa-css-prefix}-ruler-combined:before { content: fa-content($fa-var-ruler-combined); }
+.#{$fa-css-prefix}-ruler-horizontal:before { content: fa-content($fa-var-ruler-horizontal); }
+.#{$fa-css-prefix}-ruler-vertical:before { content: fa-content($fa-var-ruler-vertical); }
+.#{$fa-css-prefix}-running:before { content: fa-content($fa-var-running); }
+.#{$fa-css-prefix}-rupee-sign:before { content: fa-content($fa-var-rupee-sign); }
+.#{$fa-css-prefix}-sad-cry:before { content: fa-content($fa-var-sad-cry); }
+.#{$fa-css-prefix}-sad-tear:before { content: fa-content($fa-var-sad-tear); }
+.#{$fa-css-prefix}-safari:before { content: fa-content($fa-var-safari); }
+.#{$fa-css-prefix}-salesforce:before { content: fa-content($fa-var-salesforce); }
+.#{$fa-css-prefix}-sass:before { content: fa-content($fa-var-sass); }
+.#{$fa-css-prefix}-satellite:before { content: fa-content($fa-var-satellite); }
+.#{$fa-css-prefix}-satellite-dish:before { content: fa-content($fa-var-satellite-dish); }
+.#{$fa-css-prefix}-save:before { content: fa-content($fa-var-save); }
+.#{$fa-css-prefix}-schlix:before { content: fa-content($fa-var-schlix); }
+.#{$fa-css-prefix}-school:before { content: fa-content($fa-var-school); }
+.#{$fa-css-prefix}-screwdriver:before { content: fa-content($fa-var-screwdriver); }
+.#{$fa-css-prefix}-scribd:before { content: fa-content($fa-var-scribd); }
+.#{$fa-css-prefix}-scroll:before { content: fa-content($fa-var-scroll); }
+.#{$fa-css-prefix}-sd-card:before { content: fa-content($fa-var-sd-card); }
+.#{$fa-css-prefix}-search:before { content: fa-content($fa-var-search); }
+.#{$fa-css-prefix}-search-dollar:before { content: fa-content($fa-var-search-dollar); }
+.#{$fa-css-prefix}-search-location:before { content: fa-content($fa-var-search-location); }
+.#{$fa-css-prefix}-search-minus:before { content: fa-content($fa-var-search-minus); }
+.#{$fa-css-prefix}-search-plus:before { content: fa-content($fa-var-search-plus); }
+.#{$fa-css-prefix}-searchengin:before { content: fa-content($fa-var-searchengin); }
+.#{$fa-css-prefix}-seedling:before { content: fa-content($fa-var-seedling); }
+.#{$fa-css-prefix}-sellcast:before { content: fa-content($fa-var-sellcast); }
+.#{$fa-css-prefix}-sellsy:before { content: fa-content($fa-var-sellsy); }
+.#{$fa-css-prefix}-server:before { content: fa-content($fa-var-server); }
+.#{$fa-css-prefix}-servicestack:before { content: fa-content($fa-var-servicestack); }
+.#{$fa-css-prefix}-shapes:before { content: fa-content($fa-var-shapes); }
+.#{$fa-css-prefix}-share:before { content: fa-content($fa-var-share); }
+.#{$fa-css-prefix}-share-alt:before { content: fa-content($fa-var-share-alt); }
+.#{$fa-css-prefix}-share-alt-square:before { content: fa-content($fa-var-share-alt-square); }
+.#{$fa-css-prefix}-share-square:before { content: fa-content($fa-var-share-square); }
+.#{$fa-css-prefix}-shekel-sign:before { content: fa-content($fa-var-shekel-sign); }
+.#{$fa-css-prefix}-shield-alt:before { content: fa-content($fa-var-shield-alt); }
+.#{$fa-css-prefix}-ship:before { content: fa-content($fa-var-ship); }
+.#{$fa-css-prefix}-shipping-fast:before { content: fa-content($fa-var-shipping-fast); }
+.#{$fa-css-prefix}-shirtsinbulk:before { content: fa-content($fa-var-shirtsinbulk); }
+.#{$fa-css-prefix}-shoe-prints:before { content: fa-content($fa-var-shoe-prints); }
+.#{$fa-css-prefix}-shopping-bag:before { content: fa-content($fa-var-shopping-bag); }
+.#{$fa-css-prefix}-shopping-basket:before { content: fa-content($fa-var-shopping-basket); }
+.#{$fa-css-prefix}-shopping-cart:before { content: fa-content($fa-var-shopping-cart); }
+.#{$fa-css-prefix}-shopware:before { content: fa-content($fa-var-shopware); }
+.#{$fa-css-prefix}-shower:before { content: fa-content($fa-var-shower); }
+.#{$fa-css-prefix}-shuttle-van:before { content: fa-content($fa-var-shuttle-van); }
+.#{$fa-css-prefix}-sign:before { content: fa-content($fa-var-sign); }
+.#{$fa-css-prefix}-sign-in-alt:before { content: fa-content($fa-var-sign-in-alt); }
+.#{$fa-css-prefix}-sign-language:before { content: fa-content($fa-var-sign-language); }
+.#{$fa-css-prefix}-sign-out-alt:before { content: fa-content($fa-var-sign-out-alt); }
+.#{$fa-css-prefix}-signal:before { content: fa-content($fa-var-signal); }
+.#{$fa-css-prefix}-signature:before { content: fa-content($fa-var-signature); }
+.#{$fa-css-prefix}-sim-card:before { content: fa-content($fa-var-sim-card); }
+.#{$fa-css-prefix}-simplybuilt:before { content: fa-content($fa-var-simplybuilt); }
+.#{$fa-css-prefix}-sistrix:before { content: fa-content($fa-var-sistrix); }
+.#{$fa-css-prefix}-sitemap:before { content: fa-content($fa-var-sitemap); }
+.#{$fa-css-prefix}-sith:before { content: fa-content($fa-var-sith); }
+.#{$fa-css-prefix}-skating:before { content: fa-content($fa-var-skating); }
+.#{$fa-css-prefix}-sketch:before { content: fa-content($fa-var-sketch); }
+.#{$fa-css-prefix}-skiing:before { content: fa-content($fa-var-skiing); }
+.#{$fa-css-prefix}-skiing-nordic:before { content: fa-content($fa-var-skiing-nordic); }
+.#{$fa-css-prefix}-skull:before { content: fa-content($fa-var-skull); }
+.#{$fa-css-prefix}-skull-crossbones:before { content: fa-content($fa-var-skull-crossbones); }
+.#{$fa-css-prefix}-skyatlas:before { content: fa-content($fa-var-skyatlas); }
+.#{$fa-css-prefix}-skype:before { content: fa-content($fa-var-skype); }
+.#{$fa-css-prefix}-slack:before { content: fa-content($fa-var-slack); }
+.#{$fa-css-prefix}-slack-hash:before { content: fa-content($fa-var-slack-hash); }
+.#{$fa-css-prefix}-slash:before { content: fa-content($fa-var-slash); }
+.#{$fa-css-prefix}-sleigh:before { content: fa-content($fa-var-sleigh); }
+.#{$fa-css-prefix}-sliders-h:before { content: fa-content($fa-var-sliders-h); }
+.#{$fa-css-prefix}-slideshare:before { content: fa-content($fa-var-slideshare); }
+.#{$fa-css-prefix}-smile:before { content: fa-content($fa-var-smile); }
+.#{$fa-css-prefix}-smile-beam:before { content: fa-content($fa-var-smile-beam); }
+.#{$fa-css-prefix}-smile-wink:before { content: fa-content($fa-var-smile-wink); }
+.#{$fa-css-prefix}-smog:before { content: fa-content($fa-var-smog); }
+.#{$fa-css-prefix}-smoking:before { content: fa-content($fa-var-smoking); }
+.#{$fa-css-prefix}-smoking-ban:before { content: fa-content($fa-var-smoking-ban); }
+.#{$fa-css-prefix}-sms:before { content: fa-content($fa-var-sms); }
+.#{$fa-css-prefix}-snapchat:before { content: fa-content($fa-var-snapchat); }
+.#{$fa-css-prefix}-snapchat-ghost:before { content: fa-content($fa-var-snapchat-ghost); }
+.#{$fa-css-prefix}-snapchat-square:before { content: fa-content($fa-var-snapchat-square); }
+.#{$fa-css-prefix}-snowboarding:before { content: fa-content($fa-var-snowboarding); }
+.#{$fa-css-prefix}-snowflake:before { content: fa-content($fa-var-snowflake); }
+.#{$fa-css-prefix}-snowman:before { content: fa-content($fa-var-snowman); }
+.#{$fa-css-prefix}-snowplow:before { content: fa-content($fa-var-snowplow); }
+.#{$fa-css-prefix}-socks:before { content: fa-content($fa-var-socks); }
+.#{$fa-css-prefix}-solar-panel:before { content: fa-content($fa-var-solar-panel); }
+.#{$fa-css-prefix}-sort:before { content: fa-content($fa-var-sort); }
+.#{$fa-css-prefix}-sort-alpha-down:before { content: fa-content($fa-var-sort-alpha-down); }
+.#{$fa-css-prefix}-sort-alpha-down-alt:before { content: fa-content($fa-var-sort-alpha-down-alt); }
+.#{$fa-css-prefix}-sort-alpha-up:before { content: fa-content($fa-var-sort-alpha-up); }
+.#{$fa-css-prefix}-sort-alpha-up-alt:before { content: fa-content($fa-var-sort-alpha-up-alt); }
+.#{$fa-css-prefix}-sort-amount-down:before { content: fa-content($fa-var-sort-amount-down); }
+.#{$fa-css-prefix}-sort-amount-down-alt:before { content: fa-content($fa-var-sort-amount-down-alt); }
+.#{$fa-css-prefix}-sort-amount-up:before { content: fa-content($fa-var-sort-amount-up); }
+.#{$fa-css-prefix}-sort-amount-up-alt:before { content: fa-content($fa-var-sort-amount-up-alt); }
+.#{$fa-css-prefix}-sort-down:before { content: fa-content($fa-var-sort-down); }
+.#{$fa-css-prefix}-sort-numeric-down:before { content: fa-content($fa-var-sort-numeric-down); }
+.#{$fa-css-prefix}-sort-numeric-down-alt:before { content: fa-content($fa-var-sort-numeric-down-alt); }
+.#{$fa-css-prefix}-sort-numeric-up:before { content: fa-content($fa-var-sort-numeric-up); }
+.#{$fa-css-prefix}-sort-numeric-up-alt:before { content: fa-content($fa-var-sort-numeric-up-alt); }
+.#{$fa-css-prefix}-sort-up:before { content: fa-content($fa-var-sort-up); }
+.#{$fa-css-prefix}-soundcloud:before { content: fa-content($fa-var-soundcloud); }
+.#{$fa-css-prefix}-sourcetree:before { content: fa-content($fa-var-sourcetree); }
+.#{$fa-css-prefix}-spa:before { content: fa-content($fa-var-spa); }
+.#{$fa-css-prefix}-space-shuttle:before { content: fa-content($fa-var-space-shuttle); }
+.#{$fa-css-prefix}-speakap:before { content: fa-content($fa-var-speakap); }
+.#{$fa-css-prefix}-speaker-deck:before { content: fa-content($fa-var-speaker-deck); }
+.#{$fa-css-prefix}-spell-check:before { content: fa-content($fa-var-spell-check); }
+.#{$fa-css-prefix}-spider:before { content: fa-content($fa-var-spider); }
+.#{$fa-css-prefix}-spinner:before { content: fa-content($fa-var-spinner); }
+.#{$fa-css-prefix}-splotch:before { content: fa-content($fa-var-splotch); }
+.#{$fa-css-prefix}-spotify:before { content: fa-content($fa-var-spotify); }
+.#{$fa-css-prefix}-spray-can:before { content: fa-content($fa-var-spray-can); }
+.#{$fa-css-prefix}-square:before { content: fa-content($fa-var-square); }
+.#{$fa-css-prefix}-square-full:before { content: fa-content($fa-var-square-full); }
+.#{$fa-css-prefix}-square-root-alt:before { content: fa-content($fa-var-square-root-alt); }
+.#{$fa-css-prefix}-squarespace:before { content: fa-content($fa-var-squarespace); }
+.#{$fa-css-prefix}-stack-exchange:before { content: fa-content($fa-var-stack-exchange); }
+.#{$fa-css-prefix}-stack-overflow:before { content: fa-content($fa-var-stack-overflow); }
+.#{$fa-css-prefix}-stackpath:before { content: fa-content($fa-var-stackpath); }
+.#{$fa-css-prefix}-stamp:before { content: fa-content($fa-var-stamp); }
+.#{$fa-css-prefix}-star:before { content: fa-content($fa-var-star); }
+.#{$fa-css-prefix}-star-and-crescent:before { content: fa-content($fa-var-star-and-crescent); }
+.#{$fa-css-prefix}-star-half:before { content: fa-content($fa-var-star-half); }
+.#{$fa-css-prefix}-star-half-alt:before { content: fa-content($fa-var-star-half-alt); }
+.#{$fa-css-prefix}-star-of-david:before { content: fa-content($fa-var-star-of-david); }
+.#{$fa-css-prefix}-star-of-life:before { content: fa-content($fa-var-star-of-life); }
+.#{$fa-css-prefix}-staylinked:before { content: fa-content($fa-var-staylinked); }
+.#{$fa-css-prefix}-steam:before { content: fa-content($fa-var-steam); }
+.#{$fa-css-prefix}-steam-square:before { content: fa-content($fa-var-steam-square); }
+.#{$fa-css-prefix}-steam-symbol:before { content: fa-content($fa-var-steam-symbol); }
+.#{$fa-css-prefix}-step-backward:before { content: fa-content($fa-var-step-backward); }
+.#{$fa-css-prefix}-step-forward:before { content: fa-content($fa-var-step-forward); }
+.#{$fa-css-prefix}-stethoscope:before { content: fa-content($fa-var-stethoscope); }
+.#{$fa-css-prefix}-sticker-mule:before { content: fa-content($fa-var-sticker-mule); }
+.#{$fa-css-prefix}-sticky-note:before { content: fa-content($fa-var-sticky-note); }
+.#{$fa-css-prefix}-stop:before { content: fa-content($fa-var-stop); }
+.#{$fa-css-prefix}-stop-circle:before { content: fa-content($fa-var-stop-circle); }
+.#{$fa-css-prefix}-stopwatch:before { content: fa-content($fa-var-stopwatch); }
+.#{$fa-css-prefix}-store:before { content: fa-content($fa-var-store); }
+.#{$fa-css-prefix}-store-alt:before { content: fa-content($fa-var-store-alt); }
+.#{$fa-css-prefix}-strava:before { content: fa-content($fa-var-strava); }
+.#{$fa-css-prefix}-stream:before { content: fa-content($fa-var-stream); }
+.#{$fa-css-prefix}-street-view:before { content: fa-content($fa-var-street-view); }
+.#{$fa-css-prefix}-strikethrough:before { content: fa-content($fa-var-strikethrough); }
+.#{$fa-css-prefix}-stripe:before { content: fa-content($fa-var-stripe); }
+.#{$fa-css-prefix}-stripe-s:before { content: fa-content($fa-var-stripe-s); }
+.#{$fa-css-prefix}-stroopwafel:before { content: fa-content($fa-var-stroopwafel); }
+.#{$fa-css-prefix}-studiovinari:before { content: fa-content($fa-var-studiovinari); }
+.#{$fa-css-prefix}-stumbleupon:before { content: fa-content($fa-var-stumbleupon); }
+.#{$fa-css-prefix}-stumbleupon-circle:before { content: fa-content($fa-var-stumbleupon-circle); }
+.#{$fa-css-prefix}-subscript:before { content: fa-content($fa-var-subscript); }
+.#{$fa-css-prefix}-subway:before { content: fa-content($fa-var-subway); }
+.#{$fa-css-prefix}-suitcase:before { content: fa-content($fa-var-suitcase); }
+.#{$fa-css-prefix}-suitcase-rolling:before { content: fa-content($fa-var-suitcase-rolling); }
+.#{$fa-css-prefix}-sun:before { content: fa-content($fa-var-sun); }
+.#{$fa-css-prefix}-superpowers:before { content: fa-content($fa-var-superpowers); }
+.#{$fa-css-prefix}-superscript:before { content: fa-content($fa-var-superscript); }
+.#{$fa-css-prefix}-supple:before { content: fa-content($fa-var-supple); }
+.#{$fa-css-prefix}-surprise:before { content: fa-content($fa-var-surprise); }
+.#{$fa-css-prefix}-suse:before { content: fa-content($fa-var-suse); }
+.#{$fa-css-prefix}-swatchbook:before { content: fa-content($fa-var-swatchbook); }
+.#{$fa-css-prefix}-swift:before { content: fa-content($fa-var-swift); }
+.#{$fa-css-prefix}-swimmer:before { content: fa-content($fa-var-swimmer); }
+.#{$fa-css-prefix}-swimming-pool:before { content: fa-content($fa-var-swimming-pool); }
+.#{$fa-css-prefix}-symfony:before { content: fa-content($fa-var-symfony); }
+.#{$fa-css-prefix}-synagogue:before { content: fa-content($fa-var-synagogue); }
+.#{$fa-css-prefix}-sync:before { content: fa-content($fa-var-sync); }
+.#{$fa-css-prefix}-sync-alt:before { content: fa-content($fa-var-sync-alt); }
+.#{$fa-css-prefix}-syringe:before { content: fa-content($fa-var-syringe); }
+.#{$fa-css-prefix}-table:before { content: fa-content($fa-var-table); }
+.#{$fa-css-prefix}-table-tennis:before { content: fa-content($fa-var-table-tennis); }
+.#{$fa-css-prefix}-tablet:before { content: fa-content($fa-var-tablet); }
+.#{$fa-css-prefix}-tablet-alt:before { content: fa-content($fa-var-tablet-alt); }
+.#{$fa-css-prefix}-tablets:before { content: fa-content($fa-var-tablets); }
+.#{$fa-css-prefix}-tachometer-alt:before { content: fa-content($fa-var-tachometer-alt); }
+.#{$fa-css-prefix}-tag:before { content: fa-content($fa-var-tag); }
+.#{$fa-css-prefix}-tags:before { content: fa-content($fa-var-tags); }
+.#{$fa-css-prefix}-tape:before { content: fa-content($fa-var-tape); }
+.#{$fa-css-prefix}-tasks:before { content: fa-content($fa-var-tasks); }
+.#{$fa-css-prefix}-taxi:before { content: fa-content($fa-var-taxi); }
+.#{$fa-css-prefix}-teamspeak:before { content: fa-content($fa-var-teamspeak); }
+.#{$fa-css-prefix}-teeth:before { content: fa-content($fa-var-teeth); }
+.#{$fa-css-prefix}-teeth-open:before { content: fa-content($fa-var-teeth-open); }
+.#{$fa-css-prefix}-telegram:before { content: fa-content($fa-var-telegram); }
+.#{$fa-css-prefix}-telegram-plane:before { content: fa-content($fa-var-telegram-plane); }
+.#{$fa-css-prefix}-temperature-high:before { content: fa-content($fa-var-temperature-high); }
+.#{$fa-css-prefix}-temperature-low:before { content: fa-content($fa-var-temperature-low); }
+.#{$fa-css-prefix}-tencent-weibo:before { content: fa-content($fa-var-tencent-weibo); }
+.#{$fa-css-prefix}-tenge:before { content: fa-content($fa-var-tenge); }
+.#{$fa-css-prefix}-terminal:before { content: fa-content($fa-var-terminal); }
+.#{$fa-css-prefix}-text-height:before { content: fa-content($fa-var-text-height); }
+.#{$fa-css-prefix}-text-width:before { content: fa-content($fa-var-text-width); }
+.#{$fa-css-prefix}-th:before { content: fa-content($fa-var-th); }
+.#{$fa-css-prefix}-th-large:before { content: fa-content($fa-var-th-large); }
+.#{$fa-css-prefix}-th-list:before { content: fa-content($fa-var-th-list); }
+.#{$fa-css-prefix}-the-red-yeti:before { content: fa-content($fa-var-the-red-yeti); }
+.#{$fa-css-prefix}-theater-masks:before { content: fa-content($fa-var-theater-masks); }
+.#{$fa-css-prefix}-themeco:before { content: fa-content($fa-var-themeco); }
+.#{$fa-css-prefix}-themeisle:before { content: fa-content($fa-var-themeisle); }
+.#{$fa-css-prefix}-thermometer:before { content: fa-content($fa-var-thermometer); }
+.#{$fa-css-prefix}-thermometer-empty:before { content: fa-content($fa-var-thermometer-empty); }
+.#{$fa-css-prefix}-thermometer-full:before { content: fa-content($fa-var-thermometer-full); }
+.#{$fa-css-prefix}-thermometer-half:before { content: fa-content($fa-var-thermometer-half); }
+.#{$fa-css-prefix}-thermometer-quarter:before { content: fa-content($fa-var-thermometer-quarter); }
+.#{$fa-css-prefix}-thermometer-three-quarters:before { content: fa-content($fa-var-thermometer-three-quarters); }
+.#{$fa-css-prefix}-think-peaks:before { content: fa-content($fa-var-think-peaks); }
+.#{$fa-css-prefix}-thumbs-down:before { content: fa-content($fa-var-thumbs-down); }
+.#{$fa-css-prefix}-thumbs-up:before { content: fa-content($fa-var-thumbs-up); }
+.#{$fa-css-prefix}-thumbtack:before { content: fa-content($fa-var-thumbtack); }
+.#{$fa-css-prefix}-ticket-alt:before { content: fa-content($fa-var-ticket-alt); }
+.#{$fa-css-prefix}-times:before { content: fa-content($fa-var-times); }
+.#{$fa-css-prefix}-times-circle:before { content: fa-content($fa-var-times-circle); }
+.#{$fa-css-prefix}-tint:before { content: fa-content($fa-var-tint); }
+.#{$fa-css-prefix}-tint-slash:before { content: fa-content($fa-var-tint-slash); }
+.#{$fa-css-prefix}-tired:before { content: fa-content($fa-var-tired); }
+.#{$fa-css-prefix}-toggle-off:before { content: fa-content($fa-var-toggle-off); }
+.#{$fa-css-prefix}-toggle-on:before { content: fa-content($fa-var-toggle-on); }
+.#{$fa-css-prefix}-toilet:before { content: fa-content($fa-var-toilet); }
+.#{$fa-css-prefix}-toilet-paper:before { content: fa-content($fa-var-toilet-paper); }
+.#{$fa-css-prefix}-toolbox:before { content: fa-content($fa-var-toolbox); }
+.#{$fa-css-prefix}-tools:before { content: fa-content($fa-var-tools); }
+.#{$fa-css-prefix}-tooth:before { content: fa-content($fa-var-tooth); }
+.#{$fa-css-prefix}-torah:before { content: fa-content($fa-var-torah); }
+.#{$fa-css-prefix}-torii-gate:before { content: fa-content($fa-var-torii-gate); }
+.#{$fa-css-prefix}-tractor:before { content: fa-content($fa-var-tractor); }
+.#{$fa-css-prefix}-trade-federation:before { content: fa-content($fa-var-trade-federation); }
+.#{$fa-css-prefix}-trademark:before { content: fa-content($fa-var-trademark); }
+.#{$fa-css-prefix}-traffic-light:before { content: fa-content($fa-var-traffic-light); }
+.#{$fa-css-prefix}-train:before { content: fa-content($fa-var-train); }
+.#{$fa-css-prefix}-tram:before { content: fa-content($fa-var-tram); }
+.#{$fa-css-prefix}-transgender:before { content: fa-content($fa-var-transgender); }
+.#{$fa-css-prefix}-transgender-alt:before { content: fa-content($fa-var-transgender-alt); }
+.#{$fa-css-prefix}-trash:before { content: fa-content($fa-var-trash); }
+.#{$fa-css-prefix}-trash-alt:before { content: fa-content($fa-var-trash-alt); }
+.#{$fa-css-prefix}-trash-restore:before { content: fa-content($fa-var-trash-restore); }
+.#{$fa-css-prefix}-trash-restore-alt:before { content: fa-content($fa-var-trash-restore-alt); }
+.#{$fa-css-prefix}-tree:before { content: fa-content($fa-var-tree); }
+.#{$fa-css-prefix}-trello:before { content: fa-content($fa-var-trello); }
+.#{$fa-css-prefix}-tripadvisor:before { content: fa-content($fa-var-tripadvisor); }
+.#{$fa-css-prefix}-trophy:before { content: fa-content($fa-var-trophy); }
+.#{$fa-css-prefix}-truck:before { content: fa-content($fa-var-truck); }
+.#{$fa-css-prefix}-truck-loading:before { content: fa-content($fa-var-truck-loading); }
+.#{$fa-css-prefix}-truck-monster:before { content: fa-content($fa-var-truck-monster); }
+.#{$fa-css-prefix}-truck-moving:before { content: fa-content($fa-var-truck-moving); }
+.#{$fa-css-prefix}-truck-pickup:before { content: fa-content($fa-var-truck-pickup); }
+.#{$fa-css-prefix}-tshirt:before { content: fa-content($fa-var-tshirt); }
+.#{$fa-css-prefix}-tty:before { content: fa-content($fa-var-tty); }
+.#{$fa-css-prefix}-tumblr:before { content: fa-content($fa-var-tumblr); }
+.#{$fa-css-prefix}-tumblr-square:before { content: fa-content($fa-var-tumblr-square); }
+.#{$fa-css-prefix}-tv:before { content: fa-content($fa-var-tv); }
+.#{$fa-css-prefix}-twitch:before { content: fa-content($fa-var-twitch); }
+.#{$fa-css-prefix}-twitter:before { content: fa-content($fa-var-twitter); }
+.#{$fa-css-prefix}-twitter-square:before { content: fa-content($fa-var-twitter-square); }
+.#{$fa-css-prefix}-typo3:before { content: fa-content($fa-var-typo3); }
+.#{$fa-css-prefix}-uber:before { content: fa-content($fa-var-uber); }
+.#{$fa-css-prefix}-ubuntu:before { content: fa-content($fa-var-ubuntu); }
+.#{$fa-css-prefix}-uikit:before { content: fa-content($fa-var-uikit); }
+.#{$fa-css-prefix}-umbraco:before { content: fa-content($fa-var-umbraco); }
+.#{$fa-css-prefix}-umbrella:before { content: fa-content($fa-var-umbrella); }
+.#{$fa-css-prefix}-umbrella-beach:before { content: fa-content($fa-var-umbrella-beach); }
+.#{$fa-css-prefix}-underline:before { content: fa-content($fa-var-underline); }
+.#{$fa-css-prefix}-undo:before { content: fa-content($fa-var-undo); }
+.#{$fa-css-prefix}-undo-alt:before { content: fa-content($fa-var-undo-alt); }
+.#{$fa-css-prefix}-uniregistry:before { content: fa-content($fa-var-uniregistry); }
+.#{$fa-css-prefix}-universal-access:before { content: fa-content($fa-var-universal-access); }
+.#{$fa-css-prefix}-university:before { content: fa-content($fa-var-university); }
+.#{$fa-css-prefix}-unlink:before { content: fa-content($fa-var-unlink); }
+.#{$fa-css-prefix}-unlock:before { content: fa-content($fa-var-unlock); }
+.#{$fa-css-prefix}-unlock-alt:before { content: fa-content($fa-var-unlock-alt); }
+.#{$fa-css-prefix}-untappd:before { content: fa-content($fa-var-untappd); }
+.#{$fa-css-prefix}-upload:before { content: fa-content($fa-var-upload); }
+.#{$fa-css-prefix}-ups:before { content: fa-content($fa-var-ups); }
+.#{$fa-css-prefix}-usb:before { content: fa-content($fa-var-usb); }
+.#{$fa-css-prefix}-user:before { content: fa-content($fa-var-user); }
+.#{$fa-css-prefix}-user-alt:before { content: fa-content($fa-var-user-alt); }
+.#{$fa-css-prefix}-user-alt-slash:before { content: fa-content($fa-var-user-alt-slash); }
+.#{$fa-css-prefix}-user-astronaut:before { content: fa-content($fa-var-user-astronaut); }
+.#{$fa-css-prefix}-user-check:before { content: fa-content($fa-var-user-check); }
+.#{$fa-css-prefix}-user-circle:before { content: fa-content($fa-var-user-circle); }
+.#{$fa-css-prefix}-user-clock:before { content: fa-content($fa-var-user-clock); }
+.#{$fa-css-prefix}-user-cog:before { content: fa-content($fa-var-user-cog); }
+.#{$fa-css-prefix}-user-edit:before { content: fa-content($fa-var-user-edit); }
+.#{$fa-css-prefix}-user-friends:before { content: fa-content($fa-var-user-friends); }
+.#{$fa-css-prefix}-user-graduate:before { content: fa-content($fa-var-user-graduate); }
+.#{$fa-css-prefix}-user-injured:before { content: fa-content($fa-var-user-injured); }
+.#{$fa-css-prefix}-user-lock:before { content: fa-content($fa-var-user-lock); }
+.#{$fa-css-prefix}-user-md:before { content: fa-content($fa-var-user-md); }
+.#{$fa-css-prefix}-user-minus:before { content: fa-content($fa-var-user-minus); }
+.#{$fa-css-prefix}-user-ninja:before { content: fa-content($fa-var-user-ninja); }
+.#{$fa-css-prefix}-user-nurse:before { content: fa-content($fa-var-user-nurse); }
+.#{$fa-css-prefix}-user-plus:before { content: fa-content($fa-var-user-plus); }
+.#{$fa-css-prefix}-user-secret:before { content: fa-content($fa-var-user-secret); }
+.#{$fa-css-prefix}-user-shield:before { content: fa-content($fa-var-user-shield); }
+.#{$fa-css-prefix}-user-slash:before { content: fa-content($fa-var-user-slash); }
+.#{$fa-css-prefix}-user-tag:before { content: fa-content($fa-var-user-tag); }
+.#{$fa-css-prefix}-user-tie:before { content: fa-content($fa-var-user-tie); }
+.#{$fa-css-prefix}-user-times:before { content: fa-content($fa-var-user-times); }
+.#{$fa-css-prefix}-users:before { content: fa-content($fa-var-users); }
+.#{$fa-css-prefix}-users-cog:before { content: fa-content($fa-var-users-cog); }
+.#{$fa-css-prefix}-usps:before { content: fa-content($fa-var-usps); }
+.#{$fa-css-prefix}-ussunnah:before { content: fa-content($fa-var-ussunnah); }
+.#{$fa-css-prefix}-utensil-spoon:before { content: fa-content($fa-var-utensil-spoon); }
+.#{$fa-css-prefix}-utensils:before { content: fa-content($fa-var-utensils); }
+.#{$fa-css-prefix}-vaadin:before { content: fa-content($fa-var-vaadin); }
+.#{$fa-css-prefix}-vector-square:before { content: fa-content($fa-var-vector-square); }
+.#{$fa-css-prefix}-venus:before { content: fa-content($fa-var-venus); }
+.#{$fa-css-prefix}-venus-double:before { content: fa-content($fa-var-venus-double); }
+.#{$fa-css-prefix}-venus-mars:before { content: fa-content($fa-var-venus-mars); }
+.#{$fa-css-prefix}-viacoin:before { content: fa-content($fa-var-viacoin); }
+.#{$fa-css-prefix}-viadeo:before { content: fa-content($fa-var-viadeo); }
+.#{$fa-css-prefix}-viadeo-square:before { content: fa-content($fa-var-viadeo-square); }
+.#{$fa-css-prefix}-vial:before { content: fa-content($fa-var-vial); }
+.#{$fa-css-prefix}-vials:before { content: fa-content($fa-var-vials); }
+.#{$fa-css-prefix}-viber:before { content: fa-content($fa-var-viber); }
+.#{$fa-css-prefix}-video:before { content: fa-content($fa-var-video); }
+.#{$fa-css-prefix}-video-slash:before { content: fa-content($fa-var-video-slash); }
+.#{$fa-css-prefix}-vihara:before { content: fa-content($fa-var-vihara); }
+.#{$fa-css-prefix}-vimeo:before { content: fa-content($fa-var-vimeo); }
+.#{$fa-css-prefix}-vimeo-square:before { content: fa-content($fa-var-vimeo-square); }
+.#{$fa-css-prefix}-vimeo-v:before { content: fa-content($fa-var-vimeo-v); }
+.#{$fa-css-prefix}-vine:before { content: fa-content($fa-var-vine); }
+.#{$fa-css-prefix}-vk:before { content: fa-content($fa-var-vk); }
+.#{$fa-css-prefix}-vnv:before { content: fa-content($fa-var-vnv); }
+.#{$fa-css-prefix}-voicemail:before { content: fa-content($fa-var-voicemail); }
+.#{$fa-css-prefix}-volleyball-ball:before { content: fa-content($fa-var-volleyball-ball); }
+.#{$fa-css-prefix}-volume-down:before { content: fa-content($fa-var-volume-down); }
+.#{$fa-css-prefix}-volume-mute:before { content: fa-content($fa-var-volume-mute); }
+.#{$fa-css-prefix}-volume-off:before { content: fa-content($fa-var-volume-off); }
+.#{$fa-css-prefix}-volume-up:before { content: fa-content($fa-var-volume-up); }
+.#{$fa-css-prefix}-vote-yea:before { content: fa-content($fa-var-vote-yea); }
+.#{$fa-css-prefix}-vr-cardboard:before { content: fa-content($fa-var-vr-cardboard); }
+.#{$fa-css-prefix}-vuejs:before { content: fa-content($fa-var-vuejs); }
+.#{$fa-css-prefix}-walking:before { content: fa-content($fa-var-walking); }
+.#{$fa-css-prefix}-wallet:before { content: fa-content($fa-var-wallet); }
+.#{$fa-css-prefix}-warehouse:before { content: fa-content($fa-var-warehouse); }
+.#{$fa-css-prefix}-water:before { content: fa-content($fa-var-water); }
+.#{$fa-css-prefix}-wave-square:before { content: fa-content($fa-var-wave-square); }
+.#{$fa-css-prefix}-waze:before { content: fa-content($fa-var-waze); }
+.#{$fa-css-prefix}-weebly:before { content: fa-content($fa-var-weebly); }
+.#{$fa-css-prefix}-weibo:before { content: fa-content($fa-var-weibo); }
+.#{$fa-css-prefix}-weight:before { content: fa-content($fa-var-weight); }
+.#{$fa-css-prefix}-weight-hanging:before { content: fa-content($fa-var-weight-hanging); }
+.#{$fa-css-prefix}-weixin:before { content: fa-content($fa-var-weixin); }
+.#{$fa-css-prefix}-whatsapp:before { content: fa-content($fa-var-whatsapp); }
+.#{$fa-css-prefix}-whatsapp-square:before { content: fa-content($fa-var-whatsapp-square); }
+.#{$fa-css-prefix}-wheelchair:before { content: fa-content($fa-var-wheelchair); }
+.#{$fa-css-prefix}-whmcs:before { content: fa-content($fa-var-whmcs); }
+.#{$fa-css-prefix}-wifi:before { content: fa-content($fa-var-wifi); }
+.#{$fa-css-prefix}-wikipedia-w:before { content: fa-content($fa-var-wikipedia-w); }
+.#{$fa-css-prefix}-wind:before { content: fa-content($fa-var-wind); }
+.#{$fa-css-prefix}-window-close:before { content: fa-content($fa-var-window-close); }
+.#{$fa-css-prefix}-window-maximize:before { content: fa-content($fa-var-window-maximize); }
+.#{$fa-css-prefix}-window-minimize:before { content: fa-content($fa-var-window-minimize); }
+.#{$fa-css-prefix}-window-restore:before { content: fa-content($fa-var-window-restore); }
+.#{$fa-css-prefix}-windows:before { content: fa-content($fa-var-windows); }
+.#{$fa-css-prefix}-wine-bottle:before { content: fa-content($fa-var-wine-bottle); }
+.#{$fa-css-prefix}-wine-glass:before { content: fa-content($fa-var-wine-glass); }
+.#{$fa-css-prefix}-wine-glass-alt:before { content: fa-content($fa-var-wine-glass-alt); }
+.#{$fa-css-prefix}-wix:before { content: fa-content($fa-var-wix); }
+.#{$fa-css-prefix}-wizards-of-the-coast:before { content: fa-content($fa-var-wizards-of-the-coast); }
+.#{$fa-css-prefix}-wolf-pack-battalion:before { content: fa-content($fa-var-wolf-pack-battalion); }
+.#{$fa-css-prefix}-won-sign:before { content: fa-content($fa-var-won-sign); }
+.#{$fa-css-prefix}-wordpress:before { content: fa-content($fa-var-wordpress); }
+.#{$fa-css-prefix}-wordpress-simple:before { content: fa-content($fa-var-wordpress-simple); }
+.#{$fa-css-prefix}-wpbeginner:before { content: fa-content($fa-var-wpbeginner); }
+.#{$fa-css-prefix}-wpexplorer:before { content: fa-content($fa-var-wpexplorer); }
+.#{$fa-css-prefix}-wpforms:before { content: fa-content($fa-var-wpforms); }
+.#{$fa-css-prefix}-wpressr:before { content: fa-content($fa-var-wpressr); }
+.#{$fa-css-prefix}-wrench:before { content: fa-content($fa-var-wrench); }
+.#{$fa-css-prefix}-x-ray:before { content: fa-content($fa-var-x-ray); }
+.#{$fa-css-prefix}-xbox:before { content: fa-content($fa-var-xbox); }
+.#{$fa-css-prefix}-xing:before { content: fa-content($fa-var-xing); }
+.#{$fa-css-prefix}-xing-square:before { content: fa-content($fa-var-xing-square); }
+.#{$fa-css-prefix}-y-combinator:before { content: fa-content($fa-var-y-combinator); }
+.#{$fa-css-prefix}-yahoo:before { content: fa-content($fa-var-yahoo); }
+.#{$fa-css-prefix}-yammer:before { content: fa-content($fa-var-yammer); }
+.#{$fa-css-prefix}-yandex:before { content: fa-content($fa-var-yandex); }
+.#{$fa-css-prefix}-yandex-international:before { content: fa-content($fa-var-yandex-international); }
+.#{$fa-css-prefix}-yarn:before { content: fa-content($fa-var-yarn); }
+.#{$fa-css-prefix}-yelp:before { content: fa-content($fa-var-yelp); }
+.#{$fa-css-prefix}-yen-sign:before { content: fa-content($fa-var-yen-sign); }
+.#{$fa-css-prefix}-yin-yang:before { content: fa-content($fa-var-yin-yang); }
+.#{$fa-css-prefix}-yoast:before { content: fa-content($fa-var-yoast); }
+.#{$fa-css-prefix}-youtube:before { content: fa-content($fa-var-youtube); }
+.#{$fa-css-prefix}-youtube-square:before { content: fa-content($fa-var-youtube-square); }
+.#{$fa-css-prefix}-zhihu:before { content: fa-content($fa-var-zhihu); }
diff --git a/x2engine/compass/css/lib/scss/_larger.scss b/x2engine/compass/css/lib/scss/_larger.scss
new file mode 100644
index 000000000..27c2ad5fc
--- /dev/null
+++ b/x2engine/compass/css/lib/scss/_larger.scss
@@ -0,0 +1,23 @@
+// Icon Sizes
+// -------------------------
+
+// makes the font 33% larger relative to the icon container
+.#{$fa-css-prefix}-lg {
+ font-size: (4em / 3);
+ line-height: (3em / 4);
+ vertical-align: -.0667em;
+}
+
+.#{$fa-css-prefix}-xs {
+ font-size: .75em;
+}
+
+.#{$fa-css-prefix}-sm {
+ font-size: .875em;
+}
+
+@for $i from 1 through 10 {
+ .#{$fa-css-prefix}-#{$i}x {
+ font-size: $i * 1em;
+ }
+}
diff --git a/x2engine/compass/css/lib/scss/_list.scss b/x2engine/compass/css/lib/scss/_list.scss
new file mode 100644
index 000000000..8ebf33333
--- /dev/null
+++ b/x2engine/compass/css/lib/scss/_list.scss
@@ -0,0 +1,18 @@
+// List Icons
+// -------------------------
+
+.#{$fa-css-prefix}-ul {
+ list-style-type: none;
+ margin-left: $fa-li-width * 5/4;
+ padding-left: 0;
+
+ > li { position: relative; }
+}
+
+.#{$fa-css-prefix}-li {
+ left: -$fa-li-width;
+ position: absolute;
+ text-align: center;
+ width: $fa-li-width;
+ line-height: inherit;
+}
diff --git a/x2engine/compass/css/lib/scss/_mixins.scss b/x2engine/compass/css/lib/scss/_mixins.scss
new file mode 100644
index 000000000..55baeeba3
--- /dev/null
+++ b/x2engine/compass/css/lib/scss/_mixins.scss
@@ -0,0 +1,56 @@
+// Mixins
+// --------------------------
+
+@mixin fa-icon {
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ display: inline-block;
+ font-style: normal;
+ font-variant: normal;
+ font-weight: normal;
+ line-height: 1;
+}
+
+@mixin fa-icon-rotate($degrees, $rotation) {
+ -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation})";
+ transform: rotate($degrees);
+}
+
+@mixin fa-icon-flip($horiz, $vert, $rotation) {
+ -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation}, mirror=1)";
+ transform: scale($horiz, $vert);
+}
+
+
+// Only display content to screen readers. A la Bootstrap 4.
+//
+// See: http://a11yproject.com/posts/how-to-hide-content/
+
+@mixin sr-only {
+ border: 0;
+ clip: rect(0, 0, 0, 0);
+ height: 1px;
+ margin: -1px;
+ overflow: hidden;
+ padding: 0;
+ position: absolute;
+ width: 1px;
+}
+
+// Use in conjunction with .sr-only to only display content when it's focused.
+//
+// Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1
+//
+// Credit: HTML5 Boilerplate
+
+@mixin sr-only-focusable {
+ &:active,
+ &:focus {
+ clip: auto;
+ height: auto;
+ margin: 0;
+ overflow: visible;
+ position: static;
+ width: auto;
+ }
+}
diff --git a/x2engine/compass/css/lib/scss/_rotated-flipped.scss b/x2engine/compass/css/lib/scss/_rotated-flipped.scss
new file mode 100644
index 000000000..164d97219
--- /dev/null
+++ b/x2engine/compass/css/lib/scss/_rotated-flipped.scss
@@ -0,0 +1,24 @@
+// Rotated & Flipped Icons
+// -------------------------
+
+.#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); }
+.#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); }
+.#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); }
+
+.#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); }
+.#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); }
+.#{$fa-css-prefix}-flip-both, .#{$fa-css-prefix}-flip-horizontal.#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(-1, -1, 2); }
+
+// Hook for IE8-9
+// -------------------------
+
+:root {
+ .#{$fa-css-prefix}-rotate-90,
+ .#{$fa-css-prefix}-rotate-180,
+ .#{$fa-css-prefix}-rotate-270,
+ .#{$fa-css-prefix}-flip-horizontal,
+ .#{$fa-css-prefix}-flip-vertical,
+ .#{$fa-css-prefix}-flip-both {
+ filter: none;
+ }
+}
diff --git a/x2engine/compass/css/lib/scss/_screen-reader.scss b/x2engine/compass/css/lib/scss/_screen-reader.scss
new file mode 100644
index 000000000..5d0ab262f
--- /dev/null
+++ b/x2engine/compass/css/lib/scss/_screen-reader.scss
@@ -0,0 +1,5 @@
+// Screen Readers
+// -------------------------
+
+.sr-only { @include sr-only; }
+.sr-only-focusable { @include sr-only-focusable; }
diff --git a/x2engine/compass/css/lib/scss/_shims.scss b/x2engine/compass/css/lib/scss/_shims.scss
new file mode 100644
index 000000000..c7110812b
--- /dev/null
+++ b/x2engine/compass/css/lib/scss/_shims.scss
@@ -0,0 +1,2062 @@
+.#{$fa-css-prefix}.#{$fa-css-prefix}-glass:before { content: fa-content($fa-var-glass-martini); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-meetup {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-star-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-star-o:before { content: fa-content($fa-var-star); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-remove:before { content: fa-content($fa-var-times); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-close:before { content: fa-content($fa-var-times); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-gear:before { content: fa-content($fa-var-cog); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-trash-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-trash-o:before { content: fa-content($fa-var-trash-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-o:before { content: fa-content($fa-var-file); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-clock-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-clock-o:before { content: fa-content($fa-var-clock); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-arrow-circle-o-down {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-arrow-circle-o-down:before { content: fa-content($fa-var-arrow-alt-circle-down); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-arrow-circle-o-up {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-arrow-circle-o-up:before { content: fa-content($fa-var-arrow-alt-circle-up); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-play-circle-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-play-circle-o:before { content: fa-content($fa-var-play-circle); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-repeat:before { content: fa-content($fa-var-redo); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-rotate-right:before { content: fa-content($fa-var-redo); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-refresh:before { content: fa-content($fa-var-sync); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-list-alt {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-dedent:before { content: fa-content($fa-var-outdent); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-video-camera:before { content: fa-content($fa-var-video); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-picture-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-picture-o:before { content: fa-content($fa-var-image); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-photo {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-photo:before { content: fa-content($fa-var-image); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-image {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-image:before { content: fa-content($fa-var-image); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-pencil:before { content: fa-content($fa-var-pencil-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-map-marker:before { content: fa-content($fa-var-map-marker-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-pencil-square-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-pencil-square-o:before { content: fa-content($fa-var-edit); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-share-square-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-share-square-o:before { content: fa-content($fa-var-share-square); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-check-square-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-check-square-o:before { content: fa-content($fa-var-check-square); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-arrows:before { content: fa-content($fa-var-arrows-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-times-circle-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-times-circle-o:before { content: fa-content($fa-var-times-circle); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-check-circle-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-check-circle-o:before { content: fa-content($fa-var-check-circle); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-mail-forward:before { content: fa-content($fa-var-share); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-eye {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-eye-slash {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-warning:before { content: fa-content($fa-var-exclamation-triangle); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-calendar:before { content: fa-content($fa-var-calendar-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-arrows-v:before { content: fa-content($fa-var-arrows-alt-v); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-arrows-h:before { content: fa-content($fa-var-arrows-alt-h); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-bar-chart {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-bar-chart:before { content: fa-content($fa-var-chart-bar); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-bar-chart-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-bar-chart-o:before { content: fa-content($fa-var-chart-bar); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-twitter-square {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-facebook-square {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-gears:before { content: fa-content($fa-var-cogs); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-thumbs-o-up {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-thumbs-o-up:before { content: fa-content($fa-var-thumbs-up); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-thumbs-o-down {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-thumbs-o-down:before { content: fa-content($fa-var-thumbs-down); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-heart-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-heart-o:before { content: fa-content($fa-var-heart); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-sign-out:before { content: fa-content($fa-var-sign-out-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-linkedin-square {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-linkedin-square:before { content: fa-content($fa-var-linkedin); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-thumb-tack:before { content: fa-content($fa-var-thumbtack); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-external-link:before { content: fa-content($fa-var-external-link-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-sign-in:before { content: fa-content($fa-var-sign-in-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-github-square {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-lemon-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-lemon-o:before { content: fa-content($fa-var-lemon); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-square-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-square-o:before { content: fa-content($fa-var-square); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-bookmark-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-bookmark-o:before { content: fa-content($fa-var-bookmark); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-twitter {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-facebook {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-facebook:before { content: fa-content($fa-var-facebook-f); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-facebook-f {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-facebook-f:before { content: fa-content($fa-var-facebook-f); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-github {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-credit-card {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-feed:before { content: fa-content($fa-var-rss); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hdd-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hdd-o:before { content: fa-content($fa-var-hdd); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-o-right {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-o-right:before { content: fa-content($fa-var-hand-point-right); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-o-left {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-o-left:before { content: fa-content($fa-var-hand-point-left); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-o-up {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-o-up:before { content: fa-content($fa-var-hand-point-up); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-o-down {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-o-down:before { content: fa-content($fa-var-hand-point-down); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-arrows-alt:before { content: fa-content($fa-var-expand-arrows-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-group:before { content: fa-content($fa-var-users); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-chain:before { content: fa-content($fa-var-link); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-scissors:before { content: fa-content($fa-var-cut); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-files-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-files-o:before { content: fa-content($fa-var-copy); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-floppy-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-floppy-o:before { content: fa-content($fa-var-save); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-navicon:before { content: fa-content($fa-var-bars); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-reorder:before { content: fa-content($fa-var-bars); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-pinterest {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-pinterest-square {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-google-plus-square {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-google-plus {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-google-plus:before { content: fa-content($fa-var-google-plus-g); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-money {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-money:before { content: fa-content($fa-var-money-bill-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-unsorted:before { content: fa-content($fa-var-sort); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-sort-desc:before { content: fa-content($fa-var-sort-down); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-sort-asc:before { content: fa-content($fa-var-sort-up); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-linkedin {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-linkedin:before { content: fa-content($fa-var-linkedin-in); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-rotate-left:before { content: fa-content($fa-var-undo); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-legal:before { content: fa-content($fa-var-gavel); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-tachometer:before { content: fa-content($fa-var-tachometer-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-dashboard:before { content: fa-content($fa-var-tachometer-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-comment-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-comment-o:before { content: fa-content($fa-var-comment); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-comments-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-comments-o:before { content: fa-content($fa-var-comments); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-flash:before { content: fa-content($fa-var-bolt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-clipboard {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-paste {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-paste:before { content: fa-content($fa-var-clipboard); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-lightbulb-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-lightbulb-o:before { content: fa-content($fa-var-lightbulb); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-exchange:before { content: fa-content($fa-var-exchange-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-cloud-download:before { content: fa-content($fa-var-cloud-download-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-cloud-upload:before { content: fa-content($fa-var-cloud-upload-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-bell-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-bell-o:before { content: fa-content($fa-var-bell); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-cutlery:before { content: fa-content($fa-var-utensils); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-text-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-text-o:before { content: fa-content($fa-var-file-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-building-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-building-o:before { content: fa-content($fa-var-building); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hospital-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hospital-o:before { content: fa-content($fa-var-hospital); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-tablet:before { content: fa-content($fa-var-tablet-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-mobile:before { content: fa-content($fa-var-mobile-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-mobile-phone:before { content: fa-content($fa-var-mobile-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-circle-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-circle-o:before { content: fa-content($fa-var-circle); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-mail-reply:before { content: fa-content($fa-var-reply); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-github-alt {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-folder-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-folder-o:before { content: fa-content($fa-var-folder); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-folder-open-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-folder-open-o:before { content: fa-content($fa-var-folder-open); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-smile-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-smile-o:before { content: fa-content($fa-var-smile); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-frown-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-frown-o:before { content: fa-content($fa-var-frown); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-meh-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-meh-o:before { content: fa-content($fa-var-meh); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-keyboard-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-keyboard-o:before { content: fa-content($fa-var-keyboard); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-flag-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-flag-o:before { content: fa-content($fa-var-flag); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-mail-reply-all:before { content: fa-content($fa-var-reply-all); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-star-half-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-star-half-o:before { content: fa-content($fa-var-star-half); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-star-half-empty {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-star-half-empty:before { content: fa-content($fa-var-star-half); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-star-half-full {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-star-half-full:before { content: fa-content($fa-var-star-half); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-code-fork:before { content: fa-content($fa-var-code-branch); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-chain-broken:before { content: fa-content($fa-var-unlink); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-shield:before { content: fa-content($fa-var-shield-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-calendar-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-calendar-o:before { content: fa-content($fa-var-calendar); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-maxcdn {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-html5 {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-css3 {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-ticket:before { content: fa-content($fa-var-ticket-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-minus-square-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-minus-square-o:before { content: fa-content($fa-var-minus-square); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-level-up:before { content: fa-content($fa-var-level-up-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-level-down:before { content: fa-content($fa-var-level-down-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-pencil-square:before { content: fa-content($fa-var-pen-square); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-external-link-square:before { content: fa-content($fa-var-external-link-square-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-compass {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-caret-square-o-down {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-caret-square-o-down:before { content: fa-content($fa-var-caret-square-down); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-toggle-down {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-toggle-down:before { content: fa-content($fa-var-caret-square-down); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-caret-square-o-up {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-caret-square-o-up:before { content: fa-content($fa-var-caret-square-up); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-toggle-up {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-toggle-up:before { content: fa-content($fa-var-caret-square-up); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-caret-square-o-right {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-caret-square-o-right:before { content: fa-content($fa-var-caret-square-right); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-toggle-right {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-toggle-right:before { content: fa-content($fa-var-caret-square-right); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-eur:before { content: fa-content($fa-var-euro-sign); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-euro:before { content: fa-content($fa-var-euro-sign); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-gbp:before { content: fa-content($fa-var-pound-sign); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-usd:before { content: fa-content($fa-var-dollar-sign); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-dollar:before { content: fa-content($fa-var-dollar-sign); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-inr:before { content: fa-content($fa-var-rupee-sign); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-rupee:before { content: fa-content($fa-var-rupee-sign); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-jpy:before { content: fa-content($fa-var-yen-sign); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-cny:before { content: fa-content($fa-var-yen-sign); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-rmb:before { content: fa-content($fa-var-yen-sign); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-yen:before { content: fa-content($fa-var-yen-sign); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-rub:before { content: fa-content($fa-var-ruble-sign); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-ruble:before { content: fa-content($fa-var-ruble-sign); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-rouble:before { content: fa-content($fa-var-ruble-sign); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-krw:before { content: fa-content($fa-var-won-sign); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-won:before { content: fa-content($fa-var-won-sign); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-btc {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-bitcoin {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-bitcoin:before { content: fa-content($fa-var-btc); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-text:before { content: fa-content($fa-var-file-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-sort-alpha-asc:before { content: fa-content($fa-var-sort-alpha-down); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-sort-alpha-desc:before { content: fa-content($fa-var-sort-alpha-down-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-sort-amount-asc:before { content: fa-content($fa-var-sort-amount-down); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-sort-amount-desc:before { content: fa-content($fa-var-sort-amount-down-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-sort-numeric-asc:before { content: fa-content($fa-var-sort-numeric-down); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-sort-numeric-desc:before { content: fa-content($fa-var-sort-numeric-down-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-youtube-square {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-youtube {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-xing {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-xing-square {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-youtube-play {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-youtube-play:before { content: fa-content($fa-var-youtube); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-dropbox {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-stack-overflow {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-instagram {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-flickr {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-adn {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-bitbucket {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-bitbucket-square {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-bitbucket-square:before { content: fa-content($fa-var-bitbucket); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-tumblr {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-tumblr-square {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-long-arrow-down:before { content: fa-content($fa-var-long-arrow-alt-down); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-long-arrow-up:before { content: fa-content($fa-var-long-arrow-alt-up); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-long-arrow-left:before { content: fa-content($fa-var-long-arrow-alt-left); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-long-arrow-right:before { content: fa-content($fa-var-long-arrow-alt-right); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-apple {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-windows {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-android {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-linux {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-dribbble {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-skype {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-foursquare {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-trello {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-gratipay {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-gittip {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-gittip:before { content: fa-content($fa-var-gratipay); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-sun-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-sun-o:before { content: fa-content($fa-var-sun); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-moon-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-moon-o:before { content: fa-content($fa-var-moon); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-vk {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-weibo {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-renren {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-pagelines {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-stack-exchange {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-arrow-circle-o-right {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-arrow-circle-o-right:before { content: fa-content($fa-var-arrow-alt-circle-right); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-arrow-circle-o-left {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-arrow-circle-o-left:before { content: fa-content($fa-var-arrow-alt-circle-left); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-caret-square-o-left {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-caret-square-o-left:before { content: fa-content($fa-var-caret-square-left); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-toggle-left {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-toggle-left:before { content: fa-content($fa-var-caret-square-left); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-dot-circle-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-dot-circle-o:before { content: fa-content($fa-var-dot-circle); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-vimeo-square {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-try:before { content: fa-content($fa-var-lira-sign); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-turkish-lira:before { content: fa-content($fa-var-lira-sign); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-plus-square-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-plus-square-o:before { content: fa-content($fa-var-plus-square); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-slack {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-wordpress {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-openid {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-institution:before { content: fa-content($fa-var-university); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-bank:before { content: fa-content($fa-var-university); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-mortar-board:before { content: fa-content($fa-var-graduation-cap); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-yahoo {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-google {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-reddit {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-reddit-square {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-stumbleupon-circle {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-stumbleupon {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-delicious {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-digg {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-pied-piper-pp {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-pied-piper-alt {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-drupal {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-joomla {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-spoon:before { content: fa-content($fa-var-utensil-spoon); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-behance {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-behance-square {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-steam {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-steam-square {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-automobile:before { content: fa-content($fa-var-car); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-cab:before { content: fa-content($fa-var-taxi); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-envelope-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-envelope-o:before { content: fa-content($fa-var-envelope); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-deviantart {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-soundcloud {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-pdf-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-pdf-o:before { content: fa-content($fa-var-file-pdf); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-word-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-word-o:before { content: fa-content($fa-var-file-word); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-excel-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-excel-o:before { content: fa-content($fa-var-file-excel); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-powerpoint-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-powerpoint-o:before { content: fa-content($fa-var-file-powerpoint); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-image-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-image-o:before { content: fa-content($fa-var-file-image); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-photo-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-photo-o:before { content: fa-content($fa-var-file-image); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-picture-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-picture-o:before { content: fa-content($fa-var-file-image); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-archive-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-archive-o:before { content: fa-content($fa-var-file-archive); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-zip-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-zip-o:before { content: fa-content($fa-var-file-archive); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-audio-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-audio-o:before { content: fa-content($fa-var-file-audio); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-sound-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-sound-o:before { content: fa-content($fa-var-file-audio); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-video-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-video-o:before { content: fa-content($fa-var-file-video); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-movie-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-movie-o:before { content: fa-content($fa-var-file-video); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-code-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-file-code-o:before { content: fa-content($fa-var-file-code); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-vine {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-codepen {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-jsfiddle {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-life-ring {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-life-bouy {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-life-bouy:before { content: fa-content($fa-var-life-ring); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-life-buoy {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-life-buoy:before { content: fa-content($fa-var-life-ring); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-life-saver {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-life-saver:before { content: fa-content($fa-var-life-ring); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-support {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-support:before { content: fa-content($fa-var-life-ring); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-circle-o-notch:before { content: fa-content($fa-var-circle-notch); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-rebel {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-ra {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-ra:before { content: fa-content($fa-var-rebel); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-resistance {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-resistance:before { content: fa-content($fa-var-rebel); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-empire {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-ge {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-ge:before { content: fa-content($fa-var-empire); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-git-square {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-git {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hacker-news {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-y-combinator-square {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-y-combinator-square:before { content: fa-content($fa-var-hacker-news); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-yc-square {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-yc-square:before { content: fa-content($fa-var-hacker-news); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-tencent-weibo {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-qq {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-weixin {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-wechat {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-wechat:before { content: fa-content($fa-var-weixin); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-send:before { content: fa-content($fa-var-paper-plane); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-paper-plane-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-paper-plane-o:before { content: fa-content($fa-var-paper-plane); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-send-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-send-o:before { content: fa-content($fa-var-paper-plane); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-circle-thin {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-circle-thin:before { content: fa-content($fa-var-circle); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-header:before { content: fa-content($fa-var-heading); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-sliders:before { content: fa-content($fa-var-sliders-h); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-futbol-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-futbol-o:before { content: fa-content($fa-var-futbol); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-soccer-ball-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-soccer-ball-o:before { content: fa-content($fa-var-futbol); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-slideshare {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-twitch {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-yelp {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-newspaper-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-newspaper-o:before { content: fa-content($fa-var-newspaper); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-paypal {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-google-wallet {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-cc-visa {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-cc-mastercard {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-cc-discover {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-cc-amex {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-cc-paypal {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-cc-stripe {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-bell-slash-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-bell-slash-o:before { content: fa-content($fa-var-bell-slash); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-trash:before { content: fa-content($fa-var-trash-alt); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-copyright {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-eyedropper:before { content: fa-content($fa-var-eye-dropper); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-area-chart:before { content: fa-content($fa-var-chart-area); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-pie-chart:before { content: fa-content($fa-var-chart-pie); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-line-chart:before { content: fa-content($fa-var-chart-line); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-lastfm {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-lastfm-square {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-ioxhost {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-angellist {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-cc {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-cc:before { content: fa-content($fa-var-closed-captioning); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-ils:before { content: fa-content($fa-var-shekel-sign); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-shekel:before { content: fa-content($fa-var-shekel-sign); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-sheqel:before { content: fa-content($fa-var-shekel-sign); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-meanpath {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-meanpath:before { content: fa-content($fa-var-font-awesome); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-buysellads {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-connectdevelop {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-dashcube {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-forumbee {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-leanpub {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-sellsy {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-shirtsinbulk {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-simplybuilt {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-skyatlas {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-diamond {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-diamond:before { content: fa-content($fa-var-gem); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-intersex:before { content: fa-content($fa-var-transgender); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-facebook-official {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-facebook-official:before { content: fa-content($fa-var-facebook); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-pinterest-p {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-whatsapp {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hotel:before { content: fa-content($fa-var-bed); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-viacoin {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-medium {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-y-combinator {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-yc {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-yc:before { content: fa-content($fa-var-y-combinator); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-optin-monster {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-opencart {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-expeditedssl {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-battery-4:before { content: fa-content($fa-var-battery-full); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-battery:before { content: fa-content($fa-var-battery-full); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-battery-3:before { content: fa-content($fa-var-battery-three-quarters); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-battery-2:before { content: fa-content($fa-var-battery-half); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-battery-1:before { content: fa-content($fa-var-battery-quarter); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-battery-0:before { content: fa-content($fa-var-battery-empty); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-object-group {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-object-ungroup {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-sticky-note-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-sticky-note-o:before { content: fa-content($fa-var-sticky-note); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-cc-jcb {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-cc-diners-club {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-clone {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hourglass-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hourglass-o:before { content: fa-content($fa-var-hourglass); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hourglass-1:before { content: fa-content($fa-var-hourglass-start); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hourglass-2:before { content: fa-content($fa-var-hourglass-half); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hourglass-3:before { content: fa-content($fa-var-hourglass-end); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-rock-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-rock-o:before { content: fa-content($fa-var-hand-rock); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-grab-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-grab-o:before { content: fa-content($fa-var-hand-rock); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-paper-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-paper-o:before { content: fa-content($fa-var-hand-paper); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-stop-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-stop-o:before { content: fa-content($fa-var-hand-paper); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-scissors-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-scissors-o:before { content: fa-content($fa-var-hand-scissors); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-lizard-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-lizard-o:before { content: fa-content($fa-var-hand-lizard); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-spock-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-spock-o:before { content: fa-content($fa-var-hand-spock); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-pointer-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-pointer-o:before { content: fa-content($fa-var-hand-pointer); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-peace-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hand-peace-o:before { content: fa-content($fa-var-hand-peace); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-registered {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-creative-commons {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-gg {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-gg-circle {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-tripadvisor {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-odnoklassniki {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-odnoklassniki-square {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-get-pocket {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-wikipedia-w {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-safari {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-chrome {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-firefox {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-opera {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-internet-explorer {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-television:before { content: fa-content($fa-var-tv); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-contao {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-500px {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-amazon {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-calendar-plus-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-calendar-plus-o:before { content: fa-content($fa-var-calendar-plus); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-calendar-minus-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-calendar-minus-o:before { content: fa-content($fa-var-calendar-minus); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-calendar-times-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-calendar-times-o:before { content: fa-content($fa-var-calendar-times); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-calendar-check-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-calendar-check-o:before { content: fa-content($fa-var-calendar-check); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-map-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-map-o:before { content: fa-content($fa-var-map); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-commenting:before { content: fa-content($fa-var-comment-dots); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-commenting-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-commenting-o:before { content: fa-content($fa-var-comment-dots); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-houzz {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-vimeo {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-vimeo:before { content: fa-content($fa-var-vimeo-v); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-black-tie {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-fonticons {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-reddit-alien {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-edge {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-credit-card-alt:before { content: fa-content($fa-var-credit-card); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-codiepie {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-modx {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-fort-awesome {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-usb {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-product-hunt {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-mixcloud {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-scribd {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-pause-circle-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-pause-circle-o:before { content: fa-content($fa-var-pause-circle); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-stop-circle-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-stop-circle-o:before { content: fa-content($fa-var-stop-circle); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-bluetooth {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-bluetooth-b {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-gitlab {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-wpbeginner {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-wpforms {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-envira {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-wheelchair-alt {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-wheelchair-alt:before { content: fa-content($fa-var-accessible-icon); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-question-circle-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-question-circle-o:before { content: fa-content($fa-var-question-circle); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-volume-control-phone:before { content: fa-content($fa-var-phone-volume); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-asl-interpreting:before { content: fa-content($fa-var-american-sign-language-interpreting); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-deafness:before { content: fa-content($fa-var-deaf); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-hard-of-hearing:before { content: fa-content($fa-var-deaf); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-glide {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-glide-g {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-signing:before { content: fa-content($fa-var-sign-language); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-viadeo {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-viadeo-square {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-snapchat {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-snapchat-ghost {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-snapchat-square {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-pied-piper {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-first-order {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-yoast {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-themeisle {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-google-plus-official {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-google-plus-official:before { content: fa-content($fa-var-google-plus); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-google-plus-circle {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-google-plus-circle:before { content: fa-content($fa-var-google-plus); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-font-awesome {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-fa {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-fa:before { content: fa-content($fa-var-font-awesome); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-handshake-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-handshake-o:before { content: fa-content($fa-var-handshake); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-envelope-open-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-envelope-open-o:before { content: fa-content($fa-var-envelope-open); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-linode {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-address-book-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-address-book-o:before { content: fa-content($fa-var-address-book); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-vcard:before { content: fa-content($fa-var-address-card); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-address-card-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-address-card-o:before { content: fa-content($fa-var-address-card); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-vcard-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-vcard-o:before { content: fa-content($fa-var-address-card); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-user-circle-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-user-circle-o:before { content: fa-content($fa-var-user-circle); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-user-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-user-o:before { content: fa-content($fa-var-user); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-id-badge {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-drivers-license:before { content: fa-content($fa-var-id-card); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-id-card-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-id-card-o:before { content: fa-content($fa-var-id-card); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-drivers-license-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-drivers-license-o:before { content: fa-content($fa-var-id-card); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-quora {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-free-code-camp {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-telegram {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-thermometer-4:before { content: fa-content($fa-var-thermometer-full); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-thermometer:before { content: fa-content($fa-var-thermometer-full); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-thermometer-3:before { content: fa-content($fa-var-thermometer-three-quarters); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-thermometer-2:before { content: fa-content($fa-var-thermometer-half); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-thermometer-1:before { content: fa-content($fa-var-thermometer-quarter); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-thermometer-0:before { content: fa-content($fa-var-thermometer-empty); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-bathtub:before { content: fa-content($fa-var-bath); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-s15:before { content: fa-content($fa-var-bath); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-window-maximize {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-window-restore {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-times-rectangle:before { content: fa-content($fa-var-window-close); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-window-close-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-window-close-o:before { content: fa-content($fa-var-window-close); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-times-rectangle-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-times-rectangle-o:before { content: fa-content($fa-var-window-close); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-bandcamp {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-grav {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-etsy {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-imdb {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-ravelry {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-eercast {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-eercast:before { content: fa-content($fa-var-sellcast); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-snowflake-o {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
+.#{$fa-css-prefix}.#{$fa-css-prefix}-snowflake-o:before { content: fa-content($fa-var-snowflake); }
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-superpowers {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-wpexplorer {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
+.#{$fa-css-prefix}.#{$fa-css-prefix}-spotify {
+ font-family: 'Font Awesome 5 Brands';
+ font-weight: 400;
+}
+
diff --git a/x2engine/compass/css/lib/scss/_stacked.scss b/x2engine/compass/css/lib/scss/_stacked.scss
new file mode 100644
index 000000000..ae7ef4e8e
--- /dev/null
+++ b/x2engine/compass/css/lib/scss/_stacked.scss
@@ -0,0 +1,31 @@
+// Stacked Icons
+// -------------------------
+
+.#{$fa-css-prefix}-stack {
+ display: inline-block;
+ height: 2em;
+ line-height: 2em;
+ position: relative;
+ vertical-align: middle;
+ width: ($fa-fw-width*2);
+}
+
+.#{$fa-css-prefix}-stack-1x,
+.#{$fa-css-prefix}-stack-2x {
+ left: 0;
+ position: absolute;
+ text-align: center;
+ width: 100%;
+}
+
+.#{$fa-css-prefix}-stack-1x {
+ line-height: inherit;
+}
+
+.#{$fa-css-prefix}-stack-2x {
+ font-size: 2em;
+}
+
+.#{$fa-css-prefix}-inverse {
+ color: $fa-inverse;
+}
diff --git a/x2engine/compass/css/lib/scss/_variables.scss b/x2engine/compass/css/lib/scss/_variables.scss
new file mode 100644
index 000000000..e0ab6ac1d
--- /dev/null
+++ b/x2engine/compass/css/lib/scss/_variables.scss
@@ -0,0 +1,1414 @@
+// Variables
+// --------------------------
+
+$fa-font-path: "../../../themes/x2engine/css/fontAwesome/webfonts" !default;
+$fa-font-size-base: 16px !default;
+$fa-font-display: auto !default;
+$fa-css-prefix: fa !default;
+$fa-version: "5.11.2" !default;
+$fa-border-color: #eee !default;
+$fa-inverse: #fff !default;
+$fa-li-width: 2em !default;
+$fa-fw-width: (20em / 16);
+$fa-primary-opacity: 1 !default;
+$fa-secondary-opacity: .4 !default;
+
+// Convenience function used to set content property
+@function fa-content($fa-var) {
+ @return unquote("\"#{ $fa-var }\"");
+}
+
+$fa-var-500px: \f26e;
+$fa-var-accessible-icon: \f368;
+$fa-var-accusoft: \f369;
+$fa-var-acquisitions-incorporated: \f6af;
+$fa-var-ad: \f641;
+$fa-var-address-book: \f2b9;
+$fa-var-address-card: \f2bb;
+$fa-var-adjust: \f042;
+$fa-var-adn: \f170;
+$fa-var-adobe: \f778;
+$fa-var-adversal: \f36a;
+$fa-var-affiliatetheme: \f36b;
+$fa-var-air-freshener: \f5d0;
+$fa-var-airbnb: \f834;
+$fa-var-algolia: \f36c;
+$fa-var-align-center: \f037;
+$fa-var-align-justify: \f039;
+$fa-var-align-left: \f036;
+$fa-var-align-right: \f038;
+$fa-var-alipay: \f642;
+$fa-var-allergies: \f461;
+$fa-var-amazon: \f270;
+$fa-var-amazon-pay: \f42c;
+$fa-var-ambulance: \f0f9;
+$fa-var-american-sign-language-interpreting: \f2a3;
+$fa-var-amilia: \f36d;
+$fa-var-anchor: \f13d;
+$fa-var-android: \f17b;
+$fa-var-angellist: \f209;
+$fa-var-angle-double-down: \f103;
+$fa-var-angle-double-left: \f100;
+$fa-var-angle-double-right: \f101;
+$fa-var-angle-double-up: \f102;
+$fa-var-angle-down: \f107;
+$fa-var-angle-left: \f104;
+$fa-var-angle-right: \f105;
+$fa-var-angle-up: \f106;
+$fa-var-angry: \f556;
+$fa-var-angrycreative: \f36e;
+$fa-var-angular: \f420;
+$fa-var-ankh: \f644;
+$fa-var-app-store: \f36f;
+$fa-var-app-store-ios: \f370;
+$fa-var-apper: \f371;
+$fa-var-apple: \f179;
+$fa-var-apple-alt: \f5d1;
+$fa-var-apple-pay: \f415;
+$fa-var-archive: \f187;
+$fa-var-archway: \f557;
+$fa-var-arrow-alt-circle-down: \f358;
+$fa-var-arrow-alt-circle-left: \f359;
+$fa-var-arrow-alt-circle-right: \f35a;
+$fa-var-arrow-alt-circle-up: \f35b;
+$fa-var-arrow-circle-down: \f0ab;
+$fa-var-arrow-circle-left: \f0a8;
+$fa-var-arrow-circle-right: \f0a9;
+$fa-var-arrow-circle-up: \f0aa;
+$fa-var-arrow-down: \f063;
+$fa-var-arrow-left: \f060;
+$fa-var-arrow-right: \f061;
+$fa-var-arrow-up: \f062;
+$fa-var-arrows-alt: \f0b2;
+$fa-var-arrows-alt-h: \f337;
+$fa-var-arrows-alt-v: \f338;
+$fa-var-artstation: \f77a;
+$fa-var-assistive-listening-systems: \f2a2;
+$fa-var-asterisk: \f069;
+$fa-var-asymmetrik: \f372;
+$fa-var-at: \f1fa;
+$fa-var-atlas: \f558;
+$fa-var-atlassian: \f77b;
+$fa-var-atom: \f5d2;
+$fa-var-audible: \f373;
+$fa-var-audio-description: \f29e;
+$fa-var-autoprefixer: \f41c;
+$fa-var-avianex: \f374;
+$fa-var-aviato: \f421;
+$fa-var-award: \f559;
+$fa-var-aws: \f375;
+$fa-var-baby: \f77c;
+$fa-var-baby-carriage: \f77d;
+$fa-var-backspace: \f55a;
+$fa-var-backward: \f04a;
+$fa-var-bacon: \f7e5;
+$fa-var-balance-scale: \f24e;
+$fa-var-balance-scale-left: \f515;
+$fa-var-balance-scale-right: \f516;
+$fa-var-ban: \f05e;
+$fa-var-band-aid: \f462;
+$fa-var-bandcamp: \f2d5;
+$fa-var-barcode: \f02a;
+$fa-var-bars: \f0c9;
+$fa-var-baseball-ball: \f433;
+$fa-var-basketball-ball: \f434;
+$fa-var-bath: \f2cd;
+$fa-var-battery-empty: \f244;
+$fa-var-battery-full: \f240;
+$fa-var-battery-half: \f242;
+$fa-var-battery-quarter: \f243;
+$fa-var-battery-three-quarters: \f241;
+$fa-var-battle-net: \f835;
+$fa-var-bed: \f236;
+$fa-var-beer: \f0fc;
+$fa-var-behance: \f1b4;
+$fa-var-behance-square: \f1b5;
+$fa-var-bell: \f0f3;
+$fa-var-bell-slash: \f1f6;
+$fa-var-bezier-curve: \f55b;
+$fa-var-bible: \f647;
+$fa-var-bicycle: \f206;
+$fa-var-biking: \f84a;
+$fa-var-bimobject: \f378;
+$fa-var-binoculars: \f1e5;
+$fa-var-biohazard: \f780;
+$fa-var-birthday-cake: \f1fd;
+$fa-var-bitbucket: \f171;
+$fa-var-bitcoin: \f379;
+$fa-var-bity: \f37a;
+$fa-var-black-tie: \f27e;
+$fa-var-blackberry: \f37b;
+$fa-var-blender: \f517;
+$fa-var-blender-phone: \f6b6;
+$fa-var-blind: \f29d;
+$fa-var-blog: \f781;
+$fa-var-blogger: \f37c;
+$fa-var-blogger-b: \f37d;
+$fa-var-bluetooth: \f293;
+$fa-var-bluetooth-b: \f294;
+$fa-var-bold: \f032;
+$fa-var-bolt: \f0e7;
+$fa-var-bomb: \f1e2;
+$fa-var-bone: \f5d7;
+$fa-var-bong: \f55c;
+$fa-var-book: \f02d;
+$fa-var-book-dead: \f6b7;
+$fa-var-book-medical: \f7e6;
+$fa-var-book-open: \f518;
+$fa-var-book-reader: \f5da;
+$fa-var-bookmark: \f02e;
+$fa-var-bootstrap: \f836;
+$fa-var-border-all: \f84c;
+$fa-var-border-none: \f850;
+$fa-var-border-style: \f853;
+$fa-var-bowling-ball: \f436;
+$fa-var-box: \f466;
+$fa-var-box-open: \f49e;
+$fa-var-boxes: \f468;
+$fa-var-braille: \f2a1;
+$fa-var-brain: \f5dc;
+$fa-var-bread-slice: \f7ec;
+$fa-var-briefcase: \f0b1;
+$fa-var-briefcase-medical: \f469;
+$fa-var-broadcast-tower: \f519;
+$fa-var-broom: \f51a;
+$fa-var-brush: \f55d;
+$fa-var-btc: \f15a;
+$fa-var-buffer: \f837;
+$fa-var-bug: \f188;
+$fa-var-building: \f1ad;
+$fa-var-bullhorn: \f0a1;
+$fa-var-bullseye: \f140;
+$fa-var-burn: \f46a;
+$fa-var-buromobelexperte: \f37f;
+$fa-var-bus: \f207;
+$fa-var-bus-alt: \f55e;
+$fa-var-business-time: \f64a;
+$fa-var-buy-n-large: \f8a6;
+$fa-var-buysellads: \f20d;
+$fa-var-calculator: \f1ec;
+$fa-var-calendar: \f133;
+$fa-var-calendar-alt: \f073;
+$fa-var-calendar-check: \f274;
+$fa-var-calendar-day: \f783;
+$fa-var-calendar-minus: \f272;
+$fa-var-calendar-plus: \f271;
+$fa-var-calendar-times: \f273;
+$fa-var-calendar-week: \f784;
+$fa-var-camera: \f030;
+$fa-var-camera-retro: \f083;
+$fa-var-campground: \f6bb;
+$fa-var-canadian-maple-leaf: \f785;
+$fa-var-candy-cane: \f786;
+$fa-var-cannabis: \f55f;
+$fa-var-capsules: \f46b;
+$fa-var-car: \f1b9;
+$fa-var-car-alt: \f5de;
+$fa-var-car-battery: \f5df;
+$fa-var-car-crash: \f5e1;
+$fa-var-car-side: \f5e4;
+$fa-var-caret-down: \f0d7;
+$fa-var-caret-left: \f0d9;
+$fa-var-caret-right: \f0da;
+$fa-var-caret-square-down: \f150;
+$fa-var-caret-square-left: \f191;
+$fa-var-caret-square-right: \f152;
+$fa-var-caret-square-up: \f151;
+$fa-var-caret-up: \f0d8;
+$fa-var-carrot: \f787;
+$fa-var-cart-arrow-down: \f218;
+$fa-var-cart-plus: \f217;
+$fa-var-cash-register: \f788;
+$fa-var-cat: \f6be;
+$fa-var-cc-amazon-pay: \f42d;
+$fa-var-cc-amex: \f1f3;
+$fa-var-cc-apple-pay: \f416;
+$fa-var-cc-diners-club: \f24c;
+$fa-var-cc-discover: \f1f2;
+$fa-var-cc-jcb: \f24b;
+$fa-var-cc-mastercard: \f1f1;
+$fa-var-cc-paypal: \f1f4;
+$fa-var-cc-stripe: \f1f5;
+$fa-var-cc-visa: \f1f0;
+$fa-var-centercode: \f380;
+$fa-var-centos: \f789;
+$fa-var-certificate: \f0a3;
+$fa-var-chair: \f6c0;
+$fa-var-chalkboard: \f51b;
+$fa-var-chalkboard-teacher: \f51c;
+$fa-var-charging-station: \f5e7;
+$fa-var-chart-area: \f1fe;
+$fa-var-chart-bar: \f080;
+$fa-var-chart-line: \f201;
+$fa-var-chart-pie: \f200;
+$fa-var-check: \f00c;
+$fa-var-check-circle: \f058;
+$fa-var-check-double: \f560;
+$fa-var-check-square: \f14a;
+$fa-var-cheese: \f7ef;
+$fa-var-chess: \f439;
+$fa-var-chess-bishop: \f43a;
+$fa-var-chess-board: \f43c;
+$fa-var-chess-king: \f43f;
+$fa-var-chess-knight: \f441;
+$fa-var-chess-pawn: \f443;
+$fa-var-chess-queen: \f445;
+$fa-var-chess-rook: \f447;
+$fa-var-chevron-circle-down: \f13a;
+$fa-var-chevron-circle-left: \f137;
+$fa-var-chevron-circle-right: \f138;
+$fa-var-chevron-circle-up: \f139;
+$fa-var-chevron-down: \f078;
+$fa-var-chevron-left: \f053;
+$fa-var-chevron-right: \f054;
+$fa-var-chevron-up: \f077;
+$fa-var-child: \f1ae;
+$fa-var-chrome: \f268;
+$fa-var-chromecast: \f838;
+$fa-var-church: \f51d;
+$fa-var-circle: \f111;
+$fa-var-circle-notch: \f1ce;
+$fa-var-city: \f64f;
+$fa-var-clinic-medical: \f7f2;
+$fa-var-clipboard: \f328;
+$fa-var-clipboard-check: \f46c;
+$fa-var-clipboard-list: \f46d;
+$fa-var-clock: \f017;
+$fa-var-clone: \f24d;
+$fa-var-closed-captioning: \f20a;
+$fa-var-cloud: \f0c2;
+$fa-var-cloud-download-alt: \f381;
+$fa-var-cloud-meatball: \f73b;
+$fa-var-cloud-moon: \f6c3;
+$fa-var-cloud-moon-rain: \f73c;
+$fa-var-cloud-rain: \f73d;
+$fa-var-cloud-showers-heavy: \f740;
+$fa-var-cloud-sun: \f6c4;
+$fa-var-cloud-sun-rain: \f743;
+$fa-var-cloud-upload-alt: \f382;
+$fa-var-cloudscale: \f383;
+$fa-var-cloudsmith: \f384;
+$fa-var-cloudversify: \f385;
+$fa-var-cocktail: \f561;
+$fa-var-code: \f121;
+$fa-var-code-branch: \f126;
+$fa-var-codepen: \f1cb;
+$fa-var-codiepie: \f284;
+$fa-var-coffee: \f0f4;
+$fa-var-cog: \f013;
+$fa-var-cogs: \f085;
+$fa-var-coins: \f51e;
+$fa-var-columns: \f0db;
+$fa-var-comment: \f075;
+$fa-var-comment-alt: \f27a;
+$fa-var-comment-dollar: \f651;
+$fa-var-comment-dots: \f4ad;
+$fa-var-comment-medical: \f7f5;
+$fa-var-comment-slash: \f4b3;
+$fa-var-comments: \f086;
+$fa-var-comments-dollar: \f653;
+$fa-var-compact-disc: \f51f;
+$fa-var-compass: \f14e;
+$fa-var-compress: \f066;
+$fa-var-compress-arrows-alt: \f78c;
+$fa-var-concierge-bell: \f562;
+$fa-var-confluence: \f78d;
+$fa-var-connectdevelop: \f20e;
+$fa-var-contao: \f26d;
+$fa-var-cookie: \f563;
+$fa-var-cookie-bite: \f564;
+$fa-var-copy: \f0c5;
+$fa-var-copyright: \f1f9;
+$fa-var-cotton-bureau: \f89e;
+$fa-var-couch: \f4b8;
+$fa-var-cpanel: \f388;
+$fa-var-creative-commons: \f25e;
+$fa-var-creative-commons-by: \f4e7;
+$fa-var-creative-commons-nc: \f4e8;
+$fa-var-creative-commons-nc-eu: \f4e9;
+$fa-var-creative-commons-nc-jp: \f4ea;
+$fa-var-creative-commons-nd: \f4eb;
+$fa-var-creative-commons-pd: \f4ec;
+$fa-var-creative-commons-pd-alt: \f4ed;
+$fa-var-creative-commons-remix: \f4ee;
+$fa-var-creative-commons-sa: \f4ef;
+$fa-var-creative-commons-sampling: \f4f0;
+$fa-var-creative-commons-sampling-plus: \f4f1;
+$fa-var-creative-commons-share: \f4f2;
+$fa-var-creative-commons-zero: \f4f3;
+$fa-var-credit-card: \f09d;
+$fa-var-critical-role: \f6c9;
+$fa-var-crop: \f125;
+$fa-var-crop-alt: \f565;
+$fa-var-cross: \f654;
+$fa-var-crosshairs: \f05b;
+$fa-var-crow: \f520;
+$fa-var-crown: \f521;
+$fa-var-crutch: \f7f7;
+$fa-var-css3: \f13c;
+$fa-var-css3-alt: \f38b;
+$fa-var-cube: \f1b2;
+$fa-var-cubes: \f1b3;
+$fa-var-cut: \f0c4;
+$fa-var-cuttlefish: \f38c;
+$fa-var-d-and-d: \f38d;
+$fa-var-d-and-d-beyond: \f6ca;
+$fa-var-dashcube: \f210;
+$fa-var-database: \f1c0;
+$fa-var-deaf: \f2a4;
+$fa-var-delicious: \f1a5;
+$fa-var-democrat: \f747;
+$fa-var-deploydog: \f38e;
+$fa-var-deskpro: \f38f;
+$fa-var-desktop: \f108;
+$fa-var-dev: \f6cc;
+$fa-var-deviantart: \f1bd;
+$fa-var-dharmachakra: \f655;
+$fa-var-dhl: \f790;
+$fa-var-diagnoses: \f470;
+$fa-var-diaspora: \f791;
+$fa-var-dice: \f522;
+$fa-var-dice-d20: \f6cf;
+$fa-var-dice-d6: \f6d1;
+$fa-var-dice-five: \f523;
+$fa-var-dice-four: \f524;
+$fa-var-dice-one: \f525;
+$fa-var-dice-six: \f526;
+$fa-var-dice-three: \f527;
+$fa-var-dice-two: \f528;
+$fa-var-digg: \f1a6;
+$fa-var-digital-ocean: \f391;
+$fa-var-digital-tachograph: \f566;
+$fa-var-directions: \f5eb;
+$fa-var-discord: \f392;
+$fa-var-discourse: \f393;
+$fa-var-divide: \f529;
+$fa-var-dizzy: \f567;
+$fa-var-dna: \f471;
+$fa-var-dochub: \f394;
+$fa-var-docker: \f395;
+$fa-var-dog: \f6d3;
+$fa-var-dollar-sign: \f155;
+$fa-var-dolly: \f472;
+$fa-var-dolly-flatbed: \f474;
+$fa-var-donate: \f4b9;
+$fa-var-door-closed: \f52a;
+$fa-var-door-open: \f52b;
+$fa-var-dot-circle: \f192;
+$fa-var-dove: \f4ba;
+$fa-var-download: \f019;
+$fa-var-draft2digital: \f396;
+$fa-var-drafting-compass: \f568;
+$fa-var-dragon: \f6d5;
+$fa-var-draw-polygon: \f5ee;
+$fa-var-dribbble: \f17d;
+$fa-var-dribbble-square: \f397;
+$fa-var-dropbox: \f16b;
+$fa-var-drum: \f569;
+$fa-var-drum-steelpan: \f56a;
+$fa-var-drumstick-bite: \f6d7;
+$fa-var-drupal: \f1a9;
+$fa-var-dumbbell: \f44b;
+$fa-var-dumpster: \f793;
+$fa-var-dumpster-fire: \f794;
+$fa-var-dungeon: \f6d9;
+$fa-var-dyalog: \f399;
+$fa-var-earlybirds: \f39a;
+$fa-var-ebay: \f4f4;
+$fa-var-edge: \f282;
+$fa-var-edit: \f044;
+$fa-var-egg: \f7fb;
+$fa-var-eject: \f052;
+$fa-var-elementor: \f430;
+$fa-var-ellipsis-h: \f141;
+$fa-var-ellipsis-v: \f142;
+$fa-var-ello: \f5f1;
+$fa-var-ember: \f423;
+$fa-var-empire: \f1d1;
+$fa-var-envelope: \f0e0;
+$fa-var-envelope-open: \f2b6;
+$fa-var-envelope-open-text: \f658;
+$fa-var-envelope-square: \f199;
+$fa-var-envira: \f299;
+$fa-var-equals: \f52c;
+$fa-var-eraser: \f12d;
+$fa-var-erlang: \f39d;
+$fa-var-ethereum: \f42e;
+$fa-var-ethernet: \f796;
+$fa-var-etsy: \f2d7;
+$fa-var-euro-sign: \f153;
+$fa-var-evernote: \f839;
+$fa-var-exchange-alt: \f362;
+$fa-var-exclamation: \f12a;
+$fa-var-exclamation-circle: \f06a;
+$fa-var-exclamation-triangle: \f071;
+$fa-var-expand: \f065;
+$fa-var-expand-arrows-alt: \f31e;
+$fa-var-expeditedssl: \f23e;
+$fa-var-external-link-alt: \f35d;
+$fa-var-external-link-square-alt: \f360;
+$fa-var-eye: \f06e;
+$fa-var-eye-dropper: \f1fb;
+$fa-var-eye-slash: \f070;
+$fa-var-facebook: \f09a;
+$fa-var-facebook-f: \f39e;
+$fa-var-facebook-messenger: \f39f;
+$fa-var-facebook-square: \f082;
+$fa-var-fan: \f863;
+$fa-var-fantasy-flight-games: \f6dc;
+$fa-var-fast-backward: \f049;
+$fa-var-fast-forward: \f050;
+$fa-var-fax: \f1ac;
+$fa-var-feather: \f52d;
+$fa-var-feather-alt: \f56b;
+$fa-var-fedex: \f797;
+$fa-var-fedora: \f798;
+$fa-var-female: \f182;
+$fa-var-fighter-jet: \f0fb;
+$fa-var-figma: \f799;
+$fa-var-file: \f15b;
+$fa-var-file-alt: \f15c;
+$fa-var-file-archive: \f1c6;
+$fa-var-file-audio: \f1c7;
+$fa-var-file-code: \f1c9;
+$fa-var-file-contract: \f56c;
+$fa-var-file-csv: \f6dd;
+$fa-var-file-download: \f56d;
+$fa-var-file-excel: \f1c3;
+$fa-var-file-export: \f56e;
+$fa-var-file-image: \f1c5;
+$fa-var-file-import: \f56f;
+$fa-var-file-invoice: \f570;
+$fa-var-file-invoice-dollar: \f571;
+$fa-var-file-medical: \f477;
+$fa-var-file-medical-alt: \f478;
+$fa-var-file-pdf: \f1c1;
+$fa-var-file-powerpoint: \f1c4;
+$fa-var-file-prescription: \f572;
+$fa-var-file-signature: \f573;
+$fa-var-file-upload: \f574;
+$fa-var-file-video: \f1c8;
+$fa-var-file-word: \f1c2;
+$fa-var-fill: \f575;
+$fa-var-fill-drip: \f576;
+$fa-var-film: \f008;
+$fa-var-filter: \f0b0;
+$fa-var-fingerprint: \f577;
+$fa-var-fire: \f06d;
+$fa-var-fire-alt: \f7e4;
+$fa-var-fire-extinguisher: \f134;
+$fa-var-firefox: \f269;
+$fa-var-first-aid: \f479;
+$fa-var-first-order: \f2b0;
+$fa-var-first-order-alt: \f50a;
+$fa-var-firstdraft: \f3a1;
+$fa-var-fish: \f578;
+$fa-var-fist-raised: \f6de;
+$fa-var-flag: \f024;
+$fa-var-flag-checkered: \f11e;
+$fa-var-flag-usa: \f74d;
+$fa-var-flask: \f0c3;
+$fa-var-flickr: \f16e;
+$fa-var-flipboard: \f44d;
+$fa-var-flushed: \f579;
+$fa-var-fly: \f417;
+$fa-var-folder: \f07b;
+$fa-var-folder-minus: \f65d;
+$fa-var-folder-open: \f07c;
+$fa-var-folder-plus: \f65e;
+$fa-var-font: \f031;
+$fa-var-font-awesome: \f2b4;
+$fa-var-font-awesome-alt: \f35c;
+$fa-var-font-awesome-flag: \f425;
+$fa-var-font-awesome-logo-full: \f4e6;
+$fa-var-fonticons: \f280;
+$fa-var-fonticons-fi: \f3a2;
+$fa-var-football-ball: \f44e;
+$fa-var-fort-awesome: \f286;
+$fa-var-fort-awesome-alt: \f3a3;
+$fa-var-forumbee: \f211;
+$fa-var-forward: \f04e;
+$fa-var-foursquare: \f180;
+$fa-var-free-code-camp: \f2c5;
+$fa-var-freebsd: \f3a4;
+$fa-var-frog: \f52e;
+$fa-var-frown: \f119;
+$fa-var-frown-open: \f57a;
+$fa-var-fulcrum: \f50b;
+$fa-var-funnel-dollar: \f662;
+$fa-var-futbol: \f1e3;
+$fa-var-galactic-republic: \f50c;
+$fa-var-galactic-senate: \f50d;
+$fa-var-gamepad: \f11b;
+$fa-var-gas-pump: \f52f;
+$fa-var-gavel: \f0e3;
+$fa-var-gem: \f3a5;
+$fa-var-genderless: \f22d;
+$fa-var-get-pocket: \f265;
+$fa-var-gg: \f260;
+$fa-var-gg-circle: \f261;
+$fa-var-ghost: \f6e2;
+$fa-var-gift: \f06b;
+$fa-var-gifts: \f79c;
+$fa-var-git: \f1d3;
+$fa-var-git-alt: \f841;
+$fa-var-git-square: \f1d2;
+$fa-var-github: \f09b;
+$fa-var-github-alt: \f113;
+$fa-var-github-square: \f092;
+$fa-var-gitkraken: \f3a6;
+$fa-var-gitlab: \f296;
+$fa-var-gitter: \f426;
+$fa-var-glass-cheers: \f79f;
+$fa-var-glass-martini: \f000;
+$fa-var-glass-martini-alt: \f57b;
+$fa-var-glass-whiskey: \f7a0;
+$fa-var-glasses: \f530;
+$fa-var-glide: \f2a5;
+$fa-var-glide-g: \f2a6;
+$fa-var-globe: \f0ac;
+$fa-var-globe-africa: \f57c;
+$fa-var-globe-americas: \f57d;
+$fa-var-globe-asia: \f57e;
+$fa-var-globe-europe: \f7a2;
+$fa-var-gofore: \f3a7;
+$fa-var-golf-ball: \f450;
+$fa-var-goodreads: \f3a8;
+$fa-var-goodreads-g: \f3a9;
+$fa-var-google: \f1a0;
+$fa-var-google-drive: \f3aa;
+$fa-var-google-play: \f3ab;
+$fa-var-google-plus: \f2b3;
+$fa-var-google-plus-g: \f0d5;
+$fa-var-google-plus-square: \f0d4;
+$fa-var-google-wallet: \f1ee;
+$fa-var-gopuram: \f664;
+$fa-var-graduation-cap: \f19d;
+$fa-var-gratipay: \f184;
+$fa-var-grav: \f2d6;
+$fa-var-greater-than: \f531;
+$fa-var-greater-than-equal: \f532;
+$fa-var-grimace: \f57f;
+$fa-var-grin: \f580;
+$fa-var-grin-alt: \f581;
+$fa-var-grin-beam: \f582;
+$fa-var-grin-beam-sweat: \f583;
+$fa-var-grin-hearts: \f584;
+$fa-var-grin-squint: \f585;
+$fa-var-grin-squint-tears: \f586;
+$fa-var-grin-stars: \f587;
+$fa-var-grin-tears: \f588;
+$fa-var-grin-tongue: \f589;
+$fa-var-grin-tongue-squint: \f58a;
+$fa-var-grin-tongue-wink: \f58b;
+$fa-var-grin-wink: \f58c;
+$fa-var-grip-horizontal: \f58d;
+$fa-var-grip-lines: \f7a4;
+$fa-var-grip-lines-vertical: \f7a5;
+$fa-var-grip-vertical: \f58e;
+$fa-var-gripfire: \f3ac;
+$fa-var-grunt: \f3ad;
+$fa-var-guitar: \f7a6;
+$fa-var-gulp: \f3ae;
+$fa-var-h-square: \f0fd;
+$fa-var-hacker-news: \f1d4;
+$fa-var-hacker-news-square: \f3af;
+$fa-var-hackerrank: \f5f7;
+$fa-var-hamburger: \f805;
+$fa-var-hammer: \f6e3;
+$fa-var-hamsa: \f665;
+$fa-var-hand-holding: \f4bd;
+$fa-var-hand-holding-heart: \f4be;
+$fa-var-hand-holding-usd: \f4c0;
+$fa-var-hand-lizard: \f258;
+$fa-var-hand-middle-finger: \f806;
+$fa-var-hand-paper: \f256;
+$fa-var-hand-peace: \f25b;
+$fa-var-hand-point-down: \f0a7;
+$fa-var-hand-point-left: \f0a5;
+$fa-var-hand-point-right: \f0a4;
+$fa-var-hand-point-up: \f0a6;
+$fa-var-hand-pointer: \f25a;
+$fa-var-hand-rock: \f255;
+$fa-var-hand-scissors: \f257;
+$fa-var-hand-spock: \f259;
+$fa-var-hands: \f4c2;
+$fa-var-hands-helping: \f4c4;
+$fa-var-handshake: \f2b5;
+$fa-var-hanukiah: \f6e6;
+$fa-var-hard-hat: \f807;
+$fa-var-hashtag: \f292;
+$fa-var-hat-cowboy: \f8c0;
+$fa-var-hat-cowboy-side: \f8c1;
+$fa-var-hat-wizard: \f6e8;
+$fa-var-haykal: \f666;
+$fa-var-hdd: \f0a0;
+$fa-var-heading: \f1dc;
+$fa-var-headphones: \f025;
+$fa-var-headphones-alt: \f58f;
+$fa-var-headset: \f590;
+$fa-var-heart: \f004;
+$fa-var-heart-broken: \f7a9;
+$fa-var-heartbeat: \f21e;
+$fa-var-helicopter: \f533;
+$fa-var-highlighter: \f591;
+$fa-var-hiking: \f6ec;
+$fa-var-hippo: \f6ed;
+$fa-var-hips: \f452;
+$fa-var-hire-a-helper: \f3b0;
+$fa-var-history: \f1da;
+$fa-var-hockey-puck: \f453;
+$fa-var-holly-berry: \f7aa;
+$fa-var-home: \f015;
+$fa-var-hooli: \f427;
+$fa-var-hornbill: \f592;
+$fa-var-horse: \f6f0;
+$fa-var-horse-head: \f7ab;
+$fa-var-hospital: \f0f8;
+$fa-var-hospital-alt: \f47d;
+$fa-var-hospital-symbol: \f47e;
+$fa-var-hot-tub: \f593;
+$fa-var-hotdog: \f80f;
+$fa-var-hotel: \f594;
+$fa-var-hotjar: \f3b1;
+$fa-var-hourglass: \f254;
+$fa-var-hourglass-end: \f253;
+$fa-var-hourglass-half: \f252;
+$fa-var-hourglass-start: \f251;
+$fa-var-house-damage: \f6f1;
+$fa-var-houzz: \f27c;
+$fa-var-hryvnia: \f6f2;
+$fa-var-html5: \f13b;
+$fa-var-hubspot: \f3b2;
+$fa-var-i-cursor: \f246;
+$fa-var-ice-cream: \f810;
+$fa-var-icicles: \f7ad;
+$fa-var-icons: \f86d;
+$fa-var-id-badge: \f2c1;
+$fa-var-id-card: \f2c2;
+$fa-var-id-card-alt: \f47f;
+$fa-var-igloo: \f7ae;
+$fa-var-image: \f03e;
+$fa-var-images: \f302;
+$fa-var-imdb: \f2d8;
+$fa-var-inbox: \f01c;
+$fa-var-indent: \f03c;
+$fa-var-industry: \f275;
+$fa-var-infinity: \f534;
+$fa-var-info: \f129;
+$fa-var-info-circle: \f05a;
+$fa-var-instagram: \f16d;
+$fa-var-intercom: \f7af;
+$fa-var-internet-explorer: \f26b;
+$fa-var-invision: \f7b0;
+$fa-var-ioxhost: \f208;
+$fa-var-italic: \f033;
+$fa-var-itch-io: \f83a;
+$fa-var-itunes: \f3b4;
+$fa-var-itunes-note: \f3b5;
+$fa-var-java: \f4e4;
+$fa-var-jedi: \f669;
+$fa-var-jedi-order: \f50e;
+$fa-var-jenkins: \f3b6;
+$fa-var-jira: \f7b1;
+$fa-var-joget: \f3b7;
+$fa-var-joint: \f595;
+$fa-var-joomla: \f1aa;
+$fa-var-journal-whills: \f66a;
+$fa-var-js: \f3b8;
+$fa-var-js-square: \f3b9;
+$fa-var-jsfiddle: \f1cc;
+$fa-var-kaaba: \f66b;
+$fa-var-kaggle: \f5fa;
+$fa-var-key: \f084;
+$fa-var-keybase: \f4f5;
+$fa-var-keyboard: \f11c;
+$fa-var-keycdn: \f3ba;
+$fa-var-khanda: \f66d;
+$fa-var-kickstarter: \f3bb;
+$fa-var-kickstarter-k: \f3bc;
+$fa-var-kiss: \f596;
+$fa-var-kiss-beam: \f597;
+$fa-var-kiss-wink-heart: \f598;
+$fa-var-kiwi-bird: \f535;
+$fa-var-korvue: \f42f;
+$fa-var-landmark: \f66f;
+$fa-var-language: \f1ab;
+$fa-var-laptop: \f109;
+$fa-var-laptop-code: \f5fc;
+$fa-var-laptop-medical: \f812;
+$fa-var-laravel: \f3bd;
+$fa-var-lastfm: \f202;
+$fa-var-lastfm-square: \f203;
+$fa-var-laugh: \f599;
+$fa-var-laugh-beam: \f59a;
+$fa-var-laugh-squint: \f59b;
+$fa-var-laugh-wink: \f59c;
+$fa-var-layer-group: \f5fd;
+$fa-var-leaf: \f06c;
+$fa-var-leanpub: \f212;
+$fa-var-lemon: \f094;
+$fa-var-less: \f41d;
+$fa-var-less-than: \f536;
+$fa-var-less-than-equal: \f537;
+$fa-var-level-down-alt: \f3be;
+$fa-var-level-up-alt: \f3bf;
+$fa-var-life-ring: \f1cd;
+$fa-var-lightbulb: \f0eb;
+$fa-var-line: \f3c0;
+$fa-var-link: \f0c1;
+$fa-var-linkedin: \f08c;
+$fa-var-linkedin-in: \f0e1;
+$fa-var-linode: \f2b8;
+$fa-var-linux: \f17c;
+$fa-var-lira-sign: \f195;
+$fa-var-list: \f03a;
+$fa-var-list-alt: \f022;
+$fa-var-list-ol: \f0cb;
+$fa-var-list-ul: \f0ca;
+$fa-var-location-arrow: \f124;
+$fa-var-lock: \f023;
+$fa-var-lock-open: \f3c1;
+$fa-var-long-arrow-alt-down: \f309;
+$fa-var-long-arrow-alt-left: \f30a;
+$fa-var-long-arrow-alt-right: \f30b;
+$fa-var-long-arrow-alt-up: \f30c;
+$fa-var-low-vision: \f2a8;
+$fa-var-luggage-cart: \f59d;
+$fa-var-lyft: \f3c3;
+$fa-var-magento: \f3c4;
+$fa-var-magic: \f0d0;
+$fa-var-magnet: \f076;
+$fa-var-mail-bulk: \f674;
+$fa-var-mailchimp: \f59e;
+$fa-var-male: \f183;
+$fa-var-mandalorian: \f50f;
+$fa-var-map: \f279;
+$fa-var-map-marked: \f59f;
+$fa-var-map-marked-alt: \f5a0;
+$fa-var-map-marker: \f041;
+$fa-var-map-marker-alt: \f3c5;
+$fa-var-map-pin: \f276;
+$fa-var-map-signs: \f277;
+$fa-var-markdown: \f60f;
+$fa-var-marker: \f5a1;
+$fa-var-mars: \f222;
+$fa-var-mars-double: \f227;
+$fa-var-mars-stroke: \f229;
+$fa-var-mars-stroke-h: \f22b;
+$fa-var-mars-stroke-v: \f22a;
+$fa-var-mask: \f6fa;
+$fa-var-mastodon: \f4f6;
+$fa-var-maxcdn: \f136;
+$fa-var-mdb: \f8ca;
+$fa-var-medal: \f5a2;
+$fa-var-medapps: \f3c6;
+$fa-var-medium: \f23a;
+$fa-var-medium-m: \f3c7;
+$fa-var-medkit: \f0fa;
+$fa-var-medrt: \f3c8;
+$fa-var-meetup: \f2e0;
+$fa-var-megaport: \f5a3;
+$fa-var-meh: \f11a;
+$fa-var-meh-blank: \f5a4;
+$fa-var-meh-rolling-eyes: \f5a5;
+$fa-var-memory: \f538;
+$fa-var-mendeley: \f7b3;
+$fa-var-menorah: \f676;
+$fa-var-mercury: \f223;
+$fa-var-meteor: \f753;
+$fa-var-microchip: \f2db;
+$fa-var-microphone: \f130;
+$fa-var-microphone-alt: \f3c9;
+$fa-var-microphone-alt-slash: \f539;
+$fa-var-microphone-slash: \f131;
+$fa-var-microscope: \f610;
+$fa-var-microsoft: \f3ca;
+$fa-var-minus: \f068;
+$fa-var-minus-circle: \f056;
+$fa-var-minus-square: \f146;
+$fa-var-mitten: \f7b5;
+$fa-var-mix: \f3cb;
+$fa-var-mixcloud: \f289;
+$fa-var-mizuni: \f3cc;
+$fa-var-mobile: \f10b;
+$fa-var-mobile-alt: \f3cd;
+$fa-var-modx: \f285;
+$fa-var-monero: \f3d0;
+$fa-var-money-bill: \f0d6;
+$fa-var-money-bill-alt: \f3d1;
+$fa-var-money-bill-wave: \f53a;
+$fa-var-money-bill-wave-alt: \f53b;
+$fa-var-money-check: \f53c;
+$fa-var-money-check-alt: \f53d;
+$fa-var-monument: \f5a6;
+$fa-var-moon: \f186;
+$fa-var-mortar-pestle: \f5a7;
+$fa-var-mosque: \f678;
+$fa-var-motorcycle: \f21c;
+$fa-var-mountain: \f6fc;
+$fa-var-mouse: \f8cc;
+$fa-var-mouse-pointer: \f245;
+$fa-var-mug-hot: \f7b6;
+$fa-var-music: \f001;
+$fa-var-napster: \f3d2;
+$fa-var-neos: \f612;
+$fa-var-network-wired: \f6ff;
+$fa-var-neuter: \f22c;
+$fa-var-newspaper: \f1ea;
+$fa-var-nimblr: \f5a8;
+$fa-var-node: \f419;
+$fa-var-node-js: \f3d3;
+$fa-var-not-equal: \f53e;
+$fa-var-notes-medical: \f481;
+$fa-var-npm: \f3d4;
+$fa-var-ns8: \f3d5;
+$fa-var-nutritionix: \f3d6;
+$fa-var-object-group: \f247;
+$fa-var-object-ungroup: \f248;
+$fa-var-odnoklassniki: \f263;
+$fa-var-odnoklassniki-square: \f264;
+$fa-var-oil-can: \f613;
+$fa-var-old-republic: \f510;
+$fa-var-om: \f679;
+$fa-var-opencart: \f23d;
+$fa-var-openid: \f19b;
+$fa-var-opera: \f26a;
+$fa-var-optin-monster: \f23c;
+$fa-var-orcid: \f8d2;
+$fa-var-osi: \f41a;
+$fa-var-otter: \f700;
+$fa-var-outdent: \f03b;
+$fa-var-page4: \f3d7;
+$fa-var-pagelines: \f18c;
+$fa-var-pager: \f815;
+$fa-var-paint-brush: \f1fc;
+$fa-var-paint-roller: \f5aa;
+$fa-var-palette: \f53f;
+$fa-var-palfed: \f3d8;
+$fa-var-pallet: \f482;
+$fa-var-paper-plane: \f1d8;
+$fa-var-paperclip: \f0c6;
+$fa-var-parachute-box: \f4cd;
+$fa-var-paragraph: \f1dd;
+$fa-var-parking: \f540;
+$fa-var-passport: \f5ab;
+$fa-var-pastafarianism: \f67b;
+$fa-var-paste: \f0ea;
+$fa-var-patreon: \f3d9;
+$fa-var-pause: \f04c;
+$fa-var-pause-circle: \f28b;
+$fa-var-paw: \f1b0;
+$fa-var-paypal: \f1ed;
+$fa-var-peace: \f67c;
+$fa-var-pen: \f304;
+$fa-var-pen-alt: \f305;
+$fa-var-pen-fancy: \f5ac;
+$fa-var-pen-nib: \f5ad;
+$fa-var-pen-square: \f14b;
+$fa-var-pencil-alt: \f303;
+$fa-var-pencil-ruler: \f5ae;
+$fa-var-penny-arcade: \f704;
+$fa-var-people-carry: \f4ce;
+$fa-var-pepper-hot: \f816;
+$fa-var-percent: \f295;
+$fa-var-percentage: \f541;
+$fa-var-periscope: \f3da;
+$fa-var-person-booth: \f756;
+$fa-var-phabricator: \f3db;
+$fa-var-phoenix-framework: \f3dc;
+$fa-var-phoenix-squadron: \f511;
+$fa-var-phone: \f095;
+$fa-var-phone-alt: \f879;
+$fa-var-phone-slash: \f3dd;
+$fa-var-phone-square: \f098;
+$fa-var-phone-square-alt: \f87b;
+$fa-var-phone-volume: \f2a0;
+$fa-var-photo-video: \f87c;
+$fa-var-php: \f457;
+$fa-var-pied-piper: \f2ae;
+$fa-var-pied-piper-alt: \f1a8;
+$fa-var-pied-piper-hat: \f4e5;
+$fa-var-pied-piper-pp: \f1a7;
+$fa-var-piggy-bank: \f4d3;
+$fa-var-pills: \f484;
+$fa-var-pinterest: \f0d2;
+$fa-var-pinterest-p: \f231;
+$fa-var-pinterest-square: \f0d3;
+$fa-var-pizza-slice: \f818;
+$fa-var-place-of-worship: \f67f;
+$fa-var-plane: \f072;
+$fa-var-plane-arrival: \f5af;
+$fa-var-plane-departure: \f5b0;
+$fa-var-play: \f04b;
+$fa-var-play-circle: \f144;
+$fa-var-playstation: \f3df;
+$fa-var-plug: \f1e6;
+$fa-var-plus: \f067;
+$fa-var-plus-circle: \f055;
+$fa-var-plus-square: \f0fe;
+$fa-var-podcast: \f2ce;
+$fa-var-poll: \f681;
+$fa-var-poll-h: \f682;
+$fa-var-poo: \f2fe;
+$fa-var-poo-storm: \f75a;
+$fa-var-poop: \f619;
+$fa-var-portrait: \f3e0;
+$fa-var-pound-sign: \f154;
+$fa-var-power-off: \f011;
+$fa-var-pray: \f683;
+$fa-var-praying-hands: \f684;
+$fa-var-prescription: \f5b1;
+$fa-var-prescription-bottle: \f485;
+$fa-var-prescription-bottle-alt: \f486;
+$fa-var-print: \f02f;
+$fa-var-procedures: \f487;
+$fa-var-product-hunt: \f288;
+$fa-var-project-diagram: \f542;
+$fa-var-pushed: \f3e1;
+$fa-var-puzzle-piece: \f12e;
+$fa-var-python: \f3e2;
+$fa-var-qq: \f1d6;
+$fa-var-qrcode: \f029;
+$fa-var-question: \f128;
+$fa-var-question-circle: \f059;
+$fa-var-quidditch: \f458;
+$fa-var-quinscape: \f459;
+$fa-var-quora: \f2c4;
+$fa-var-quote-left: \f10d;
+$fa-var-quote-right: \f10e;
+$fa-var-quran: \f687;
+$fa-var-r-project: \f4f7;
+$fa-var-radiation: \f7b9;
+$fa-var-radiation-alt: \f7ba;
+$fa-var-rainbow: \f75b;
+$fa-var-random: \f074;
+$fa-var-raspberry-pi: \f7bb;
+$fa-var-ravelry: \f2d9;
+$fa-var-react: \f41b;
+$fa-var-reacteurope: \f75d;
+$fa-var-readme: \f4d5;
+$fa-var-rebel: \f1d0;
+$fa-var-receipt: \f543;
+$fa-var-record-vinyl: \f8d9;
+$fa-var-recycle: \f1b8;
+$fa-var-red-river: \f3e3;
+$fa-var-reddit: \f1a1;
+$fa-var-reddit-alien: \f281;
+$fa-var-reddit-square: \f1a2;
+$fa-var-redhat: \f7bc;
+$fa-var-redo: \f01e;
+$fa-var-redo-alt: \f2f9;
+$fa-var-registered: \f25d;
+$fa-var-remove-format: \f87d;
+$fa-var-renren: \f18b;
+$fa-var-reply: \f3e5;
+$fa-var-reply-all: \f122;
+$fa-var-replyd: \f3e6;
+$fa-var-republican: \f75e;
+$fa-var-researchgate: \f4f8;
+$fa-var-resolving: \f3e7;
+$fa-var-restroom: \f7bd;
+$fa-var-retweet: \f079;
+$fa-var-rev: \f5b2;
+$fa-var-ribbon: \f4d6;
+$fa-var-ring: \f70b;
+$fa-var-road: \f018;
+$fa-var-robot: \f544;
+$fa-var-rocket: \f135;
+$fa-var-rocketchat: \f3e8;
+$fa-var-rockrms: \f3e9;
+$fa-var-route: \f4d7;
+$fa-var-rss: \f09e;
+$fa-var-rss-square: \f143;
+$fa-var-ruble-sign: \f158;
+$fa-var-ruler: \f545;
+$fa-var-ruler-combined: \f546;
+$fa-var-ruler-horizontal: \f547;
+$fa-var-ruler-vertical: \f548;
+$fa-var-running: \f70c;
+$fa-var-rupee-sign: \f156;
+$fa-var-sad-cry: \f5b3;
+$fa-var-sad-tear: \f5b4;
+$fa-var-safari: \f267;
+$fa-var-salesforce: \f83b;
+$fa-var-sass: \f41e;
+$fa-var-satellite: \f7bf;
+$fa-var-satellite-dish: \f7c0;
+$fa-var-save: \f0c7;
+$fa-var-schlix: \f3ea;
+$fa-var-school: \f549;
+$fa-var-screwdriver: \f54a;
+$fa-var-scribd: \f28a;
+$fa-var-scroll: \f70e;
+$fa-var-sd-card: \f7c2;
+$fa-var-search: \f002;
+$fa-var-search-dollar: \f688;
+$fa-var-search-location: \f689;
+$fa-var-search-minus: \f010;
+$fa-var-search-plus: \f00e;
+$fa-var-searchengin: \f3eb;
+$fa-var-seedling: \f4d8;
+$fa-var-sellcast: \f2da;
+$fa-var-sellsy: \f213;
+$fa-var-server: \f233;
+$fa-var-servicestack: \f3ec;
+$fa-var-shapes: \f61f;
+$fa-var-share: \f064;
+$fa-var-share-alt: \f1e0;
+$fa-var-share-alt-square: \f1e1;
+$fa-var-share-square: \f14d;
+$fa-var-shekel-sign: \f20b;
+$fa-var-shield-alt: \f3ed;
+$fa-var-ship: \f21a;
+$fa-var-shipping-fast: \f48b;
+$fa-var-shirtsinbulk: \f214;
+$fa-var-shoe-prints: \f54b;
+$fa-var-shopping-bag: \f290;
+$fa-var-shopping-basket: \f291;
+$fa-var-shopping-cart: \f07a;
+$fa-var-shopware: \f5b5;
+$fa-var-shower: \f2cc;
+$fa-var-shuttle-van: \f5b6;
+$fa-var-sign: \f4d9;
+$fa-var-sign-in-alt: \f2f6;
+$fa-var-sign-language: \f2a7;
+$fa-var-sign-out-alt: \f2f5;
+$fa-var-signal: \f012;
+$fa-var-signature: \f5b7;
+$fa-var-sim-card: \f7c4;
+$fa-var-simplybuilt: \f215;
+$fa-var-sistrix: \f3ee;
+$fa-var-sitemap: \f0e8;
+$fa-var-sith: \f512;
+$fa-var-skating: \f7c5;
+$fa-var-sketch: \f7c6;
+$fa-var-skiing: \f7c9;
+$fa-var-skiing-nordic: \f7ca;
+$fa-var-skull: \f54c;
+$fa-var-skull-crossbones: \f714;
+$fa-var-skyatlas: \f216;
+$fa-var-skype: \f17e;
+$fa-var-slack: \f198;
+$fa-var-slack-hash: \f3ef;
+$fa-var-slash: \f715;
+$fa-var-sleigh: \f7cc;
+$fa-var-sliders-h: \f1de;
+$fa-var-slideshare: \f1e7;
+$fa-var-smile: \f118;
+$fa-var-smile-beam: \f5b8;
+$fa-var-smile-wink: \f4da;
+$fa-var-smog: \f75f;
+$fa-var-smoking: \f48d;
+$fa-var-smoking-ban: \f54d;
+$fa-var-sms: \f7cd;
+$fa-var-snapchat: \f2ab;
+$fa-var-snapchat-ghost: \f2ac;
+$fa-var-snapchat-square: \f2ad;
+$fa-var-snowboarding: \f7ce;
+$fa-var-snowflake: \f2dc;
+$fa-var-snowman: \f7d0;
+$fa-var-snowplow: \f7d2;
+$fa-var-socks: \f696;
+$fa-var-solar-panel: \f5ba;
+$fa-var-sort: \f0dc;
+$fa-var-sort-alpha-down: \f15d;
+$fa-var-sort-alpha-down-alt: \f881;
+$fa-var-sort-alpha-up: \f15e;
+$fa-var-sort-alpha-up-alt: \f882;
+$fa-var-sort-amount-down: \f160;
+$fa-var-sort-amount-down-alt: \f884;
+$fa-var-sort-amount-up: \f161;
+$fa-var-sort-amount-up-alt: \f885;
+$fa-var-sort-down: \f0dd;
+$fa-var-sort-numeric-down: \f162;
+$fa-var-sort-numeric-down-alt: \f886;
+$fa-var-sort-numeric-up: \f163;
+$fa-var-sort-numeric-up-alt: \f887;
+$fa-var-sort-up: \f0de;
+$fa-var-soundcloud: \f1be;
+$fa-var-sourcetree: \f7d3;
+$fa-var-spa: \f5bb;
+$fa-var-space-shuttle: \f197;
+$fa-var-speakap: \f3f3;
+$fa-var-speaker-deck: \f83c;
+$fa-var-spell-check: \f891;
+$fa-var-spider: \f717;
+$fa-var-spinner: \f110;
+$fa-var-splotch: \f5bc;
+$fa-var-spotify: \f1bc;
+$fa-var-spray-can: \f5bd;
+$fa-var-square: \f0c8;
+$fa-var-square-full: \f45c;
+$fa-var-square-root-alt: \f698;
+$fa-var-squarespace: \f5be;
+$fa-var-stack-exchange: \f18d;
+$fa-var-stack-overflow: \f16c;
+$fa-var-stackpath: \f842;
+$fa-var-stamp: \f5bf;
+$fa-var-star: \f005;
+$fa-var-star-and-crescent: \f699;
+$fa-var-star-half: \f089;
+$fa-var-star-half-alt: \f5c0;
+$fa-var-star-of-david: \f69a;
+$fa-var-star-of-life: \f621;
+$fa-var-staylinked: \f3f5;
+$fa-var-steam: \f1b6;
+$fa-var-steam-square: \f1b7;
+$fa-var-steam-symbol: \f3f6;
+$fa-var-step-backward: \f048;
+$fa-var-step-forward: \f051;
+$fa-var-stethoscope: \f0f1;
+$fa-var-sticker-mule: \f3f7;
+$fa-var-sticky-note: \f249;
+$fa-var-stop: \f04d;
+$fa-var-stop-circle: \f28d;
+$fa-var-stopwatch: \f2f2;
+$fa-var-store: \f54e;
+$fa-var-store-alt: \f54f;
+$fa-var-strava: \f428;
+$fa-var-stream: \f550;
+$fa-var-street-view: \f21d;
+$fa-var-strikethrough: \f0cc;
+$fa-var-stripe: \f429;
+$fa-var-stripe-s: \f42a;
+$fa-var-stroopwafel: \f551;
+$fa-var-studiovinari: \f3f8;
+$fa-var-stumbleupon: \f1a4;
+$fa-var-stumbleupon-circle: \f1a3;
+$fa-var-subscript: \f12c;
+$fa-var-subway: \f239;
+$fa-var-suitcase: \f0f2;
+$fa-var-suitcase-rolling: \f5c1;
+$fa-var-sun: \f185;
+$fa-var-superpowers: \f2dd;
+$fa-var-superscript: \f12b;
+$fa-var-supple: \f3f9;
+$fa-var-surprise: \f5c2;
+$fa-var-suse: \f7d6;
+$fa-var-swatchbook: \f5c3;
+$fa-var-swift: \f8e1;
+$fa-var-swimmer: \f5c4;
+$fa-var-swimming-pool: \f5c5;
+$fa-var-symfony: \f83d;
+$fa-var-synagogue: \f69b;
+$fa-var-sync: \f021;
+$fa-var-sync-alt: \f2f1;
+$fa-var-syringe: \f48e;
+$fa-var-table: \f0ce;
+$fa-var-table-tennis: \f45d;
+$fa-var-tablet: \f10a;
+$fa-var-tablet-alt: \f3fa;
+$fa-var-tablets: \f490;
+$fa-var-tachometer-alt: \f3fd;
+$fa-var-tag: \f02b;
+$fa-var-tags: \f02c;
+$fa-var-tape: \f4db;
+$fa-var-tasks: \f0ae;
+$fa-var-taxi: \f1ba;
+$fa-var-teamspeak: \f4f9;
+$fa-var-teeth: \f62e;
+$fa-var-teeth-open: \f62f;
+$fa-var-telegram: \f2c6;
+$fa-var-telegram-plane: \f3fe;
+$fa-var-temperature-high: \f769;
+$fa-var-temperature-low: \f76b;
+$fa-var-tencent-weibo: \f1d5;
+$fa-var-tenge: \f7d7;
+$fa-var-terminal: \f120;
+$fa-var-text-height: \f034;
+$fa-var-text-width: \f035;
+$fa-var-th: \f00a;
+$fa-var-th-large: \f009;
+$fa-var-th-list: \f00b;
+$fa-var-the-red-yeti: \f69d;
+$fa-var-theater-masks: \f630;
+$fa-var-themeco: \f5c6;
+$fa-var-themeisle: \f2b2;
+$fa-var-thermometer: \f491;
+$fa-var-thermometer-empty: \f2cb;
+$fa-var-thermometer-full: \f2c7;
+$fa-var-thermometer-half: \f2c9;
+$fa-var-thermometer-quarter: \f2ca;
+$fa-var-thermometer-three-quarters: \f2c8;
+$fa-var-think-peaks: \f731;
+$fa-var-thumbs-down: \f165;
+$fa-var-thumbs-up: \f164;
+$fa-var-thumbtack: \f08d;
+$fa-var-ticket-alt: \f3ff;
+$fa-var-times: \f00d;
+$fa-var-times-circle: \f057;
+$fa-var-tint: \f043;
+$fa-var-tint-slash: \f5c7;
+$fa-var-tired: \f5c8;
+$fa-var-toggle-off: \f204;
+$fa-var-toggle-on: \f205;
+$fa-var-toilet: \f7d8;
+$fa-var-toilet-paper: \f71e;
+$fa-var-toolbox: \f552;
+$fa-var-tools: \f7d9;
+$fa-var-tooth: \f5c9;
+$fa-var-torah: \f6a0;
+$fa-var-torii-gate: \f6a1;
+$fa-var-tractor: \f722;
+$fa-var-trade-federation: \f513;
+$fa-var-trademark: \f25c;
+$fa-var-traffic-light: \f637;
+$fa-var-train: \f238;
+$fa-var-tram: \f7da;
+$fa-var-transgender: \f224;
+$fa-var-transgender-alt: \f225;
+$fa-var-trash: \f1f8;
+$fa-var-trash-alt: \f2ed;
+$fa-var-trash-restore: \f829;
+$fa-var-trash-restore-alt: \f82a;
+$fa-var-tree: \f1bb;
+$fa-var-trello: \f181;
+$fa-var-tripadvisor: \f262;
+$fa-var-trophy: \f091;
+$fa-var-truck: \f0d1;
+$fa-var-truck-loading: \f4de;
+$fa-var-truck-monster: \f63b;
+$fa-var-truck-moving: \f4df;
+$fa-var-truck-pickup: \f63c;
+$fa-var-tshirt: \f553;
+$fa-var-tty: \f1e4;
+$fa-var-tumblr: \f173;
+$fa-var-tumblr-square: \f174;
+$fa-var-tv: \f26c;
+$fa-var-twitch: \f1e8;
+$fa-var-twitter: \f099;
+$fa-var-twitter-square: \f081;
+$fa-var-typo3: \f42b;
+$fa-var-uber: \f402;
+$fa-var-ubuntu: \f7df;
+$fa-var-uikit: \f403;
+$fa-var-umbraco: \f8e8;
+$fa-var-umbrella: \f0e9;
+$fa-var-umbrella-beach: \f5ca;
+$fa-var-underline: \f0cd;
+$fa-var-undo: \f0e2;
+$fa-var-undo-alt: \f2ea;
+$fa-var-uniregistry: \f404;
+$fa-var-universal-access: \f29a;
+$fa-var-university: \f19c;
+$fa-var-unlink: \f127;
+$fa-var-unlock: \f09c;
+$fa-var-unlock-alt: \f13e;
+$fa-var-untappd: \f405;
+$fa-var-upload: \f093;
+$fa-var-ups: \f7e0;
+$fa-var-usb: \f287;
+$fa-var-user: \f007;
+$fa-var-user-alt: \f406;
+$fa-var-user-alt-slash: \f4fa;
+$fa-var-user-astronaut: \f4fb;
+$fa-var-user-check: \f4fc;
+$fa-var-user-circle: \f2bd;
+$fa-var-user-clock: \f4fd;
+$fa-var-user-cog: \f4fe;
+$fa-var-user-edit: \f4ff;
+$fa-var-user-friends: \f500;
+$fa-var-user-graduate: \f501;
+$fa-var-user-injured: \f728;
+$fa-var-user-lock: \f502;
+$fa-var-user-md: \f0f0;
+$fa-var-user-minus: \f503;
+$fa-var-user-ninja: \f504;
+$fa-var-user-nurse: \f82f;
+$fa-var-user-plus: \f234;
+$fa-var-user-secret: \f21b;
+$fa-var-user-shield: \f505;
+$fa-var-user-slash: \f506;
+$fa-var-user-tag: \f507;
+$fa-var-user-tie: \f508;
+$fa-var-user-times: \f235;
+$fa-var-users: \f0c0;
+$fa-var-users-cog: \f509;
+$fa-var-usps: \f7e1;
+$fa-var-ussunnah: \f407;
+$fa-var-utensil-spoon: \f2e5;
+$fa-var-utensils: \f2e7;
+$fa-var-vaadin: \f408;
+$fa-var-vector-square: \f5cb;
+$fa-var-venus: \f221;
+$fa-var-venus-double: \f226;
+$fa-var-venus-mars: \f228;
+$fa-var-viacoin: \f237;
+$fa-var-viadeo: \f2a9;
+$fa-var-viadeo-square: \f2aa;
+$fa-var-vial: \f492;
+$fa-var-vials: \f493;
+$fa-var-viber: \f409;
+$fa-var-video: \f03d;
+$fa-var-video-slash: \f4e2;
+$fa-var-vihara: \f6a7;
+$fa-var-vimeo: \f40a;
+$fa-var-vimeo-square: \f194;
+$fa-var-vimeo-v: \f27d;
+$fa-var-vine: \f1ca;
+$fa-var-vk: \f189;
+$fa-var-vnv: \f40b;
+$fa-var-voicemail: \f897;
+$fa-var-volleyball-ball: \f45f;
+$fa-var-volume-down: \f027;
+$fa-var-volume-mute: \f6a9;
+$fa-var-volume-off: \f026;
+$fa-var-volume-up: \f028;
+$fa-var-vote-yea: \f772;
+$fa-var-vr-cardboard: \f729;
+$fa-var-vuejs: \f41f;
+$fa-var-walking: \f554;
+$fa-var-wallet: \f555;
+$fa-var-warehouse: \f494;
+$fa-var-water: \f773;
+$fa-var-wave-square: \f83e;
+$fa-var-waze: \f83f;
+$fa-var-weebly: \f5cc;
+$fa-var-weibo: \f18a;
+$fa-var-weight: \f496;
+$fa-var-weight-hanging: \f5cd;
+$fa-var-weixin: \f1d7;
+$fa-var-whatsapp: \f232;
+$fa-var-whatsapp-square: \f40c;
+$fa-var-wheelchair: \f193;
+$fa-var-whmcs: \f40d;
+$fa-var-wifi: \f1eb;
+$fa-var-wikipedia-w: \f266;
+$fa-var-wind: \f72e;
+$fa-var-window-close: \f410;
+$fa-var-window-maximize: \f2d0;
+$fa-var-window-minimize: \f2d1;
+$fa-var-window-restore: \f2d2;
+$fa-var-windows: \f17a;
+$fa-var-wine-bottle: \f72f;
+$fa-var-wine-glass: \f4e3;
+$fa-var-wine-glass-alt: \f5ce;
+$fa-var-wix: \f5cf;
+$fa-var-wizards-of-the-coast: \f730;
+$fa-var-wolf-pack-battalion: \f514;
+$fa-var-won-sign: \f159;
+$fa-var-wordpress: \f19a;
+$fa-var-wordpress-simple: \f411;
+$fa-var-wpbeginner: \f297;
+$fa-var-wpexplorer: \f2de;
+$fa-var-wpforms: \f298;
+$fa-var-wpressr: \f3e4;
+$fa-var-wrench: \f0ad;
+$fa-var-x-ray: \f497;
+$fa-var-xbox: \f412;
+$fa-var-xing: \f168;
+$fa-var-xing-square: \f169;
+$fa-var-y-combinator: \f23b;
+$fa-var-yahoo: \f19e;
+$fa-var-yammer: \f840;
+$fa-var-yandex: \f413;
+$fa-var-yandex-international: \f414;
+$fa-var-yarn: \f7e3;
+$fa-var-yelp: \f1e9;
+$fa-var-yen-sign: \f157;
+$fa-var-yin-yang: \f6ad;
+$fa-var-yoast: \f2b1;
+$fa-var-youtube: \f167;
+$fa-var-youtube-square: \f431;
+$fa-var-zhihu: \f63f;
diff --git a/x2engine/compass/css/lib/scss/brands.scss b/x2engine/compass/css/lib/scss/brands.scss
new file mode 100644
index 000000000..5009d7f74
--- /dev/null
+++ b/x2engine/compass/css/lib/scss/brands.scss
@@ -0,0 +1,22 @@
+/*!
+ * Font Awesome Free 5.11.2 by @fontawesome - https://fontawesome.com
+ * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
+ */
+@import 'variables';
+
+@font-face {
+ font-family: 'Font Awesome 5 Brands';
+ font-style: normal;
+ font-weight: normal;
+ font-display: $fa-font-display;
+ src: url('#{$fa-font-path}/fa-brands-400.eot');
+ src: url('#{$fa-font-path}/fa-brands-400.eot?#iefix') format('embedded-opentype'),
+ url('#{$fa-font-path}/fa-brands-400.woff2') format('woff2'),
+ url('#{$fa-font-path}/fa-brands-400.woff') format('woff'),
+ url('#{$fa-font-path}/fa-brands-400.ttf') format('truetype'),
+ url('#{$fa-font-path}/fa-brands-400.svg#fontawesome') format('svg');
+}
+
+.fab {
+ font-family: 'Font Awesome 5 Brands';
+}
diff --git a/x2engine/compass/css/lib/scss/fontawesome.scss b/x2engine/compass/css/lib/scss/fontawesome.scss
new file mode 100644
index 000000000..334b6c630
--- /dev/null
+++ b/x2engine/compass/css/lib/scss/fontawesome.scss
@@ -0,0 +1,16 @@
+/*!
+ * Font Awesome Free 5.11.2 by @fontawesome - https://fontawesome.com
+ * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
+ */
+@import 'variables';
+@import 'mixins';
+@import 'core';
+@import 'larger';
+@import 'fixed-width';
+@import 'list';
+@import 'bordered-pulled';
+@import 'animated';
+@import 'rotated-flipped';
+@import 'stacked';
+@import 'icons';
+@import 'screen-reader';
diff --git a/x2engine/compass/css/lib/scss/regular.scss b/x2engine/compass/css/lib/scss/regular.scss
new file mode 100644
index 000000000..9dd8cd682
--- /dev/null
+++ b/x2engine/compass/css/lib/scss/regular.scss
@@ -0,0 +1,23 @@
+/*!
+ * Font Awesome Free 5.11.2 by @fontawesome - https://fontawesome.com
+ * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
+ */
+@import 'variables';
+
+@font-face {
+ font-family: 'Font Awesome 5 Free';
+ font-style: normal;
+ font-weight: 400;
+ font-display: $fa-font-display;
+ src: url('#{$fa-font-path}/fa-regular-400.eot');
+ src: url('#{$fa-font-path}/fa-regular-400.eot?#iefix') format('embedded-opentype'),
+ url('#{$fa-font-path}/fa-regular-400.woff2') format('woff2'),
+ url('#{$fa-font-path}/fa-regular-400.woff') format('woff'),
+ url('#{$fa-font-path}/fa-regular-400.ttf') format('truetype'),
+ url('#{$fa-font-path}/fa-regular-400.svg#fontawesome') format('svg');
+}
+
+.far {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 400;
+}
diff --git a/x2engine/compass/css/lib/scss/solid.scss b/x2engine/compass/css/lib/scss/solid.scss
new file mode 100644
index 000000000..597e5450e
--- /dev/null
+++ b/x2engine/compass/css/lib/scss/solid.scss
@@ -0,0 +1,24 @@
+/*!
+ * Font Awesome Free 5.11.2 by @fontawesome - https://fontawesome.com
+ * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
+ */
+@import 'variables';
+
+@font-face {
+ font-family: 'Font Awesome 5 Free';
+ font-style: normal;
+ font-weight: 900;
+ font-display: $fa-font-display;
+ src: url('#{$fa-font-path}/fa-solid-900.eot');
+ src: url('#{$fa-font-path}/fa-solid-900.eot?#iefix') format('embedded-opentype'),
+ url('#{$fa-font-path}/fa-solid-900.woff2') format('woff2'),
+ url('#{$fa-font-path}/fa-solid-900.woff') format('woff'),
+ url('#{$fa-font-path}/fa-solid-900.ttf') format('truetype'),
+ url('#{$fa-font-path}/fa-solid-900.svg#fontawesome') format('svg');
+}
+
+.fa,
+.fas {
+ font-family: 'Font Awesome 5 Free';
+ font-weight: 900;
+}
diff --git a/x2engine/compass/css/lib/scss/v4-shims.scss b/x2engine/compass/css/lib/scss/v4-shims.scss
new file mode 100644
index 000000000..b3f246b70
--- /dev/null
+++ b/x2engine/compass/css/lib/scss/v4-shims.scss
@@ -0,0 +1,6 @@
+/*!
+ * Font Awesome Free 5.11.2 by @fontawesome - https://fontawesome.com
+ * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
+ */
+@import 'variables';
+@import 'shims';
diff --git a/x2engine/compass/protected/modules/quotes/assets/css/lineItemsMini.scss b/x2engine/compass/protected/modules/quotes/assets/css/lineItemsMini.scss
index 692989a5e..514207997 100644
--- a/x2engine/compass/protected/modules/quotes/assets/css/lineItemsMini.scss
+++ b/x2engine/compass/protected/modules/quotes/assets/css/lineItemsMini.scss
@@ -50,10 +50,13 @@
}
}
tr.line-item {
- .x2-5th-child, .x2-6th-child {
+ .x2-5th-child {
display: none;
}
}
+ .add-comment-button{
+ display: none !important;
+ }
.add-adjustment-button {
display: none !important;
}
diff --git a/x2engine/compass/protected/modules/quotes/assets/css/lineItemsRead.scss b/x2engine/compass/protected/modules/quotes/assets/css/lineItemsRead.scss
index d56f3e827..b1fa26f1b 100644
--- a/x2engine/compass/protected/modules/quotes/assets/css/lineItemsRead.scss
+++ b/x2engine/compass/protected/modules/quotes/assets/css/lineItemsRead.scss
@@ -60,7 +60,6 @@
text-overflow: ellipsis;
}
tbody.line-items > tr > td.x2-2nd-child {
- overflow: hidden;
text-overflow: ellipsis;
width: 20%;
}
@@ -74,6 +73,13 @@
width: 95%;
font-size: 12px;
}
+ &.x2-2nd-child textarea.description {
+ resize: none;
+ height: 75px;
+ font-size: 12px;
+ position: relative;
+ left: 15%;
+ }
&.x2-3rd-child {
width: 17.5%;
input {
diff --git a/x2engine/compass/protected/modules/quotes/assets/css/lineItemsWrite.scss b/x2engine/compass/protected/modules/quotes/assets/css/lineItemsWrite.scss
index f27436b03..6403e055d 100644
--- a/x2engine/compass/protected/modules/quotes/assets/css/lineItemsWrite.scss
+++ b/x2engine/compass/protected/modules/quotes/assets/css/lineItemsWrite.scss
@@ -86,12 +86,12 @@
display: inline-block;
}
- .add-line-item-button, .add-adjustment-button {
+ .add-line-item-button, .add-adjustment-button, .add-comment-button {
margin: 0 1em 0 1em;
width: 12em;
}
- .add-line-item-button.x2-button, .add-adjustment-button.x2-button {
+ .add-line-item-button.x2-button, .add-adjustment-button.x2-button, .add-comment-button.x2-button {
width: 150px;
display: inline-block;
clear: none;
@@ -192,6 +192,14 @@
float: left;
font-size: 12px;
}
+ thead > tr > th.line-item-name, tbody.line-items > tr > td.x2-2nd-child textarea {
+ margin: 0 0 0 0;
+ width: 85%;
+ height: 75px;
+ float: left;
+ font-size: 12px;
+ resize: none;
+ }
}
tr.line-item td.input-cell button.product-select-button {
@include border-radius(0px 4px 4px 0px);
@@ -214,6 +222,14 @@
}
> tbody {
&.line-items > tr > td {
+ &.x2-2nd-child {
+ textarea.description {
+ margin: 5px;
+ width: 85%;
+ float: right;
+ font-size: 12px;
+ }
+ }
&.x2-3rd-child {
text-align: left;
width: 16%;
@@ -268,7 +284,7 @@
font-size: 12px;
}
}
- .subtotal-container, .total-container {
+ .subtotal-container, .total-container, .tax-container {
width: 22%;
text-align: left;
}
@@ -277,6 +293,15 @@
width: 100%;
font-size: 12px;
}
+ &.tax {
+ width: 32%;
+ text-align: left;
+ border: 1px solid #aaa;
+ font-size: 12px;
+ font-family: Arial, Helvetica, sans-serif;
+ box-sizing: border-box;
+ @include border-radius(3px);
+ }
}
}
}
diff --git a/x2engine/compass/themes/x2engine/css/activityFeed.scss b/x2engine/compass/themes/x2engine/css/activityFeed.scss
index 4eed15220..fa5934d41 100644
--- a/x2engine/compass/themes/x2engine/css/activityFeed.scss
+++ b/x2engine/compass/themes/x2engine/css/activityFeed.scss
@@ -241,7 +241,7 @@
padding: 12px;
overflow: auto;
&.important-action {
- background: $lightBabyBlue;
+ background: $lightPastelGreen;
}
}
@@ -487,6 +487,10 @@
&.email_sent, &.email_sent_quote, &.email_sent_invoice {
background-image: url(../images/eventIcons/email_sent.png);
}
+ /**
+ * Icon is now switched to font awesome user-circle.
+ * https://fontawesome.com/icons/user-circle?style=solid
+ */
&.feed {
background-image: url(../images/eventIcons/default.png);
}
diff --git a/x2engine/compass/themes/x2engine/css/components/DataWidget/DataWidget.scss b/x2engine/compass/themes/x2engine/css/components/DataWidget/DataWidget.scss
index cbe1e46c8..b3c6e4999 100644
--- a/x2engine/compass/themes/x2engine/css/components/DataWidget/DataWidget.scss
+++ b/x2engine/compass/themes/x2engine/css/components/DataWidget/DataWidget.scss
@@ -129,7 +129,7 @@ $font-color: darken($gray, $contrast);
opacity: 0.75;
}
- .c3-tooltip {
+ .bb-tooltip {
border-radius: 2px;
.value, .name, th {
diff --git a/x2engine/compass/themes/x2engine/css/gridview/responsiveStyles.scss b/x2engine/compass/themes/x2engine/css/gridview/responsiveStyles.scss
index 9ac159401..f12b207c0 100644
--- a/x2engine/compass/themes/x2engine/css/gridview/responsiveStyles.scss
+++ b/x2engine/compass/themes/x2engine/css/gridview/responsiveStyles.scss
@@ -72,7 +72,7 @@ $left-margin: 3px;
.x2-gridview-fixed-top-bar-inner {
width: 100%;
padding-right: calc(22% + 3px);
- padding-left: 9px;
+ padding-left: 7px;
height: 0;
box-sizing: border-box;
}
diff --git a/x2engine/compass/themes/x2engine/css/gridview/styles.scss b/x2engine/compass/themes/x2engine/css/gridview/styles.scss
index 73c34015a..9a594c66b 100644
--- a/x2engine/compass/themes/x2engine/css/gridview/styles.scss
+++ b/x2engine/compass/themes/x2engine/css/gridview/styles.scss
@@ -58,6 +58,16 @@
line-height: 24px;
}
+/* disable selected for merged cells */
+#Stage-Complete-Widget.grid-view td.merge {
+ background: none repeat scroll 0 0 #F8F8F8;
+}
+
+/* grid border */
+#Stage-Complete-Widget.grid-view td {
+ border: 1px solid #E4E4E4 !important;
+}
+
/*.grid-view-loading {background:url(loading.gif) no-repeat;}*/
diff --git a/x2engine/compass/themes/x2engine/css/layout.scss b/x2engine/compass/themes/x2engine/css/layout.scss
index 590d212f2..a0f2ba6d6 100644
--- a/x2engine/compass/themes/x2engine/css/layout.scss
+++ b/x2engine/compass/themes/x2engine/css/layout.scss
@@ -133,26 +133,28 @@ body {
}
#page {
- margin-top: 32px;
+ margin-top: 60px;
overflow: auto;
padding-bottom: 200px;
}
#header {
- height: 32px;
+ height: 45px;
+ box-shadow: 0px 3px 5px #b3b8bd;
background: #1f559b;
position: fixed;
top: 0;
width: 100%;
z-index: 1000;
&.defaultBg {
- background: #3d70b4;
+ background: #007FCF;
}
}
#header-inner {
height: 31px;
- background-image: url(../images/stripes2.png);
+ //background-image: url(../images/stripes2.png);
+ margin-top: 7px;
background-repeat: no-repeat;
background-size: auto;
opacity: 1;
@@ -521,10 +523,11 @@ span.x2-hidden-widgets-menu-item.ui-draggable {
.sidebar-left {
background: white;
+ box-shadow: 3px 3px 5px #b3b8bd;
width: 150px;
clear: left;
margin: 0px 0px 20px 20px;
- border: 1px solid #e0e0e0;
+ //border: 1px solid #e0e0e0;
float: left;
@include border-radius (2px);
@@ -710,7 +713,7 @@ Remove border radius from left widget title bars which are preceded by a collaps
}
#sidebar-left-widget-box {
- margin-top: 20px !important;
+ //margin-top: 20px !important;
.portlet-decoration i {
@include titleBarIconButton;
}
@@ -731,8 +734,9 @@ Remove border radius from left widget title bars which are preceded by a collaps
@include border-radius ();
.portlet {
+ box-shadow: 3px 3px 5px #b3b8bd;
margin-bottom: 20px;
- border: 1px solid #e0e0e0;
+ //border: 1px solid #e0e0e0;
}
}
@@ -749,6 +753,7 @@ Remove border radius from left widget title bars which are preceded by a collaps
padding-bottom: 0px;
margin: 0px;
margin-left: 20px;
+ margin-right: 20px; //missing from no-backdrop
}
&:not(.no-backdrop) {
@@ -984,6 +989,8 @@ div {
margin: 1px 0px 0 0;
}
+
+
.x2-button.icon {
span {
width: 26px;
@@ -1218,8 +1225,9 @@ div {
/* @theme background: content */
margin: 0px 20px 20px 0px !important;
- border: 1px solid #e0e0e0 !important;
+ //border: 1px solid #e0e0e0 !important;
background-color: white;
+ box-shadow: 3px 3px 5px #b3b8bd;
@include border-radius (2px);
@@ -1261,7 +1269,7 @@ body {
&:horizontal {
border-top: 1px solid rgb(230, 230, 230);
}
- border-left: 1px solid rgb(230, 230, 230);
+ //border-left: 1px solid rgb(230, 230, 230);
}
::-webkit-scrollbar-thumb {
@@ -1316,7 +1324,7 @@ body.disable-mobile-layout {
@include border-radius (0);
border-top: 1px solid #e0e0e0;
- margin-top: 5px;
+ margin-top: 13px; //margin-top: 5px;
}
.x2-gridview-fixed-top-bar-inner > .page-title {
@include border-radius (2px 2px 0px 0px);
diff --git a/x2engine/compass/themes/x2engine/css/main.scss b/x2engine/compass/themes/x2engine/css/main.scss
index 9bd58bcc9..4cc795e2d 100644
--- a/x2engine/compass/themes/x2engine/css/main.scss
+++ b/x2engine/compass/themes/x2engine/css/main.scss
@@ -43,6 +43,10 @@
// Font awesome Pseudo classes
@import "font-awesome";
@import "x2-icons";
+@import "../../../css/lib/scss/fontawesome.scss";
+@import "../../../css/lib/scss/solid.scss";
+@import "../../../css/lib/scss/regular.scss";
+@import "../../../css/lib/scss/brands.scss";
// Icon mixins and font
@import "icons";
@@ -51,7 +55,7 @@
body {
margin: 0;
padding: 0;
- font: normal 10pt Arial, Helvetica, sans-serif;
+ font: normal 10pt "Trebuchet MS", Helvetica, sans-serif;
color: #555555;
/* background: url(background2.gif) top left repeat-x #000; */
&.login {
@@ -515,7 +519,7 @@ p.descrip {
width: 16px;
}
-div.loading-icon,
+div.loading-icon
{
background: url(../images/loading.gif) no-repeat;
height: 32px;
diff --git a/x2engine/compass/themes/x2engine/css/partials/_page-title.scss b/x2engine/compass/themes/x2engine/css/partials/_page-title.scss
index 586b73f38..d35c3e9fe 100644
--- a/x2engine/compass/themes/x2engine/css/partials/_page-title.scss
+++ b/x2engine/compass/themes/x2engine/css/partials/_page-title.scss
@@ -311,6 +311,7 @@ td.fc-header-left h2 {
div.page-title {
margin-left: 3px;
margin-right: 6px;
+ margin-top: 9px;
width: auto;
border: 1px solid #e0e0e0;
diff --git a/x2engine/compass/themes/x2engine/css/partials/_rightWidgets.scss b/x2engine/compass/themes/x2engine/css/partials/_rightWidgets.scss
index bb84cee3c..024cf6e09 100644
--- a/x2engine/compass/themes/x2engine/css/partials/_rightWidgets.scss
+++ b/x2engine/compass/themes/x2engine/css/partials/_rightWidgets.scss
@@ -225,6 +225,7 @@
width: 88px;
height: 88px;
margin: 0 auto 0 auto;
+ //https://commons.wikimedia.org/wiki/File:Analogue_clock_face.svg
background: url(../images/clockface.png);
list-style: none;
}
diff --git a/x2engine/compass/themes/x2engine/css/profile/themeSelector.scss b/x2engine/compass/themes/x2engine/css/profile/themeSelector.scss
index 30815c917..b1403cdce 100644
--- a/x2engine/compass/themes/x2engine/css/profile/themeSelector.scss
+++ b/x2engine/compass/themes/x2engine/css/profile/themeSelector.scss
@@ -122,7 +122,7 @@
background: $highlightGreen;
}
&[name="link"] {
- background: $darkBlue;
+ background: $lightBlue;
}
}
}
diff --git a/x2engine/compass/themes/x2engine/css/publisher.scss b/x2engine/compass/themes/x2engine/css/publisher.scss
index b7c7639f0..fae2ce0f3 100644
--- a/x2engine/compass/themes/x2engine/css/publisher.scss
+++ b/x2engine/compass/themes/x2engine/css/publisher.scss
@@ -45,6 +45,7 @@
@import "icons";
#history {
+ box-shadow: 3px 3px 5px #b3b8bd;
.pager {
border: none;
margin: 0;
@@ -59,7 +60,8 @@
#publisher {
& > .form2 {
- background: $background;
+ //background: $background;
+ background: #FFFFFF;
/* @theme background: content */
textarea, label, .action-duration-display, .reminder-config {
/* @theme color: text */
diff --git a/x2engine/compass/themes/x2engine/css/x2flow.scss b/x2engine/compass/themes/x2engine/css/x2flow.scss
index 85975d6cc..305b8dd6b 100644
--- a/x2engine/compass/themes/x2engine/css/x2flow.scss
+++ b/x2engine/compass/themes/x2engine/css/x2flow.scss
@@ -525,6 +525,8 @@ $edgeColor: #CCCCCC;
background-image: url(../images/x2flow/X2FlowCreateReminder.png);
}
+
+
/**
* Create Email Stage Action
*/
@@ -539,6 +541,14 @@ $edgeColor: #CCCCCC;
background-image: url(../images/x2flow/X2FlowRecordComment.png);
}
+/**
+ * Create Report Email Send Stage Action
+ * https://fontawesome.com/icons/paper-plane?style=solid
+ */
+.X2FlowReportEmail {
+ background-image:url(../images/x2flow/X2FlowReportEmail.png);
+}
+
/**
* Email Open Stage Trigger
*/
@@ -672,6 +682,15 @@ $edgeColor: #CCCCCC;
background-image: url(../images/x2flow/X2FlowWorkflowStart.png);
}
+/**
+ * Process Terminate Stage Action
+ * credit: https://www.needpix.com/photo/download/94408/hand-fingers-stop-halt-palm-free-vector-graphics-free-pictures-free-photos-free-images
+ * (free to use, modify, even commercially)
+ */
+.X2FlowWorkflowTerminateProcess {
+ background-image: url(../images/x2flow/X2FlowWorkflowTerminateProcess.png);
+}
+
/**
* Process Start Stage Stage Action
*/
@@ -1205,4 +1224,4 @@ targeted content
#x2flow-add-attribute, #x2flow-add-header {
display: inline-block;
margin-right: 8px;
-}
\ No newline at end of file
+}
diff --git a/x2engine/css/lib/scss/brands.css b/x2engine/css/lib/scss/brands.css
new file mode 100644
index 000000000..c4d8b2f99
--- /dev/null
+++ b/x2engine/css/lib/scss/brands.css
@@ -0,0 +1,4 @@
+/*!
+ * Font Awesome Free 5.11.2 by @fontawesome - https://fontawesome.com
+ * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
+ */@font-face{font-family:'Font Awesome 5 Brands';font-style:normal;font-weight:normal;font-display:auto;src:url("../../../themes/x2engine/css/fontAwesome/webfonts/fa-brands-400.eot");src:url("../../../themes/x2engine/css/fontAwesome/webfonts/fa-brands-400.eot?#iefix") format("embedded-opentype"),url("../../../themes/x2engine/css/fontAwesome/webfonts/fa-brands-400.woff2") format("woff2"),url("../../../themes/x2engine/css/fontAwesome/webfonts/fa-brands-400.woff") format("woff"),url("../../../themes/x2engine/css/fontAwesome/webfonts/fa-brands-400.ttf") format("truetype"),url("../../../themes/x2engine/css/fontAwesome/webfonts/fa-brands-400.svg#fontawesome") format("svg")}.fab{font-family:'Font Awesome 5 Brands'}
diff --git a/x2engine/css/lib/scss/fontawesome.css b/x2engine/css/lib/scss/fontawesome.css
new file mode 100644
index 000000000..a88d5ce78
--- /dev/null
+++ b/x2engine/css/lib/scss/fontawesome.css
@@ -0,0 +1,4 @@
+/*!
+ * Font Awesome Free 5.11.2 by @fontawesome - https://fontawesome.com
+ * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
+ */.fa,.fas,.far,.fal,.fad,.fab{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}.fa-lg{font-size:1.33333em;line-height:0.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:solid 0.08em #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fas.fa-pull-left,.far.fa-pull-left,.fal.fa-pull-left,.fab.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fas.fa-pull-right,.far.fa-pull-right,.fal.fa-pull-right,.fab.fa-pull-right{margin-left:.3em}.fa-spin{animation:fa-spin 2s infinite linear}.fa-pulse{animation:fa-spin 1s infinite steps(8)}@keyframes fa-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";transform:scale(1, -1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";transform:scale(-1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-flip-both{filter:none}.fa-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-500px:before{content:"\f26e"}.fa-accessible-icon:before{content:"\f368"}.fa-accusoft:before{content:"\f369"}.fa-acquisitions-incorporated:before{content:"\f6af"}.fa-ad:before{content:"\f641"}.fa-address-book:before{content:"\f2b9"}.fa-address-card:before{content:"\f2bb"}.fa-adjust:before{content:"\f042"}.fa-adn:before{content:"\f170"}.fa-adobe:before{content:"\f778"}.fa-adversal:before{content:"\f36a"}.fa-affiliatetheme:before{content:"\f36b"}.fa-air-freshener:before{content:"\f5d0"}.fa-airbnb:before{content:"\f834"}.fa-algolia:before{content:"\f36c"}.fa-align-center:before{content:"\f037"}.fa-align-justify:before{content:"\f039"}.fa-align-left:before{content:"\f036"}.fa-align-right:before{content:"\f038"}.fa-alipay:before{content:"\f642"}.fa-allergies:before{content:"\f461"}.fa-amazon:before{content:"\f270"}.fa-amazon-pay:before{content:"\f42c"}.fa-ambulance:before{content:"\f0f9"}.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-amilia:before{content:"\f36d"}.fa-anchor:before{content:"\f13d"}.fa-android:before{content:"\f17b"}.fa-angellist:before{content:"\f209"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-down:before{content:"\f107"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angry:before{content:"\f556"}.fa-angrycreative:before{content:"\f36e"}.fa-angular:before{content:"\f420"}.fa-ankh:before{content:"\f644"}.fa-app-store:before{content:"\f36f"}.fa-app-store-ios:before{content:"\f370"}.fa-apper:before{content:"\f371"}.fa-apple:before{content:"\f179"}.fa-apple-alt:before{content:"\f5d1"}.fa-apple-pay:before{content:"\f415"}.fa-archive:before{content:"\f187"}.fa-archway:before{content:"\f557"}.fa-arrow-alt-circle-down:before{content:"\f358"}.fa-arrow-alt-circle-left:before{content:"\f359"}.fa-arrow-alt-circle-right:before{content:"\f35a"}.fa-arrow-alt-circle-up:before{content:"\f35b"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-down:before{content:"\f063"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrows-alt:before{content:"\f0b2"}.fa-arrows-alt-h:before{content:"\f337"}.fa-arrows-alt-v:before{content:"\f338"}.fa-artstation:before{content:"\f77a"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asterisk:before{content:"\f069"}.fa-asymmetrik:before{content:"\f372"}.fa-at:before{content:"\f1fa"}.fa-atlas:before{content:"\f558"}.fa-atlassian:before{content:"\f77b"}.fa-atom:before{content:"\f5d2"}.fa-audible:before{content:"\f373"}.fa-audio-description:before{content:"\f29e"}.fa-autoprefixer:before{content:"\f41c"}.fa-avianex:before{content:"\f374"}.fa-aviato:before{content:"\f421"}.fa-award:before{content:"\f559"}.fa-aws:before{content:"\f375"}.fa-baby:before{content:"\f77c"}.fa-baby-carriage:before{content:"\f77d"}.fa-backspace:before{content:"\f55a"}.fa-backward:before{content:"\f04a"}.fa-bacon:before{content:"\f7e5"}.fa-balance-scale:before{content:"\f24e"}.fa-balance-scale-left:before{content:"\f515"}.fa-balance-scale-right:before{content:"\f516"}.fa-ban:before{content:"\f05e"}.fa-band-aid:before{content:"\f462"}.fa-bandcamp:before{content:"\f2d5"}.fa-barcode:before{content:"\f02a"}.fa-bars:before{content:"\f0c9"}.fa-baseball-ball:before{content:"\f433"}.fa-basketball-ball:before{content:"\f434"}.fa-bath:before{content:"\f2cd"}.fa-battery-empty:before{content:"\f244"}.fa-battery-full:before{content:"\f240"}.fa-battery-half:before{content:"\f242"}.fa-battery-quarter:before{content:"\f243"}.fa-battery-three-quarters:before{content:"\f241"}.fa-battle-net:before{content:"\f835"}.fa-bed:before{content:"\f236"}.fa-beer:before{content:"\f0fc"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-bell:before{content:"\f0f3"}.fa-bell-slash:before{content:"\f1f6"}.fa-bezier-curve:before{content:"\f55b"}.fa-bible:before{content:"\f647"}.fa-bicycle:before{content:"\f206"}.fa-biking:before{content:"\f84a"}.fa-bimobject:before{content:"\f378"}.fa-binoculars:before{content:"\f1e5"}.fa-biohazard:before{content:"\f780"}.fa-birthday-cake:before{content:"\f1fd"}.fa-bitbucket:before{content:"\f171"}.fa-bitcoin:before{content:"\f379"}.fa-bity:before{content:"\f37a"}.fa-black-tie:before{content:"\f27e"}.fa-blackberry:before{content:"\f37b"}.fa-blender:before{content:"\f517"}.fa-blender-phone:before{content:"\f6b6"}.fa-blind:before{content:"\f29d"}.fa-blog:before{content:"\f781"}.fa-blogger:before{content:"\f37c"}.fa-blogger-b:before{content:"\f37d"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-bold:before{content:"\f032"}.fa-bolt:before{content:"\f0e7"}.fa-bomb:before{content:"\f1e2"}.fa-bone:before{content:"\f5d7"}.fa-bong:before{content:"\f55c"}.fa-book:before{content:"\f02d"}.fa-book-dead:before{content:"\f6b7"}.fa-book-medical:before{content:"\f7e6"}.fa-book-open:before{content:"\f518"}.fa-book-reader:before{content:"\f5da"}.fa-bookmark:before{content:"\f02e"}.fa-bootstrap:before{content:"\f836"}.fa-border-all:before{content:"\f84c"}.fa-border-none:before{content:"\f850"}.fa-border-style:before{content:"\f853"}.fa-bowling-ball:before{content:"\f436"}.fa-box:before{content:"\f466"}.fa-box-open:before{content:"\f49e"}.fa-boxes:before{content:"\f468"}.fa-braille:before{content:"\f2a1"}.fa-brain:before{content:"\f5dc"}.fa-bread-slice:before{content:"\f7ec"}.fa-briefcase:before{content:"\f0b1"}.fa-briefcase-medical:before{content:"\f469"}.fa-broadcast-tower:before{content:"\f519"}.fa-broom:before{content:"\f51a"}.fa-brush:before{content:"\f55d"}.fa-btc:before{content:"\f15a"}.fa-buffer:before{content:"\f837"}.fa-bug:before{content:"\f188"}.fa-building:before{content:"\f1ad"}.fa-bullhorn:before{content:"\f0a1"}.fa-bullseye:before{content:"\f140"}.fa-burn:before{content:"\f46a"}.fa-buromobelexperte:before{content:"\f37f"}.fa-bus:before{content:"\f207"}.fa-bus-alt:before{content:"\f55e"}.fa-business-time:before{content:"\f64a"}.fa-buy-n-large:before{content:"\f8a6"}.fa-buysellads:before{content:"\f20d"}.fa-calculator:before{content:"\f1ec"}.fa-calendar:before{content:"\f133"}.fa-calendar-alt:before{content:"\f073"}.fa-calendar-check:before{content:"\f274"}.fa-calendar-day:before{content:"\f783"}.fa-calendar-minus:before{content:"\f272"}.fa-calendar-plus:before{content:"\f271"}.fa-calendar-times:before{content:"\f273"}.fa-calendar-week:before{content:"\f784"}.fa-camera:before{content:"\f030"}.fa-camera-retro:before{content:"\f083"}.fa-campground:before{content:"\f6bb"}.fa-canadian-maple-leaf:before{content:"\f785"}.fa-candy-cane:before{content:"\f786"}.fa-cannabis:before{content:"\f55f"}.fa-capsules:before{content:"\f46b"}.fa-car:before{content:"\f1b9"}.fa-car-alt:before{content:"\f5de"}.fa-car-battery:before{content:"\f5df"}.fa-car-crash:before{content:"\f5e1"}.fa-car-side:before{content:"\f5e4"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-caret-square-down:before{content:"\f150"}.fa-caret-square-left:before{content:"\f191"}.fa-caret-square-right:before{content:"\f152"}.fa-caret-square-up:before{content:"\f151"}.fa-caret-up:before{content:"\f0d8"}.fa-carrot:before{content:"\f787"}.fa-cart-arrow-down:before{content:"\f218"}.fa-cart-plus:before{content:"\f217"}.fa-cash-register:before{content:"\f788"}.fa-cat:before{content:"\f6be"}.fa-cc-amazon-pay:before{content:"\f42d"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-apple-pay:before{content:"\f416"}.fa-cc-diners-club:before{content:"\f24c"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-cc-visa:before{content:"\f1f0"}.fa-centercode:before{content:"\f380"}.fa-centos:before{content:"\f789"}.fa-certificate:before{content:"\f0a3"}.fa-chair:before{content:"\f6c0"}.fa-chalkboard:before{content:"\f51b"}.fa-chalkboard-teacher:before{content:"\f51c"}.fa-charging-station:before{content:"\f5e7"}.fa-chart-area:before{content:"\f1fe"}.fa-chart-bar:before{content:"\f080"}.fa-chart-line:before{content:"\f201"}.fa-chart-pie:before{content:"\f200"}.fa-check:before{content:"\f00c"}.fa-check-circle:before{content:"\f058"}.fa-check-double:before{content:"\f560"}.fa-check-square:before{content:"\f14a"}.fa-cheese:before{content:"\f7ef"}.fa-chess:before{content:"\f439"}.fa-chess-bishop:before{content:"\f43a"}.fa-chess-board:before{content:"\f43c"}.fa-chess-king:before{content:"\f43f"}.fa-chess-knight:before{content:"\f441"}.fa-chess-pawn:before{content:"\f443"}.fa-chess-queen:before{content:"\f445"}.fa-chess-rook:before{content:"\f447"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-down:before{content:"\f078"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-chevron-up:before{content:"\f077"}.fa-child:before{content:"\f1ae"}.fa-chrome:before{content:"\f268"}.fa-chromecast:before{content:"\f838"}.fa-church:before{content:"\f51d"}.fa-circle:before{content:"\f111"}.fa-circle-notch:before{content:"\f1ce"}.fa-city:before{content:"\f64f"}.fa-clinic-medical:before{content:"\f7f2"}.fa-clipboard:before{content:"\f328"}.fa-clipboard-check:before{content:"\f46c"}.fa-clipboard-list:before{content:"\f46d"}.fa-clock:before{content:"\f017"}.fa-clone:before{content:"\f24d"}.fa-closed-captioning:before{content:"\f20a"}.fa-cloud:before{content:"\f0c2"}.fa-cloud-download-alt:before{content:"\f381"}.fa-cloud-meatball:before{content:"\f73b"}.fa-cloud-moon:before{content:"\f6c3"}.fa-cloud-moon-rain:before{content:"\f73c"}.fa-cloud-rain:before{content:"\f73d"}.fa-cloud-showers-heavy:before{content:"\f740"}.fa-cloud-sun:before{content:"\f6c4"}.fa-cloud-sun-rain:before{content:"\f743"}.fa-cloud-upload-alt:before{content:"\f382"}.fa-cloudscale:before{content:"\f383"}.fa-cloudsmith:before{content:"\f384"}.fa-cloudversify:before{content:"\f385"}.fa-cocktail:before{content:"\f561"}.fa-code:before{content:"\f121"}.fa-code-branch:before{content:"\f126"}.fa-codepen:before{content:"\f1cb"}.fa-codiepie:before{content:"\f284"}.fa-coffee:before{content:"\f0f4"}.fa-cog:before{content:"\f013"}.fa-cogs:before{content:"\f085"}.fa-coins:before{content:"\f51e"}.fa-columns:before{content:"\f0db"}.fa-comment:before{content:"\f075"}.fa-comment-alt:before{content:"\f27a"}.fa-comment-dollar:before{content:"\f651"}.fa-comment-dots:before{content:"\f4ad"}.fa-comment-medical:before{content:"\f7f5"}.fa-comment-slash:before{content:"\f4b3"}.fa-comments:before{content:"\f086"}.fa-comments-dollar:before{content:"\f653"}.fa-compact-disc:before{content:"\f51f"}.fa-compass:before{content:"\f14e"}.fa-compress:before{content:"\f066"}.fa-compress-arrows-alt:before{content:"\f78c"}.fa-concierge-bell:before{content:"\f562"}.fa-confluence:before{content:"\f78d"}.fa-connectdevelop:before{content:"\f20e"}.fa-contao:before{content:"\f26d"}.fa-cookie:before{content:"\f563"}.fa-cookie-bite:before{content:"\f564"}.fa-copy:before{content:"\f0c5"}.fa-copyright:before{content:"\f1f9"}.fa-cotton-bureau:before{content:"\f89e"}.fa-couch:before{content:"\f4b8"}.fa-cpanel:before{content:"\f388"}.fa-creative-commons:before{content:"\f25e"}.fa-creative-commons-by:before{content:"\f4e7"}.fa-creative-commons-nc:before{content:"\f4e8"}.fa-creative-commons-nc-eu:before{content:"\f4e9"}.fa-creative-commons-nc-jp:before{content:"\f4ea"}.fa-creative-commons-nd:before{content:"\f4eb"}.fa-creative-commons-pd:before{content:"\f4ec"}.fa-creative-commons-pd-alt:before{content:"\f4ed"}.fa-creative-commons-remix:before{content:"\f4ee"}.fa-creative-commons-sa:before{content:"\f4ef"}.fa-creative-commons-sampling:before{content:"\f4f0"}.fa-creative-commons-sampling-plus:before{content:"\f4f1"}.fa-creative-commons-share:before{content:"\f4f2"}.fa-creative-commons-zero:before{content:"\f4f3"}.fa-credit-card:before{content:"\f09d"}.fa-critical-role:before{content:"\f6c9"}.fa-crop:before{content:"\f125"}.fa-crop-alt:before{content:"\f565"}.fa-cross:before{content:"\f654"}.fa-crosshairs:before{content:"\f05b"}.fa-crow:before{content:"\f520"}.fa-crown:before{content:"\f521"}.fa-crutch:before{content:"\f7f7"}.fa-css3:before{content:"\f13c"}.fa-css3-alt:before{content:"\f38b"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-cut:before{content:"\f0c4"}.fa-cuttlefish:before{content:"\f38c"}.fa-d-and-d:before{content:"\f38d"}.fa-d-and-d-beyond:before{content:"\f6ca"}.fa-dashcube:before{content:"\f210"}.fa-database:before{content:"\f1c0"}.fa-deaf:before{content:"\f2a4"}.fa-delicious:before{content:"\f1a5"}.fa-democrat:before{content:"\f747"}.fa-deploydog:before{content:"\f38e"}.fa-deskpro:before{content:"\f38f"}.fa-desktop:before{content:"\f108"}.fa-dev:before{content:"\f6cc"}.fa-deviantart:before{content:"\f1bd"}.fa-dharmachakra:before{content:"\f655"}.fa-dhl:before{content:"\f790"}.fa-diagnoses:before{content:"\f470"}.fa-diaspora:before{content:"\f791"}.fa-dice:before{content:"\f522"}.fa-dice-d20:before{content:"\f6cf"}.fa-dice-d6:before{content:"\f6d1"}.fa-dice-five:before{content:"\f523"}.fa-dice-four:before{content:"\f524"}.fa-dice-one:before{content:"\f525"}.fa-dice-six:before{content:"\f526"}.fa-dice-three:before{content:"\f527"}.fa-dice-two:before{content:"\f528"}.fa-digg:before{content:"\f1a6"}.fa-digital-ocean:before{content:"\f391"}.fa-digital-tachograph:before{content:"\f566"}.fa-directions:before{content:"\f5eb"}.fa-discord:before{content:"\f392"}.fa-discourse:before{content:"\f393"}.fa-divide:before{content:"\f529"}.fa-dizzy:before{content:"\f567"}.fa-dna:before{content:"\f471"}.fa-dochub:before{content:"\f394"}.fa-docker:before{content:"\f395"}.fa-dog:before{content:"\f6d3"}.fa-dollar-sign:before{content:"\f155"}.fa-dolly:before{content:"\f472"}.fa-dolly-flatbed:before{content:"\f474"}.fa-donate:before{content:"\f4b9"}.fa-door-closed:before{content:"\f52a"}.fa-door-open:before{content:"\f52b"}.fa-dot-circle:before{content:"\f192"}.fa-dove:before{content:"\f4ba"}.fa-download:before{content:"\f019"}.fa-draft2digital:before{content:"\f396"}.fa-drafting-compass:before{content:"\f568"}.fa-dragon:before{content:"\f6d5"}.fa-draw-polygon:before{content:"\f5ee"}.fa-dribbble:before{content:"\f17d"}.fa-dribbble-square:before{content:"\f397"}.fa-dropbox:before{content:"\f16b"}.fa-drum:before{content:"\f569"}.fa-drum-steelpan:before{content:"\f56a"}.fa-drumstick-bite:before{content:"\f6d7"}.fa-drupal:before{content:"\f1a9"}.fa-dumbbell:before{content:"\f44b"}.fa-dumpster:before{content:"\f793"}.fa-dumpster-fire:before{content:"\f794"}.fa-dungeon:before{content:"\f6d9"}.fa-dyalog:before{content:"\f399"}.fa-earlybirds:before{content:"\f39a"}.fa-ebay:before{content:"\f4f4"}.fa-edge:before{content:"\f282"}.fa-edit:before{content:"\f044"}.fa-egg:before{content:"\f7fb"}.fa-eject:before{content:"\f052"}.fa-elementor:before{content:"\f430"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-ello:before{content:"\f5f1"}.fa-ember:before{content:"\f423"}.fa-empire:before{content:"\f1d1"}.fa-envelope:before{content:"\f0e0"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-text:before{content:"\f658"}.fa-envelope-square:before{content:"\f199"}.fa-envira:before{content:"\f299"}.fa-equals:before{content:"\f52c"}.fa-eraser:before{content:"\f12d"}.fa-erlang:before{content:"\f39d"}.fa-ethereum:before{content:"\f42e"}.fa-ethernet:before{content:"\f796"}.fa-etsy:before{content:"\f2d7"}.fa-euro-sign:before{content:"\f153"}.fa-evernote:before{content:"\f839"}.fa-exchange-alt:before{content:"\f362"}.fa-exclamation:before{content:"\f12a"}.fa-exclamation-circle:before{content:"\f06a"}.fa-exclamation-triangle:before{content:"\f071"}.fa-expand:before{content:"\f065"}.fa-expand-arrows-alt:before{content:"\f31e"}.fa-expeditedssl:before{content:"\f23e"}.fa-external-link-alt:before{content:"\f35d"}.fa-external-link-square-alt:before{content:"\f360"}.fa-eye:before{content:"\f06e"}.fa-eye-dropper:before{content:"\f1fb"}.fa-eye-slash:before{content:"\f070"}.fa-facebook:before{content:"\f09a"}.fa-facebook-f:before{content:"\f39e"}.fa-facebook-messenger:before{content:"\f39f"}.fa-facebook-square:before{content:"\f082"}.fa-fan:before{content:"\f863"}.fa-fantasy-flight-games:before{content:"\f6dc"}.fa-fast-backward:before{content:"\f049"}.fa-fast-forward:before{content:"\f050"}.fa-fax:before{content:"\f1ac"}.fa-feather:before{content:"\f52d"}.fa-feather-alt:before{content:"\f56b"}.fa-fedex:before{content:"\f797"}.fa-fedora:before{content:"\f798"}.fa-female:before{content:"\f182"}.fa-fighter-jet:before{content:"\f0fb"}.fa-figma:before{content:"\f799"}.fa-file:before{content:"\f15b"}.fa-file-alt:before{content:"\f15c"}.fa-file-archive:before{content:"\f1c6"}.fa-file-audio:before{content:"\f1c7"}.fa-file-code:before{content:"\f1c9"}.fa-file-contract:before{content:"\f56c"}.fa-file-csv:before{content:"\f6dd"}.fa-file-download:before{content:"\f56d"}.fa-file-excel:before{content:"\f1c3"}.fa-file-export:before{content:"\f56e"}.fa-file-image:before{content:"\f1c5"}.fa-file-import:before{content:"\f56f"}.fa-file-invoice:before{content:"\f570"}.fa-file-invoice-dollar:before{content:"\f571"}.fa-file-medical:before{content:"\f477"}.fa-file-medical-alt:before{content:"\f478"}.fa-file-pdf:before{content:"\f1c1"}.fa-file-powerpoint:before{content:"\f1c4"}.fa-file-prescription:before{content:"\f572"}.fa-file-signature:before{content:"\f573"}.fa-file-upload:before{content:"\f574"}.fa-file-video:before{content:"\f1c8"}.fa-file-word:before{content:"\f1c2"}.fa-fill:before{content:"\f575"}.fa-fill-drip:before{content:"\f576"}.fa-film:before{content:"\f008"}.fa-filter:before{content:"\f0b0"}.fa-fingerprint:before{content:"\f577"}.fa-fire:before{content:"\f06d"}.fa-fire-alt:before{content:"\f7e4"}.fa-fire-extinguisher:before{content:"\f134"}.fa-firefox:before{content:"\f269"}.fa-first-aid:before{content:"\f479"}.fa-first-order:before{content:"\f2b0"}.fa-first-order-alt:before{content:"\f50a"}.fa-firstdraft:before{content:"\f3a1"}.fa-fish:before{content:"\f578"}.fa-fist-raised:before{content:"\f6de"}.fa-flag:before{content:"\f024"}.fa-flag-checkered:before{content:"\f11e"}.fa-flag-usa:before{content:"\f74d"}.fa-flask:before{content:"\f0c3"}.fa-flickr:before{content:"\f16e"}.fa-flipboard:before{content:"\f44d"}.fa-flushed:before{content:"\f579"}.fa-fly:before{content:"\f417"}.fa-folder:before{content:"\f07b"}.fa-folder-minus:before{content:"\f65d"}.fa-folder-open:before{content:"\f07c"}.fa-folder-plus:before{content:"\f65e"}.fa-font:before{content:"\f031"}.fa-font-awesome:before{content:"\f2b4"}.fa-font-awesome-alt:before{content:"\f35c"}.fa-font-awesome-flag:before{content:"\f425"}.fa-font-awesome-logo-full:before{content:"\f4e6"}.fa-fonticons:before{content:"\f280"}.fa-fonticons-fi:before{content:"\f3a2"}.fa-football-ball:before{content:"\f44e"}.fa-fort-awesome:before{content:"\f286"}.fa-fort-awesome-alt:before{content:"\f3a3"}.fa-forumbee:before{content:"\f211"}.fa-forward:before{content:"\f04e"}.fa-foursquare:before{content:"\f180"}.fa-free-code-camp:before{content:"\f2c5"}.fa-freebsd:before{content:"\f3a4"}.fa-frog:before{content:"\f52e"}.fa-frown:before{content:"\f119"}.fa-frown-open:before{content:"\f57a"}.fa-fulcrum:before{content:"\f50b"}.fa-funnel-dollar:before{content:"\f662"}.fa-futbol:before{content:"\f1e3"}.fa-galactic-republic:before{content:"\f50c"}.fa-galactic-senate:before{content:"\f50d"}.fa-gamepad:before{content:"\f11b"}.fa-gas-pump:before{content:"\f52f"}.fa-gavel:before{content:"\f0e3"}.fa-gem:before{content:"\f3a5"}.fa-genderless:before{content:"\f22d"}.fa-get-pocket:before{content:"\f265"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-ghost:before{content:"\f6e2"}.fa-gift:before{content:"\f06b"}.fa-gifts:before{content:"\f79c"}.fa-git:before{content:"\f1d3"}.fa-git-alt:before{content:"\f841"}.fa-git-square:before{content:"\f1d2"}.fa-github:before{content:"\f09b"}.fa-github-alt:before{content:"\f113"}.fa-github-square:before{content:"\f092"}.fa-gitkraken:before{content:"\f3a6"}.fa-gitlab:before{content:"\f296"}.fa-gitter:before{content:"\f426"}.fa-glass-cheers:before{content:"\f79f"}.fa-glass-martini:before{content:"\f000"}.fa-glass-martini-alt:before{content:"\f57b"}.fa-glass-whiskey:before{content:"\f7a0"}.fa-glasses:before{content:"\f530"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-globe:before{content:"\f0ac"}.fa-globe-africa:before{content:"\f57c"}.fa-globe-americas:before{content:"\f57d"}.fa-globe-asia:before{content:"\f57e"}.fa-globe-europe:before{content:"\f7a2"}.fa-gofore:before{content:"\f3a7"}.fa-golf-ball:before{content:"\f450"}.fa-goodreads:before{content:"\f3a8"}.fa-goodreads-g:before{content:"\f3a9"}.fa-google:before{content:"\f1a0"}.fa-google-drive:before{content:"\f3aa"}.fa-google-play:before{content:"\f3ab"}.fa-google-plus:before{content:"\f2b3"}.fa-google-plus-g:before{content:"\f0d5"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-wallet:before{content:"\f1ee"}.fa-gopuram:before{content:"\f664"}.fa-graduation-cap:before{content:"\f19d"}.fa-gratipay:before{content:"\f184"}.fa-grav:before{content:"\f2d6"}.fa-greater-than:before{content:"\f531"}.fa-greater-than-equal:before{content:"\f532"}.fa-grimace:before{content:"\f57f"}.fa-grin:before{content:"\f580"}.fa-grin-alt:before{content:"\f581"}.fa-grin-beam:before{content:"\f582"}.fa-grin-beam-sweat:before{content:"\f583"}.fa-grin-hearts:before{content:"\f584"}.fa-grin-squint:before{content:"\f585"}.fa-grin-squint-tears:before{content:"\f586"}.fa-grin-stars:before{content:"\f587"}.fa-grin-tears:before{content:"\f588"}.fa-grin-tongue:before{content:"\f589"}.fa-grin-tongue-squint:before{content:"\f58a"}.fa-grin-tongue-wink:before{content:"\f58b"}.fa-grin-wink:before{content:"\f58c"}.fa-grip-horizontal:before{content:"\f58d"}.fa-grip-lines:before{content:"\f7a4"}.fa-grip-lines-vertical:before{content:"\f7a5"}.fa-grip-vertical:before{content:"\f58e"}.fa-gripfire:before{content:"\f3ac"}.fa-grunt:before{content:"\f3ad"}.fa-guitar:before{content:"\f7a6"}.fa-gulp:before{content:"\f3ae"}.fa-h-square:before{content:"\f0fd"}.fa-hacker-news:before{content:"\f1d4"}.fa-hacker-news-square:before{content:"\f3af"}.fa-hackerrank:before{content:"\f5f7"}.fa-hamburger:before{content:"\f805"}.fa-hammer:before{content:"\f6e3"}.fa-hamsa:before{content:"\f665"}.fa-hand-holding:before{content:"\f4bd"}.fa-hand-holding-heart:before{content:"\f4be"}.fa-hand-holding-usd:before{content:"\f4c0"}.fa-hand-lizard:before{content:"\f258"}.fa-hand-middle-finger:before{content:"\f806"}.fa-hand-paper:before{content:"\f256"}.fa-hand-peace:before{content:"\f25b"}.fa-hand-point-down:before{content:"\f0a7"}.fa-hand-point-left:before{content:"\f0a5"}.fa-hand-point-right:before{content:"\f0a4"}.fa-hand-point-up:before{content:"\f0a6"}.fa-hand-pointer:before{content:"\f25a"}.fa-hand-rock:before{content:"\f255"}.fa-hand-scissors:before{content:"\f257"}.fa-hand-spock:before{content:"\f259"}.fa-hands:before{content:"\f4c2"}.fa-hands-helping:before{content:"\f4c4"}.fa-handshake:before{content:"\f2b5"}.fa-hanukiah:before{content:"\f6e6"}.fa-hard-hat:before{content:"\f807"}.fa-hashtag:before{content:"\f292"}.fa-hat-cowboy:before{content:"\f8c0"}.fa-hat-cowboy-side:before{content:"\f8c1"}.fa-hat-wizard:before{content:"\f6e8"}.fa-haykal:before{content:"\f666"}.fa-hdd:before{content:"\f0a0"}.fa-heading:before{content:"\f1dc"}.fa-headphones:before{content:"\f025"}.fa-headphones-alt:before{content:"\f58f"}.fa-headset:before{content:"\f590"}.fa-heart:before{content:"\f004"}.fa-heart-broken:before{content:"\f7a9"}.fa-heartbeat:before{content:"\f21e"}.fa-helicopter:before{content:"\f533"}.fa-highlighter:before{content:"\f591"}.fa-hiking:before{content:"\f6ec"}.fa-hippo:before{content:"\f6ed"}.fa-hips:before{content:"\f452"}.fa-hire-a-helper:before{content:"\f3b0"}.fa-history:before{content:"\f1da"}.fa-hockey-puck:before{content:"\f453"}.fa-holly-berry:before{content:"\f7aa"}.fa-home:before{content:"\f015"}.fa-hooli:before{content:"\f427"}.fa-hornbill:before{content:"\f592"}.fa-horse:before{content:"\f6f0"}.fa-horse-head:before{content:"\f7ab"}.fa-hospital:before{content:"\f0f8"}.fa-hospital-alt:before{content:"\f47d"}.fa-hospital-symbol:before{content:"\f47e"}.fa-hot-tub:before{content:"\f593"}.fa-hotdog:before{content:"\f80f"}.fa-hotel:before{content:"\f594"}.fa-hotjar:before{content:"\f3b1"}.fa-hourglass:before{content:"\f254"}.fa-hourglass-end:before{content:"\f253"}.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-start:before{content:"\f251"}.fa-house-damage:before{content:"\f6f1"}.fa-houzz:before{content:"\f27c"}.fa-hryvnia:before{content:"\f6f2"}.fa-html5:before{content:"\f13b"}.fa-hubspot:before{content:"\f3b2"}.fa-i-cursor:before{content:"\f246"}.fa-ice-cream:before{content:"\f810"}.fa-icicles:before{content:"\f7ad"}.fa-icons:before{content:"\f86d"}.fa-id-badge:before{content:"\f2c1"}.fa-id-card:before{content:"\f2c2"}.fa-id-card-alt:before{content:"\f47f"}.fa-igloo:before{content:"\f7ae"}.fa-image:before{content:"\f03e"}.fa-images:before{content:"\f302"}.fa-imdb:before{content:"\f2d8"}.fa-inbox:before{content:"\f01c"}.fa-indent:before{content:"\f03c"}.fa-industry:before{content:"\f275"}.fa-infinity:before{content:"\f534"}.fa-info:before{content:"\f129"}.fa-info-circle:before{content:"\f05a"}.fa-instagram:before{content:"\f16d"}.fa-intercom:before{content:"\f7af"}.fa-internet-explorer:before{content:"\f26b"}.fa-invision:before{content:"\f7b0"}.fa-ioxhost:before{content:"\f208"}.fa-italic:before{content:"\f033"}.fa-itch-io:before{content:"\f83a"}.fa-itunes:before{content:"\f3b4"}.fa-itunes-note:before{content:"\f3b5"}.fa-java:before{content:"\f4e4"}.fa-jedi:before{content:"\f669"}.fa-jedi-order:before{content:"\f50e"}.fa-jenkins:before{content:"\f3b6"}.fa-jira:before{content:"\f7b1"}.fa-joget:before{content:"\f3b7"}.fa-joint:before{content:"\f595"}.fa-joomla:before{content:"\f1aa"}.fa-journal-whills:before{content:"\f66a"}.fa-js:before{content:"\f3b8"}.fa-js-square:before{content:"\f3b9"}.fa-jsfiddle:before{content:"\f1cc"}.fa-kaaba:before{content:"\f66b"}.fa-kaggle:before{content:"\f5fa"}.fa-key:before{content:"\f084"}.fa-keybase:before{content:"\f4f5"}.fa-keyboard:before{content:"\f11c"}.fa-keycdn:before{content:"\f3ba"}.fa-khanda:before{content:"\f66d"}.fa-kickstarter:before{content:"\f3bb"}.fa-kickstarter-k:before{content:"\f3bc"}.fa-kiss:before{content:"\f596"}.fa-kiss-beam:before{content:"\f597"}.fa-kiss-wink-heart:before{content:"\f598"}.fa-kiwi-bird:before{content:"\f535"}.fa-korvue:before{content:"\f42f"}.fa-landmark:before{content:"\f66f"}.fa-language:before{content:"\f1ab"}.fa-laptop:before{content:"\f109"}.fa-laptop-code:before{content:"\f5fc"}.fa-laptop-medical:before{content:"\f812"}.fa-laravel:before{content:"\f3bd"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-laugh:before{content:"\f599"}.fa-laugh-beam:before{content:"\f59a"}.fa-laugh-squint:before{content:"\f59b"}.fa-laugh-wink:before{content:"\f59c"}.fa-layer-group:before{content:"\f5fd"}.fa-leaf:before{content:"\f06c"}.fa-leanpub:before{content:"\f212"}.fa-lemon:before{content:"\f094"}.fa-less:before{content:"\f41d"}.fa-less-than:before{content:"\f536"}.fa-less-than-equal:before{content:"\f537"}.fa-level-down-alt:before{content:"\f3be"}.fa-level-up-alt:before{content:"\f3bf"}.fa-life-ring:before{content:"\f1cd"}.fa-lightbulb:before{content:"\f0eb"}.fa-line:before{content:"\f3c0"}.fa-link:before{content:"\f0c1"}.fa-linkedin:before{content:"\f08c"}.fa-linkedin-in:before{content:"\f0e1"}.fa-linode:before{content:"\f2b8"}.fa-linux:before{content:"\f17c"}.fa-lira-sign:before{content:"\f195"}.fa-list:before{content:"\f03a"}.fa-list-alt:before{content:"\f022"}.fa-list-ol:before{content:"\f0cb"}.fa-list-ul:before{content:"\f0ca"}.fa-location-arrow:before{content:"\f124"}.fa-lock:before{content:"\f023"}.fa-lock-open:before{content:"\f3c1"}.fa-long-arrow-alt-down:before{content:"\f309"}.fa-long-arrow-alt-left:before{content:"\f30a"}.fa-long-arrow-alt-right:before{content:"\f30b"}.fa-long-arrow-alt-up:before{content:"\f30c"}.fa-low-vision:before{content:"\f2a8"}.fa-luggage-cart:before{content:"\f59d"}.fa-lyft:before{content:"\f3c3"}.fa-magento:before{content:"\f3c4"}.fa-magic:before{content:"\f0d0"}.fa-magnet:before{content:"\f076"}.fa-mail-bulk:before{content:"\f674"}.fa-mailchimp:before{content:"\f59e"}.fa-male:before{content:"\f183"}.fa-mandalorian:before{content:"\f50f"}.fa-map:before{content:"\f279"}.fa-map-marked:before{content:"\f59f"}.fa-map-marked-alt:before{content:"\f5a0"}.fa-map-marker:before{content:"\f041"}.fa-map-marker-alt:before{content:"\f3c5"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-markdown:before{content:"\f60f"}.fa-marker:before{content:"\f5a1"}.fa-mars:before{content:"\f222"}.fa-mars-double:before{content:"\f227"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mask:before{content:"\f6fa"}.fa-mastodon:before{content:"\f4f6"}.fa-maxcdn:before{content:"\f136"}.fa-mdb:before{content:"\f8ca"}.fa-medal:before{content:"\f5a2"}.fa-medapps:before{content:"\f3c6"}.fa-medium:before{content:"\f23a"}.fa-medium-m:before{content:"\f3c7"}.fa-medkit:before{content:"\f0fa"}.fa-medrt:before{content:"\f3c8"}.fa-meetup:before{content:"\f2e0"}.fa-megaport:before{content:"\f5a3"}.fa-meh:before{content:"\f11a"}.fa-meh-blank:before{content:"\f5a4"}.fa-meh-rolling-eyes:before{content:"\f5a5"}.fa-memory:before{content:"\f538"}.fa-mendeley:before{content:"\f7b3"}.fa-menorah:before{content:"\f676"}.fa-mercury:before{content:"\f223"}.fa-meteor:before{content:"\f753"}.fa-microchip:before{content:"\f2db"}.fa-microphone:before{content:"\f130"}.fa-microphone-alt:before{content:"\f3c9"}.fa-microphone-alt-slash:before{content:"\f539"}.fa-microphone-slash:before{content:"\f131"}.fa-microscope:before{content:"\f610"}.fa-microsoft:before{content:"\f3ca"}.fa-minus:before{content:"\f068"}.fa-minus-circle:before{content:"\f056"}.fa-minus-square:before{content:"\f146"}.fa-mitten:before{content:"\f7b5"}.fa-mix:before{content:"\f3cb"}.fa-mixcloud:before{content:"\f289"}.fa-mizuni:before{content:"\f3cc"}.fa-mobile:before{content:"\f10b"}.fa-mobile-alt:before{content:"\f3cd"}.fa-modx:before{content:"\f285"}.fa-monero:before{content:"\f3d0"}.fa-money-bill:before{content:"\f0d6"}.fa-money-bill-alt:before{content:"\f3d1"}.fa-money-bill-wave:before{content:"\f53a"}.fa-money-bill-wave-alt:before{content:"\f53b"}.fa-money-check:before{content:"\f53c"}.fa-money-check-alt:before{content:"\f53d"}.fa-monument:before{content:"\f5a6"}.fa-moon:before{content:"\f186"}.fa-mortar-pestle:before{content:"\f5a7"}.fa-mosque:before{content:"\f678"}.fa-motorcycle:before{content:"\f21c"}.fa-mountain:before{content:"\f6fc"}.fa-mouse:before{content:"\f8cc"}.fa-mouse-pointer:before{content:"\f245"}.fa-mug-hot:before{content:"\f7b6"}.fa-music:before{content:"\f001"}.fa-napster:before{content:"\f3d2"}.fa-neos:before{content:"\f612"}.fa-network-wired:before{content:"\f6ff"}.fa-neuter:before{content:"\f22c"}.fa-newspaper:before{content:"\f1ea"}.fa-nimblr:before{content:"\f5a8"}.fa-node:before{content:"\f419"}.fa-node-js:before{content:"\f3d3"}.fa-not-equal:before{content:"\f53e"}.fa-notes-medical:before{content:"\f481"}.fa-npm:before{content:"\f3d4"}.fa-ns8:before{content:"\f3d5"}.fa-nutritionix:before{content:"\f3d6"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-oil-can:before{content:"\f613"}.fa-old-republic:before{content:"\f510"}.fa-om:before{content:"\f679"}.fa-opencart:before{content:"\f23d"}.fa-openid:before{content:"\f19b"}.fa-opera:before{content:"\f26a"}.fa-optin-monster:before{content:"\f23c"}.fa-orcid:before{content:"\f8d2"}.fa-osi:before{content:"\f41a"}.fa-otter:before{content:"\f700"}.fa-outdent:before{content:"\f03b"}.fa-page4:before{content:"\f3d7"}.fa-pagelines:before{content:"\f18c"}.fa-pager:before{content:"\f815"}.fa-paint-brush:before{content:"\f1fc"}.fa-paint-roller:before{content:"\f5aa"}.fa-palette:before{content:"\f53f"}.fa-palfed:before{content:"\f3d8"}.fa-pallet:before{content:"\f482"}.fa-paper-plane:before{content:"\f1d8"}.fa-paperclip:before{content:"\f0c6"}.fa-parachute-box:before{content:"\f4cd"}.fa-paragraph:before{content:"\f1dd"}.fa-parking:before{content:"\f540"}.fa-passport:before{content:"\f5ab"}.fa-pastafarianism:before{content:"\f67b"}.fa-paste:before{content:"\f0ea"}.fa-patreon:before{content:"\f3d9"}.fa-pause:before{content:"\f04c"}.fa-pause-circle:before{content:"\f28b"}.fa-paw:before{content:"\f1b0"}.fa-paypal:before{content:"\f1ed"}.fa-peace:before{content:"\f67c"}.fa-pen:before{content:"\f304"}.fa-pen-alt:before{content:"\f305"}.fa-pen-fancy:before{content:"\f5ac"}.fa-pen-nib:before{content:"\f5ad"}.fa-pen-square:before{content:"\f14b"}.fa-pencil-alt:before{content:"\f303"}.fa-pencil-ruler:before{content:"\f5ae"}.fa-penny-arcade:before{content:"\f704"}.fa-people-carry:before{content:"\f4ce"}.fa-pepper-hot:before{content:"\f816"}.fa-percent:before{content:"\f295"}.fa-percentage:before{content:"\f541"}.fa-periscope:before{content:"\f3da"}.fa-person-booth:before{content:"\f756"}.fa-phabricator:before{content:"\f3db"}.fa-phoenix-framework:before{content:"\f3dc"}.fa-phoenix-squadron:before{content:"\f511"}.fa-phone:before{content:"\f095"}.fa-phone-alt:before{content:"\f879"}.fa-phone-slash:before{content:"\f3dd"}.fa-phone-square:before{content:"\f098"}.fa-phone-square-alt:before{content:"\f87b"}.fa-phone-volume:before{content:"\f2a0"}.fa-photo-video:before{content:"\f87c"}.fa-php:before{content:"\f457"}.fa-pied-piper:before{content:"\f2ae"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-pied-piper-hat:before{content:"\f4e5"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-piggy-bank:before{content:"\f4d3"}.fa-pills:before{content:"\f484"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-p:before{content:"\f231"}.fa-pinterest-square:before{content:"\f0d3"}.fa-pizza-slice:before{content:"\f818"}.fa-place-of-worship:before{content:"\f67f"}.fa-plane:before{content:"\f072"}.fa-plane-arrival:before{content:"\f5af"}.fa-plane-departure:before{content:"\f5b0"}.fa-play:before{content:"\f04b"}.fa-play-circle:before{content:"\f144"}.fa-playstation:before{content:"\f3df"}.fa-plug:before{content:"\f1e6"}.fa-plus:before{content:"\f067"}.fa-plus-circle:before{content:"\f055"}.fa-plus-square:before{content:"\f0fe"}.fa-podcast:before{content:"\f2ce"}.fa-poll:before{content:"\f681"}.fa-poll-h:before{content:"\f682"}.fa-poo:before{content:"\f2fe"}.fa-poo-storm:before{content:"\f75a"}.fa-poop:before{content:"\f619"}.fa-portrait:before{content:"\f3e0"}.fa-pound-sign:before{content:"\f154"}.fa-power-off:before{content:"\f011"}.fa-pray:before{content:"\f683"}.fa-praying-hands:before{content:"\f684"}.fa-prescription:before{content:"\f5b1"}.fa-prescription-bottle:before{content:"\f485"}.fa-prescription-bottle-alt:before{content:"\f486"}.fa-print:before{content:"\f02f"}.fa-procedures:before{content:"\f487"}.fa-product-hunt:before{content:"\f288"}.fa-project-diagram:before{content:"\f542"}.fa-pushed:before{content:"\f3e1"}.fa-puzzle-piece:before{content:"\f12e"}.fa-python:before{content:"\f3e2"}.fa-qq:before{content:"\f1d6"}.fa-qrcode:before{content:"\f029"}.fa-question:before{content:"\f128"}.fa-question-circle:before{content:"\f059"}.fa-quidditch:before{content:"\f458"}.fa-quinscape:before{content:"\f459"}.fa-quora:before{content:"\f2c4"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-quran:before{content:"\f687"}.fa-r-project:before{content:"\f4f7"}.fa-radiation:before{content:"\f7b9"}.fa-radiation-alt:before{content:"\f7ba"}.fa-rainbow:before{content:"\f75b"}.fa-random:before{content:"\f074"}.fa-raspberry-pi:before{content:"\f7bb"}.fa-ravelry:before{content:"\f2d9"}.fa-react:before{content:"\f41b"}.fa-reacteurope:before{content:"\f75d"}.fa-readme:before{content:"\f4d5"}.fa-rebel:before{content:"\f1d0"}.fa-receipt:before{content:"\f543"}.fa-record-vinyl:before{content:"\f8d9"}.fa-recycle:before{content:"\f1b8"}.fa-red-river:before{content:"\f3e3"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-alien:before{content:"\f281"}.fa-reddit-square:before{content:"\f1a2"}.fa-redhat:before{content:"\f7bc"}.fa-redo:before{content:"\f01e"}.fa-redo-alt:before{content:"\f2f9"}.fa-registered:before{content:"\f25d"}.fa-remove-format:before{content:"\f87d"}.fa-renren:before{content:"\f18b"}.fa-reply:before{content:"\f3e5"}.fa-reply-all:before{content:"\f122"}.fa-replyd:before{content:"\f3e6"}.fa-republican:before{content:"\f75e"}.fa-researchgate:before{content:"\f4f8"}.fa-resolving:before{content:"\f3e7"}.fa-restroom:before{content:"\f7bd"}.fa-retweet:before{content:"\f079"}.fa-rev:before{content:"\f5b2"}.fa-ribbon:before{content:"\f4d6"}.fa-ring:before{content:"\f70b"}.fa-road:before{content:"\f018"}.fa-robot:before{content:"\f544"}.fa-rocket:before{content:"\f135"}.fa-rocketchat:before{content:"\f3e8"}.fa-rockrms:before{content:"\f3e9"}.fa-route:before{content:"\f4d7"}.fa-rss:before{content:"\f09e"}.fa-rss-square:before{content:"\f143"}.fa-ruble-sign:before{content:"\f158"}.fa-ruler:before{content:"\f545"}.fa-ruler-combined:before{content:"\f546"}.fa-ruler-horizontal:before{content:"\f547"}.fa-ruler-vertical:before{content:"\f548"}.fa-running:before{content:"\f70c"}.fa-rupee-sign:before{content:"\f156"}.fa-sad-cry:before{content:"\f5b3"}.fa-sad-tear:before{content:"\f5b4"}.fa-safari:before{content:"\f267"}.fa-salesforce:before{content:"\f83b"}.fa-sass:before{content:"\f41e"}.fa-satellite:before{content:"\f7bf"}.fa-satellite-dish:before{content:"\f7c0"}.fa-save:before{content:"\f0c7"}.fa-schlix:before{content:"\f3ea"}.fa-school:before{content:"\f549"}.fa-screwdriver:before{content:"\f54a"}.fa-scribd:before{content:"\f28a"}.fa-scroll:before{content:"\f70e"}.fa-sd-card:before{content:"\f7c2"}.fa-search:before{content:"\f002"}.fa-search-dollar:before{content:"\f688"}.fa-search-location:before{content:"\f689"}.fa-search-minus:before{content:"\f010"}.fa-search-plus:before{content:"\f00e"}.fa-searchengin:before{content:"\f3eb"}.fa-seedling:before{content:"\f4d8"}.fa-sellcast:before{content:"\f2da"}.fa-sellsy:before{content:"\f213"}.fa-server:before{content:"\f233"}.fa-servicestack:before{content:"\f3ec"}.fa-shapes:before{content:"\f61f"}.fa-share:before{content:"\f064"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-share-square:before{content:"\f14d"}.fa-shekel-sign:before{content:"\f20b"}.fa-shield-alt:before{content:"\f3ed"}.fa-ship:before{content:"\f21a"}.fa-shipping-fast:before{content:"\f48b"}.fa-shirtsinbulk:before{content:"\f214"}.fa-shoe-prints:before{content:"\f54b"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-shopping-cart:before{content:"\f07a"}.fa-shopware:before{content:"\f5b5"}.fa-shower:before{content:"\f2cc"}.fa-shuttle-van:before{content:"\f5b6"}.fa-sign:before{content:"\f4d9"}.fa-sign-in-alt:before{content:"\f2f6"}.fa-sign-language:before{content:"\f2a7"}.fa-sign-out-alt:before{content:"\f2f5"}.fa-signal:before{content:"\f012"}.fa-signature:before{content:"\f5b7"}.fa-sim-card:before{content:"\f7c4"}.fa-simplybuilt:before{content:"\f215"}.fa-sistrix:before{content:"\f3ee"}.fa-sitemap:before{content:"\f0e8"}.fa-sith:before{content:"\f512"}.fa-skating:before{content:"\f7c5"}.fa-sketch:before{content:"\f7c6"}.fa-skiing:before{content:"\f7c9"}.fa-skiing-nordic:before{content:"\f7ca"}.fa-skull:before{content:"\f54c"}.fa-skull-crossbones:before{content:"\f714"}.fa-skyatlas:before{content:"\f216"}.fa-skype:before{content:"\f17e"}.fa-slack:before{content:"\f198"}.fa-slack-hash:before{content:"\f3ef"}.fa-slash:before{content:"\f715"}.fa-sleigh:before{content:"\f7cc"}.fa-sliders-h:before{content:"\f1de"}.fa-slideshare:before{content:"\f1e7"}.fa-smile:before{content:"\f118"}.fa-smile-beam:before{content:"\f5b8"}.fa-smile-wink:before{content:"\f4da"}.fa-smog:before{content:"\f75f"}.fa-smoking:before{content:"\f48d"}.fa-smoking-ban:before{content:"\f54d"}.fa-sms:before{content:"\f7cd"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-snowboarding:before{content:"\f7ce"}.fa-snowflake:before{content:"\f2dc"}.fa-snowman:before{content:"\f7d0"}.fa-snowplow:before{content:"\f7d2"}.fa-socks:before{content:"\f696"}.fa-solar-panel:before{content:"\f5ba"}.fa-sort:before{content:"\f0dc"}.fa-sort-alpha-down:before{content:"\f15d"}.fa-sort-alpha-down-alt:before{content:"\f881"}.fa-sort-alpha-up:before{content:"\f15e"}.fa-sort-alpha-up-alt:before{content:"\f882"}.fa-sort-amount-down:before{content:"\f160"}.fa-sort-amount-down-alt:before{content:"\f884"}.fa-sort-amount-up:before{content:"\f161"}.fa-sort-amount-up-alt:before{content:"\f885"}.fa-sort-down:before{content:"\f0dd"}.fa-sort-numeric-down:before{content:"\f162"}.fa-sort-numeric-down-alt:before{content:"\f886"}.fa-sort-numeric-up:before{content:"\f163"}.fa-sort-numeric-up-alt:before{content:"\f887"}.fa-sort-up:before{content:"\f0de"}.fa-soundcloud:before{content:"\f1be"}.fa-sourcetree:before{content:"\f7d3"}.fa-spa:before{content:"\f5bb"}.fa-space-shuttle:before{content:"\f197"}.fa-speakap:before{content:"\f3f3"}.fa-speaker-deck:before{content:"\f83c"}.fa-spell-check:before{content:"\f891"}.fa-spider:before{content:"\f717"}.fa-spinner:before{content:"\f110"}.fa-splotch:before{content:"\f5bc"}.fa-spotify:before{content:"\f1bc"}.fa-spray-can:before{content:"\f5bd"}.fa-square:before{content:"\f0c8"}.fa-square-full:before{content:"\f45c"}.fa-square-root-alt:before{content:"\f698"}.fa-squarespace:before{content:"\f5be"}.fa-stack-exchange:before{content:"\f18d"}.fa-stack-overflow:before{content:"\f16c"}.fa-stackpath:before{content:"\f842"}.fa-stamp:before{content:"\f5bf"}.fa-star:before{content:"\f005"}.fa-star-and-crescent:before{content:"\f699"}.fa-star-half:before{content:"\f089"}.fa-star-half-alt:before{content:"\f5c0"}.fa-star-of-david:before{content:"\f69a"}.fa-star-of-life:before{content:"\f621"}.fa-staylinked:before{content:"\f3f5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-steam-symbol:before{content:"\f3f6"}.fa-step-backward:before{content:"\f048"}.fa-step-forward:before{content:"\f051"}.fa-stethoscope:before{content:"\f0f1"}.fa-sticker-mule:before{content:"\f3f7"}.fa-sticky-note:before{content:"\f249"}.fa-stop:before{content:"\f04d"}.fa-stop-circle:before{content:"\f28d"}.fa-stopwatch:before{content:"\f2f2"}.fa-store:before{content:"\f54e"}.fa-store-alt:before{content:"\f54f"}.fa-strava:before{content:"\f428"}.fa-stream:before{content:"\f550"}.fa-street-view:before{content:"\f21d"}.fa-strikethrough:before{content:"\f0cc"}.fa-stripe:before{content:"\f429"}.fa-stripe-s:before{content:"\f42a"}.fa-stroopwafel:before{content:"\f551"}.fa-studiovinari:before{content:"\f3f8"}.fa-stumbleupon:before{content:"\f1a4"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-subscript:before{content:"\f12c"}.fa-subway:before{content:"\f239"}.fa-suitcase:before{content:"\f0f2"}.fa-suitcase-rolling:before{content:"\f5c1"}.fa-sun:before{content:"\f185"}.fa-superpowers:before{content:"\f2dd"}.fa-superscript:before{content:"\f12b"}.fa-supple:before{content:"\f3f9"}.fa-surprise:before{content:"\f5c2"}.fa-suse:before{content:"\f7d6"}.fa-swatchbook:before{content:"\f5c3"}.fa-swift:before{content:"\f8e1"}.fa-swimmer:before{content:"\f5c4"}.fa-swimming-pool:before{content:"\f5c5"}.fa-symfony:before{content:"\f83d"}.fa-synagogue:before{content:"\f69b"}.fa-sync:before{content:"\f021"}.fa-sync-alt:before{content:"\f2f1"}.fa-syringe:before{content:"\f48e"}.fa-table:before{content:"\f0ce"}.fa-table-tennis:before{content:"\f45d"}.fa-tablet:before{content:"\f10a"}.fa-tablet-alt:before{content:"\f3fa"}.fa-tablets:before{content:"\f490"}.fa-tachometer-alt:before{content:"\f3fd"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-tape:before{content:"\f4db"}.fa-tasks:before{content:"\f0ae"}.fa-taxi:before{content:"\f1ba"}.fa-teamspeak:before{content:"\f4f9"}.fa-teeth:before{content:"\f62e"}.fa-teeth-open:before{content:"\f62f"}.fa-telegram:before{content:"\f2c6"}.fa-telegram-plane:before{content:"\f3fe"}.fa-temperature-high:before{content:"\f769"}.fa-temperature-low:before{content:"\f76b"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-tenge:before{content:"\f7d7"}.fa-terminal:before{content:"\f120"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-th:before{content:"\f00a"}.fa-th-large:before{content:"\f009"}.fa-th-list:before{content:"\f00b"}.fa-the-red-yeti:before{content:"\f69d"}.fa-theater-masks:before{content:"\f630"}.fa-themeco:before{content:"\f5c6"}.fa-themeisle:before{content:"\f2b2"}.fa-thermometer:before{content:"\f491"}.fa-thermometer-empty:before{content:"\f2cb"}.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-think-peaks:before{content:"\f731"}.fa-thumbs-down:before{content:"\f165"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbtack:before{content:"\f08d"}.fa-ticket-alt:before{content:"\f3ff"}.fa-times:before{content:"\f00d"}.fa-times-circle:before{content:"\f057"}.fa-tint:before{content:"\f043"}.fa-tint-slash:before{content:"\f5c7"}.fa-tired:before{content:"\f5c8"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-toilet:before{content:"\f7d8"}.fa-toilet-paper:before{content:"\f71e"}.fa-toolbox:before{content:"\f552"}.fa-tools:before{content:"\f7d9"}.fa-tooth:before{content:"\f5c9"}.fa-torah:before{content:"\f6a0"}.fa-torii-gate:before{content:"\f6a1"}.fa-tractor:before{content:"\f722"}.fa-trade-federation:before{content:"\f513"}.fa-trademark:before{content:"\f25c"}.fa-traffic-light:before{content:"\f637"}.fa-train:before{content:"\f238"}.fa-tram:before{content:"\f7da"}.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-trash:before{content:"\f1f8"}.fa-trash-alt:before{content:"\f2ed"}.fa-trash-restore:before{content:"\f829"}.fa-trash-restore-alt:before{content:"\f82a"}.fa-tree:before{content:"\f1bb"}.fa-trello:before{content:"\f181"}.fa-tripadvisor:before{content:"\f262"}.fa-trophy:before{content:"\f091"}.fa-truck:before{content:"\f0d1"}.fa-truck-loading:before{content:"\f4de"}.fa-truck-monster:before{content:"\f63b"}.fa-truck-moving:before{content:"\f4df"}.fa-truck-pickup:before{content:"\f63c"}.fa-tshirt:before{content:"\f553"}.fa-tty:before{content:"\f1e4"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-tv:before{content:"\f26c"}.fa-twitch:before{content:"\f1e8"}.fa-twitter:before{content:"\f099"}.fa-twitter-square:before{content:"\f081"}.fa-typo3:before{content:"\f42b"}.fa-uber:before{content:"\f402"}.fa-ubuntu:before{content:"\f7df"}.fa-uikit:before{content:"\f403"}.fa-umbraco:before{content:"\f8e8"}.fa-umbrella:before{content:"\f0e9"}.fa-umbrella-beach:before{content:"\f5ca"}.fa-underline:before{content:"\f0cd"}.fa-undo:before{content:"\f0e2"}.fa-undo-alt:before{content:"\f2ea"}.fa-uniregistry:before{content:"\f404"}.fa-universal-access:before{content:"\f29a"}.fa-university:before{content:"\f19c"}.fa-unlink:before{content:"\f127"}.fa-unlock:before{content:"\f09c"}.fa-unlock-alt:before{content:"\f13e"}.fa-untappd:before{content:"\f405"}.fa-upload:before{content:"\f093"}.fa-ups:before{content:"\f7e0"}.fa-usb:before{content:"\f287"}.fa-user:before{content:"\f007"}.fa-user-alt:before{content:"\f406"}.fa-user-alt-slash:before{content:"\f4fa"}.fa-user-astronaut:before{content:"\f4fb"}.fa-user-check:before{content:"\f4fc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-clock:before{content:"\f4fd"}.fa-user-cog:before{content:"\f4fe"}.fa-user-edit:before{content:"\f4ff"}.fa-user-friends:before{content:"\f500"}.fa-user-graduate:before{content:"\f501"}.fa-user-injured:before{content:"\f728"}.fa-user-lock:before{content:"\f502"}.fa-user-md:before{content:"\f0f0"}.fa-user-minus:before{content:"\f503"}.fa-user-ninja:before{content:"\f504"}.fa-user-nurse:before{content:"\f82f"}.fa-user-plus:before{content:"\f234"}.fa-user-secret:before{content:"\f21b"}.fa-user-shield:before{content:"\f505"}.fa-user-slash:before{content:"\f506"}.fa-user-tag:before{content:"\f507"}.fa-user-tie:before{content:"\f508"}.fa-user-times:before{content:"\f235"}.fa-users:before{content:"\f0c0"}.fa-users-cog:before{content:"\f509"}.fa-usps:before{content:"\f7e1"}.fa-ussunnah:before{content:"\f407"}.fa-utensil-spoon:before{content:"\f2e5"}.fa-utensils:before{content:"\f2e7"}.fa-vaadin:before{content:"\f408"}.fa-vector-square:before{content:"\f5cb"}.fa-venus:before{content:"\f221"}.fa-venus-double:before{content:"\f226"}.fa-venus-mars:before{content:"\f228"}.fa-viacoin:before{content:"\f237"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-vial:before{content:"\f492"}.fa-vials:before{content:"\f493"}.fa-viber:before{content:"\f409"}.fa-video:before{content:"\f03d"}.fa-video-slash:before{content:"\f4e2"}.fa-vihara:before{content:"\f6a7"}.fa-vimeo:before{content:"\f40a"}.fa-vimeo-square:before{content:"\f194"}.fa-vimeo-v:before{content:"\f27d"}.fa-vine:before{content:"\f1ca"}.fa-vk:before{content:"\f189"}.fa-vnv:before{content:"\f40b"}.fa-voicemail:before{content:"\f897"}.fa-volleyball-ball:before{content:"\f45f"}.fa-volume-down:before{content:"\f027"}.fa-volume-mute:before{content:"\f6a9"}.fa-volume-off:before{content:"\f026"}.fa-volume-up:before{content:"\f028"}.fa-vote-yea:before{content:"\f772"}.fa-vr-cardboard:before{content:"\f729"}.fa-vuejs:before{content:"\f41f"}.fa-walking:before{content:"\f554"}.fa-wallet:before{content:"\f555"}.fa-warehouse:before{content:"\f494"}.fa-water:before{content:"\f773"}.fa-wave-square:before{content:"\f83e"}.fa-waze:before{content:"\f83f"}.fa-weebly:before{content:"\f5cc"}.fa-weibo:before{content:"\f18a"}.fa-weight:before{content:"\f496"}.fa-weight-hanging:before{content:"\f5cd"}.fa-weixin:before{content:"\f1d7"}.fa-whatsapp:before{content:"\f232"}.fa-whatsapp-square:before{content:"\f40c"}.fa-wheelchair:before{content:"\f193"}.fa-whmcs:before{content:"\f40d"}.fa-wifi:before{content:"\f1eb"}.fa-wikipedia-w:before{content:"\f266"}.fa-wind:before{content:"\f72e"}.fa-window-close:before{content:"\f410"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-windows:before{content:"\f17a"}.fa-wine-bottle:before{content:"\f72f"}.fa-wine-glass:before{content:"\f4e3"}.fa-wine-glass-alt:before{content:"\f5ce"}.fa-wix:before{content:"\f5cf"}.fa-wizards-of-the-coast:before{content:"\f730"}.fa-wolf-pack-battalion:before{content:"\f514"}.fa-won-sign:before{content:"\f159"}.fa-wordpress:before{content:"\f19a"}.fa-wordpress-simple:before{content:"\f411"}.fa-wpbeginner:before{content:"\f297"}.fa-wpexplorer:before{content:"\f2de"}.fa-wpforms:before{content:"\f298"}.fa-wpressr:before{content:"\f3e4"}.fa-wrench:before{content:"\f0ad"}.fa-x-ray:before{content:"\f497"}.fa-xbox:before{content:"\f412"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-y-combinator:before{content:"\f23b"}.fa-yahoo:before{content:"\f19e"}.fa-yammer:before{content:"\f840"}.fa-yandex:before{content:"\f413"}.fa-yandex-international:before{content:"\f414"}.fa-yarn:before{content:"\f7e3"}.fa-yelp:before{content:"\f1e9"}.fa-yen-sign:before{content:"\f157"}.fa-yin-yang:before{content:"\f6ad"}.fa-yoast:before{content:"\f2b1"}.fa-youtube:before{content:"\f167"}.fa-youtube-square:before{content:"\f431"}.fa-zhihu:before{content:"\f63f"}.sr-only{border:0;clip:rect(0, 0, 0, 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.sr-only-focusable:active,.sr-only-focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}
diff --git a/x2engine/css/lib/scss/regular.css b/x2engine/css/lib/scss/regular.css
new file mode 100644
index 000000000..1c1005bbf
--- /dev/null
+++ b/x2engine/css/lib/scss/regular.css
@@ -0,0 +1,4 @@
+/*!
+ * Font Awesome Free 5.11.2 by @fontawesome - https://fontawesome.com
+ * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
+ */@font-face{font-family:'Font Awesome 5 Free';font-style:normal;font-weight:400;font-display:auto;src:url("../../../themes/x2engine/css/fontAwesome/webfonts/fa-regular-400.eot");src:url("../../../themes/x2engine/css/fontAwesome/webfonts/fa-regular-400.eot?#iefix") format("embedded-opentype"),url("../../../themes/x2engine/css/fontAwesome/webfonts/fa-regular-400.woff2") format("woff2"),url("../../../themes/x2engine/css/fontAwesome/webfonts/fa-regular-400.woff") format("woff"),url("../../../themes/x2engine/css/fontAwesome/webfonts/fa-regular-400.ttf") format("truetype"),url("../../../themes/x2engine/css/fontAwesome/webfonts/fa-regular-400.svg#fontawesome") format("svg")}.far{font-family:'Font Awesome 5 Free';font-weight:400}
diff --git a/x2engine/css/lib/scss/solid.css b/x2engine/css/lib/scss/solid.css
new file mode 100644
index 000000000..39930b500
--- /dev/null
+++ b/x2engine/css/lib/scss/solid.css
@@ -0,0 +1,4 @@
+/*!
+ * Font Awesome Free 5.11.2 by @fontawesome - https://fontawesome.com
+ * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
+ */@font-face{font-family:'Font Awesome 5 Free';font-style:normal;font-weight:900;font-display:auto;src:url("../../../themes/x2engine/css/fontAwesome/webfonts/fa-solid-900.eot");src:url("../../../themes/x2engine/css/fontAwesome/webfonts/fa-solid-900.eot?#iefix") format("embedded-opentype"),url("../../../themes/x2engine/css/fontAwesome/webfonts/fa-solid-900.woff2") format("woff2"),url("../../../themes/x2engine/css/fontAwesome/webfonts/fa-solid-900.woff") format("woff"),url("../../../themes/x2engine/css/fontAwesome/webfonts/fa-solid-900.ttf") format("truetype"),url("../../../themes/x2engine/css/fontAwesome/webfonts/fa-solid-900.svg#fontawesome") format("svg")}.fa,.fas{font-family:'Font Awesome 5 Free';font-weight:900}
diff --git a/x2engine/css/lib/scss/v4-shims.css b/x2engine/css/lib/scss/v4-shims.css
new file mode 100644
index 000000000..577c8e5f7
--- /dev/null
+++ b/x2engine/css/lib/scss/v4-shims.css
@@ -0,0 +1,4 @@
+/*!
+ * Font Awesome Free 5.11.2 by @fontawesome - https://fontawesome.com
+ * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
+ */.fa.fa-glass:before{content:"\f000"}.fa.fa-meetup{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-star-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-star-o:before{content:"\f005"}.fa.fa-remove:before{content:"\f00d"}.fa.fa-close:before{content:"\f00d"}.fa.fa-gear:before{content:"\f013"}.fa.fa-trash-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-trash-o:before{content:"\f2ed"}.fa.fa-file-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-file-o:before{content:"\f15b"}.fa.fa-clock-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-clock-o:before{content:"\f017"}.fa.fa-arrow-circle-o-down{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-arrow-circle-o-down:before{content:"\f358"}.fa.fa-arrow-circle-o-up{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-arrow-circle-o-up:before{content:"\f35b"}.fa.fa-play-circle-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-play-circle-o:before{content:"\f144"}.fa.fa-repeat:before{content:"\f01e"}.fa.fa-rotate-right:before{content:"\f01e"}.fa.fa-refresh:before{content:"\f021"}.fa.fa-list-alt{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-dedent:before{content:"\f03b"}.fa.fa-video-camera:before{content:"\f03d"}.fa.fa-picture-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-picture-o:before{content:"\f03e"}.fa.fa-photo{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-photo:before{content:"\f03e"}.fa.fa-image{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-image:before{content:"\f03e"}.fa.fa-pencil:before{content:"\f303"}.fa.fa-map-marker:before{content:"\f3c5"}.fa.fa-pencil-square-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-pencil-square-o:before{content:"\f044"}.fa.fa-share-square-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-share-square-o:before{content:"\f14d"}.fa.fa-check-square-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-check-square-o:before{content:"\f14a"}.fa.fa-arrows:before{content:"\f0b2"}.fa.fa-times-circle-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-times-circle-o:before{content:"\f057"}.fa.fa-check-circle-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-check-circle-o:before{content:"\f058"}.fa.fa-mail-forward:before{content:"\f064"}.fa.fa-eye{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-eye-slash{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-warning:before{content:"\f071"}.fa.fa-calendar:before{content:"\f073"}.fa.fa-arrows-v:before{content:"\f338"}.fa.fa-arrows-h:before{content:"\f337"}.fa.fa-bar-chart{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-bar-chart:before{content:"\f080"}.fa.fa-bar-chart-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-bar-chart-o:before{content:"\f080"}.fa.fa-twitter-square{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-facebook-square{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-gears:before{content:"\f085"}.fa.fa-thumbs-o-up{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-thumbs-o-up:before{content:"\f164"}.fa.fa-thumbs-o-down{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-thumbs-o-down:before{content:"\f165"}.fa.fa-heart-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-heart-o:before{content:"\f004"}.fa.fa-sign-out:before{content:"\f2f5"}.fa.fa-linkedin-square{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-linkedin-square:before{content:"\f08c"}.fa.fa-thumb-tack:before{content:"\f08d"}.fa.fa-external-link:before{content:"\f35d"}.fa.fa-sign-in:before{content:"\f2f6"}.fa.fa-github-square{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-lemon-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-lemon-o:before{content:"\f094"}.fa.fa-square-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-square-o:before{content:"\f0c8"}.fa.fa-bookmark-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-bookmark-o:before{content:"\f02e"}.fa.fa-twitter{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-facebook{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-facebook:before{content:"\f39e"}.fa.fa-facebook-f{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-facebook-f:before{content:"\f39e"}.fa.fa-github{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-credit-card{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-feed:before{content:"\f09e"}.fa.fa-hdd-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-hdd-o:before{content:"\f0a0"}.fa.fa-hand-o-right{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-hand-o-right:before{content:"\f0a4"}.fa.fa-hand-o-left{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-hand-o-left:before{content:"\f0a5"}.fa.fa-hand-o-up{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-hand-o-up:before{content:"\f0a6"}.fa.fa-hand-o-down{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-hand-o-down:before{content:"\f0a7"}.fa.fa-arrows-alt:before{content:"\f31e"}.fa.fa-group:before{content:"\f0c0"}.fa.fa-chain:before{content:"\f0c1"}.fa.fa-scissors:before{content:"\f0c4"}.fa.fa-files-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-files-o:before{content:"\f0c5"}.fa.fa-floppy-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-floppy-o:before{content:"\f0c7"}.fa.fa-navicon:before{content:"\f0c9"}.fa.fa-reorder:before{content:"\f0c9"}.fa.fa-pinterest{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-pinterest-square{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-google-plus-square{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-google-plus{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-google-plus:before{content:"\f0d5"}.fa.fa-money{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-money:before{content:"\f3d1"}.fa.fa-unsorted:before{content:"\f0dc"}.fa.fa-sort-desc:before{content:"\f0dd"}.fa.fa-sort-asc:before{content:"\f0de"}.fa.fa-linkedin{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-linkedin:before{content:"\f0e1"}.fa.fa-rotate-left:before{content:"\f0e2"}.fa.fa-legal:before{content:"\f0e3"}.fa.fa-tachometer:before{content:"\f3fd"}.fa.fa-dashboard:before{content:"\f3fd"}.fa.fa-comment-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-comment-o:before{content:"\f075"}.fa.fa-comments-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-comments-o:before{content:"\f086"}.fa.fa-flash:before{content:"\f0e7"}.fa.fa-clipboard{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-paste{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-paste:before{content:"\f328"}.fa.fa-lightbulb-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-lightbulb-o:before{content:"\f0eb"}.fa.fa-exchange:before{content:"\f362"}.fa.fa-cloud-download:before{content:"\f381"}.fa.fa-cloud-upload:before{content:"\f382"}.fa.fa-bell-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-bell-o:before{content:"\f0f3"}.fa.fa-cutlery:before{content:"\f2e7"}.fa.fa-file-text-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-file-text-o:before{content:"\f15c"}.fa.fa-building-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-building-o:before{content:"\f1ad"}.fa.fa-hospital-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-hospital-o:before{content:"\f0f8"}.fa.fa-tablet:before{content:"\f3fa"}.fa.fa-mobile:before{content:"\f3cd"}.fa.fa-mobile-phone:before{content:"\f3cd"}.fa.fa-circle-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-circle-o:before{content:"\f111"}.fa.fa-mail-reply:before{content:"\f3e5"}.fa.fa-github-alt{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-folder-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-folder-o:before{content:"\f07b"}.fa.fa-folder-open-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-folder-open-o:before{content:"\f07c"}.fa.fa-smile-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-smile-o:before{content:"\f118"}.fa.fa-frown-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-frown-o:before{content:"\f119"}.fa.fa-meh-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-meh-o:before{content:"\f11a"}.fa.fa-keyboard-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-keyboard-o:before{content:"\f11c"}.fa.fa-flag-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-flag-o:before{content:"\f024"}.fa.fa-mail-reply-all:before{content:"\f122"}.fa.fa-star-half-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-star-half-o:before{content:"\f089"}.fa.fa-star-half-empty{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-star-half-empty:before{content:"\f089"}.fa.fa-star-half-full{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-star-half-full:before{content:"\f089"}.fa.fa-code-fork:before{content:"\f126"}.fa.fa-chain-broken:before{content:"\f127"}.fa.fa-shield:before{content:"\f3ed"}.fa.fa-calendar-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-calendar-o:before{content:"\f133"}.fa.fa-maxcdn{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-html5{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-css3{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-ticket:before{content:"\f3ff"}.fa.fa-minus-square-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-minus-square-o:before{content:"\f146"}.fa.fa-level-up:before{content:"\f3bf"}.fa.fa-level-down:before{content:"\f3be"}.fa.fa-pencil-square:before{content:"\f14b"}.fa.fa-external-link-square:before{content:"\f360"}.fa.fa-compass{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-caret-square-o-down{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-caret-square-o-down:before{content:"\f150"}.fa.fa-toggle-down{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-toggle-down:before{content:"\f150"}.fa.fa-caret-square-o-up{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-caret-square-o-up:before{content:"\f151"}.fa.fa-toggle-up{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-toggle-up:before{content:"\f151"}.fa.fa-caret-square-o-right{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-caret-square-o-right:before{content:"\f152"}.fa.fa-toggle-right{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-toggle-right:before{content:"\f152"}.fa.fa-eur:before{content:"\f153"}.fa.fa-euro:before{content:"\f153"}.fa.fa-gbp:before{content:"\f154"}.fa.fa-usd:before{content:"\f155"}.fa.fa-dollar:before{content:"\f155"}.fa.fa-inr:before{content:"\f156"}.fa.fa-rupee:before{content:"\f156"}.fa.fa-jpy:before{content:"\f157"}.fa.fa-cny:before{content:"\f157"}.fa.fa-rmb:before{content:"\f157"}.fa.fa-yen:before{content:"\f157"}.fa.fa-rub:before{content:"\f158"}.fa.fa-ruble:before{content:"\f158"}.fa.fa-rouble:before{content:"\f158"}.fa.fa-krw:before{content:"\f159"}.fa.fa-won:before{content:"\f159"}.fa.fa-btc{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-bitcoin{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-bitcoin:before{content:"\f15a"}.fa.fa-file-text:before{content:"\f15c"}.fa.fa-sort-alpha-asc:before{content:"\f15d"}.fa.fa-sort-alpha-desc:before{content:"\f881"}.fa.fa-sort-amount-asc:before{content:"\f160"}.fa.fa-sort-amount-desc:before{content:"\f884"}.fa.fa-sort-numeric-asc:before{content:"\f162"}.fa.fa-sort-numeric-desc:before{content:"\f886"}.fa.fa-youtube-square{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-youtube{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-xing{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-xing-square{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-youtube-play{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-youtube-play:before{content:"\f167"}.fa.fa-dropbox{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-stack-overflow{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-instagram{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-flickr{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-adn{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-bitbucket{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-bitbucket-square{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-bitbucket-square:before{content:"\f171"}.fa.fa-tumblr{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-tumblr-square{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-long-arrow-down:before{content:"\f309"}.fa.fa-long-arrow-up:before{content:"\f30c"}.fa.fa-long-arrow-left:before{content:"\f30a"}.fa.fa-long-arrow-right:before{content:"\f30b"}.fa.fa-apple{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-windows{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-android{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-linux{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-dribbble{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-skype{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-foursquare{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-trello{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-gratipay{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-gittip{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-gittip:before{content:"\f184"}.fa.fa-sun-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-sun-o:before{content:"\f185"}.fa.fa-moon-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-moon-o:before{content:"\f186"}.fa.fa-vk{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-weibo{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-renren{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-pagelines{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-stack-exchange{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-arrow-circle-o-right{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-arrow-circle-o-right:before{content:"\f35a"}.fa.fa-arrow-circle-o-left{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-arrow-circle-o-left:before{content:"\f359"}.fa.fa-caret-square-o-left{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-caret-square-o-left:before{content:"\f191"}.fa.fa-toggle-left{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-toggle-left:before{content:"\f191"}.fa.fa-dot-circle-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-dot-circle-o:before{content:"\f192"}.fa.fa-vimeo-square{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-try:before{content:"\f195"}.fa.fa-turkish-lira:before{content:"\f195"}.fa.fa-plus-square-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-plus-square-o:before{content:"\f0fe"}.fa.fa-slack{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-wordpress{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-openid{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-institution:before{content:"\f19c"}.fa.fa-bank:before{content:"\f19c"}.fa.fa-mortar-board:before{content:"\f19d"}.fa.fa-yahoo{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-google{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-reddit{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-reddit-square{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-stumbleupon-circle{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-stumbleupon{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-delicious{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-digg{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-pied-piper-pp{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-pied-piper-alt{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-drupal{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-joomla{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-spoon:before{content:"\f2e5"}.fa.fa-behance{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-behance-square{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-steam{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-steam-square{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-automobile:before{content:"\f1b9"}.fa.fa-cab:before{content:"\f1ba"}.fa.fa-envelope-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-envelope-o:before{content:"\f0e0"}.fa.fa-deviantart{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-soundcloud{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-file-pdf-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-file-pdf-o:before{content:"\f1c1"}.fa.fa-file-word-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-file-word-o:before{content:"\f1c2"}.fa.fa-file-excel-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-file-excel-o:before{content:"\f1c3"}.fa.fa-file-powerpoint-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-file-powerpoint-o:before{content:"\f1c4"}.fa.fa-file-image-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-file-image-o:before{content:"\f1c5"}.fa.fa-file-photo-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-file-photo-o:before{content:"\f1c5"}.fa.fa-file-picture-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-file-picture-o:before{content:"\f1c5"}.fa.fa-file-archive-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-file-archive-o:before{content:"\f1c6"}.fa.fa-file-zip-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-file-zip-o:before{content:"\f1c6"}.fa.fa-file-audio-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-file-audio-o:before{content:"\f1c7"}.fa.fa-file-sound-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-file-sound-o:before{content:"\f1c7"}.fa.fa-file-video-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-file-video-o:before{content:"\f1c8"}.fa.fa-file-movie-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-file-movie-o:before{content:"\f1c8"}.fa.fa-file-code-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-file-code-o:before{content:"\f1c9"}.fa.fa-vine{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-codepen{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-jsfiddle{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-life-ring{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-life-bouy{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-life-bouy:before{content:"\f1cd"}.fa.fa-life-buoy{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-life-buoy:before{content:"\f1cd"}.fa.fa-life-saver{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-life-saver:before{content:"\f1cd"}.fa.fa-support{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-support:before{content:"\f1cd"}.fa.fa-circle-o-notch:before{content:"\f1ce"}.fa.fa-rebel{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-ra{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-ra:before{content:"\f1d0"}.fa.fa-resistance{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-resistance:before{content:"\f1d0"}.fa.fa-empire{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-ge{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-ge:before{content:"\f1d1"}.fa.fa-git-square{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-git{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-hacker-news{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-y-combinator-square{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-y-combinator-square:before{content:"\f1d4"}.fa.fa-yc-square{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-yc-square:before{content:"\f1d4"}.fa.fa-tencent-weibo{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-qq{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-weixin{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-wechat{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-wechat:before{content:"\f1d7"}.fa.fa-send:before{content:"\f1d8"}.fa.fa-paper-plane-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-paper-plane-o:before{content:"\f1d8"}.fa.fa-send-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-send-o:before{content:"\f1d8"}.fa.fa-circle-thin{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-circle-thin:before{content:"\f111"}.fa.fa-header:before{content:"\f1dc"}.fa.fa-sliders:before{content:"\f1de"}.fa.fa-futbol-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-futbol-o:before{content:"\f1e3"}.fa.fa-soccer-ball-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-soccer-ball-o:before{content:"\f1e3"}.fa.fa-slideshare{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-twitch{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-yelp{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-newspaper-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-newspaper-o:before{content:"\f1ea"}.fa.fa-paypal{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-google-wallet{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-cc-visa{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-cc-mastercard{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-cc-discover{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-cc-amex{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-cc-paypal{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-cc-stripe{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-bell-slash-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-bell-slash-o:before{content:"\f1f6"}.fa.fa-trash:before{content:"\f2ed"}.fa.fa-copyright{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-eyedropper:before{content:"\f1fb"}.fa.fa-area-chart:before{content:"\f1fe"}.fa.fa-pie-chart:before{content:"\f200"}.fa.fa-line-chart:before{content:"\f201"}.fa.fa-lastfm{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-lastfm-square{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-ioxhost{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-angellist{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-cc{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-cc:before{content:"\f20a"}.fa.fa-ils:before{content:"\f20b"}.fa.fa-shekel:before{content:"\f20b"}.fa.fa-sheqel:before{content:"\f20b"}.fa.fa-meanpath{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-meanpath:before{content:"\f2b4"}.fa.fa-buysellads{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-connectdevelop{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-dashcube{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-forumbee{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-leanpub{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-sellsy{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-shirtsinbulk{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-simplybuilt{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-skyatlas{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-diamond{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-diamond:before{content:"\f3a5"}.fa.fa-intersex:before{content:"\f224"}.fa.fa-facebook-official{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-facebook-official:before{content:"\f09a"}.fa.fa-pinterest-p{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-whatsapp{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-hotel:before{content:"\f236"}.fa.fa-viacoin{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-medium{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-y-combinator{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-yc{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-yc:before{content:"\f23b"}.fa.fa-optin-monster{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-opencart{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-expeditedssl{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-battery-4:before{content:"\f240"}.fa.fa-battery:before{content:"\f240"}.fa.fa-battery-3:before{content:"\f241"}.fa.fa-battery-2:before{content:"\f242"}.fa.fa-battery-1:before{content:"\f243"}.fa.fa-battery-0:before{content:"\f244"}.fa.fa-object-group{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-object-ungroup{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-sticky-note-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-sticky-note-o:before{content:"\f249"}.fa.fa-cc-jcb{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-cc-diners-club{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-clone{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-hourglass-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-hourglass-o:before{content:"\f254"}.fa.fa-hourglass-1:before{content:"\f251"}.fa.fa-hourglass-2:before{content:"\f252"}.fa.fa-hourglass-3:before{content:"\f253"}.fa.fa-hand-rock-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-hand-rock-o:before{content:"\f255"}.fa.fa-hand-grab-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-hand-grab-o:before{content:"\f255"}.fa.fa-hand-paper-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-hand-paper-o:before{content:"\f256"}.fa.fa-hand-stop-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-hand-stop-o:before{content:"\f256"}.fa.fa-hand-scissors-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-hand-scissors-o:before{content:"\f257"}.fa.fa-hand-lizard-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-hand-lizard-o:before{content:"\f258"}.fa.fa-hand-spock-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-hand-spock-o:before{content:"\f259"}.fa.fa-hand-pointer-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-hand-pointer-o:before{content:"\f25a"}.fa.fa-hand-peace-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-hand-peace-o:before{content:"\f25b"}.fa.fa-registered{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-creative-commons{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-gg{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-gg-circle{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-tripadvisor{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-odnoklassniki{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-odnoklassniki-square{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-get-pocket{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-wikipedia-w{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-safari{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-chrome{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-firefox{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-opera{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-internet-explorer{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-television:before{content:"\f26c"}.fa.fa-contao{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-500px{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-amazon{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-calendar-plus-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-calendar-plus-o:before{content:"\f271"}.fa.fa-calendar-minus-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-calendar-minus-o:before{content:"\f272"}.fa.fa-calendar-times-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-calendar-times-o:before{content:"\f273"}.fa.fa-calendar-check-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-calendar-check-o:before{content:"\f274"}.fa.fa-map-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-map-o:before{content:"\f279"}.fa.fa-commenting:before{content:"\f4ad"}.fa.fa-commenting-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-commenting-o:before{content:"\f4ad"}.fa.fa-houzz{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-vimeo{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-vimeo:before{content:"\f27d"}.fa.fa-black-tie{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-fonticons{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-reddit-alien{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-edge{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-credit-card-alt:before{content:"\f09d"}.fa.fa-codiepie{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-modx{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-fort-awesome{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-usb{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-product-hunt{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-mixcloud{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-scribd{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-pause-circle-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-pause-circle-o:before{content:"\f28b"}.fa.fa-stop-circle-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-stop-circle-o:before{content:"\f28d"}.fa.fa-bluetooth{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-bluetooth-b{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-gitlab{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-wpbeginner{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-wpforms{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-envira{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-wheelchair-alt{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-wheelchair-alt:before{content:"\f368"}.fa.fa-question-circle-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-question-circle-o:before{content:"\f059"}.fa.fa-volume-control-phone:before{content:"\f2a0"}.fa.fa-asl-interpreting:before{content:"\f2a3"}.fa.fa-deafness:before{content:"\f2a4"}.fa.fa-hard-of-hearing:before{content:"\f2a4"}.fa.fa-glide{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-glide-g{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-signing:before{content:"\f2a7"}.fa.fa-viadeo{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-viadeo-square{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-snapchat{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-snapchat-ghost{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-snapchat-square{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-pied-piper{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-first-order{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-yoast{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-themeisle{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-google-plus-official{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-google-plus-official:before{content:"\f2b3"}.fa.fa-google-plus-circle{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-google-plus-circle:before{content:"\f2b3"}.fa.fa-font-awesome{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-fa{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-fa:before{content:"\f2b4"}.fa.fa-handshake-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-handshake-o:before{content:"\f2b5"}.fa.fa-envelope-open-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-envelope-open-o:before{content:"\f2b6"}.fa.fa-linode{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-address-book-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-address-book-o:before{content:"\f2b9"}.fa.fa-vcard:before{content:"\f2bb"}.fa.fa-address-card-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-address-card-o:before{content:"\f2bb"}.fa.fa-vcard-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-vcard-o:before{content:"\f2bb"}.fa.fa-user-circle-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-user-circle-o:before{content:"\f2bd"}.fa.fa-user-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-user-o:before{content:"\f007"}.fa.fa-id-badge{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-drivers-license:before{content:"\f2c2"}.fa.fa-id-card-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-id-card-o:before{content:"\f2c2"}.fa.fa-drivers-license-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-drivers-license-o:before{content:"\f2c2"}.fa.fa-quora{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-free-code-camp{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-telegram{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-thermometer-4:before{content:"\f2c7"}.fa.fa-thermometer:before{content:"\f2c7"}.fa.fa-thermometer-3:before{content:"\f2c8"}.fa.fa-thermometer-2:before{content:"\f2c9"}.fa.fa-thermometer-1:before{content:"\f2ca"}.fa.fa-thermometer-0:before{content:"\f2cb"}.fa.fa-bathtub:before{content:"\f2cd"}.fa.fa-s15:before{content:"\f2cd"}.fa.fa-window-maximize{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-window-restore{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-times-rectangle:before{content:"\f410"}.fa.fa-window-close-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-window-close-o:before{content:"\f410"}.fa.fa-times-rectangle-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-times-rectangle-o:before{content:"\f410"}.fa.fa-bandcamp{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-grav{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-etsy{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-imdb{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-ravelry{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-eercast{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-eercast:before{content:"\f2da"}.fa.fa-snowflake-o{font-family:'Font Awesome 5 Free';font-weight:400}.fa.fa-snowflake-o:before{content:"\f2dc"}.fa.fa-superpowers{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-wpexplorer{font-family:'Font Awesome 5 Brands';font-weight:400}.fa.fa-spotify{font-family:'Font Awesome 5 Brands';font-weight:400}
diff --git a/x2engine/framework/YiiBase.php b/x2engine/framework/YiiBase.php
index 6cad6743c..9f346e7f1 100644
--- a/x2engine/framework/YiiBase.php
+++ b/x2engine/framework/YiiBase.php
@@ -463,7 +463,7 @@ public static function autoload($className,$classMapOnly=false)
}
}
else
- include($className.'.php');
+ strcmp("PHPUnit_Runner_Version", $className) ? 'empty' : include($className.'.php');
}
else // class name with namespace in PHP 5.3
{
diff --git a/x2engine/framework/base/CSecurityManager.php b/x2engine/framework/base/CSecurityManager.php
index daf3510f4..d5c740c6f 100644
--- a/x2engine/framework/base/CSecurityManager.php
+++ b/x2engine/framework/base/CSecurityManager.php
@@ -638,6 +638,7 @@ public function maskToken($token)
*/
public function unmaskToken($maskedToken)
{
+ /*x2modstart*/ $maskedToken = urldecode ($maskedToken); /*x2modend*/
$decoded=base64_decode(strtr($maskedToken,'-_','+/'));
$length=$this->strlen($decoded)/2;
// Check if the masked token has an even length.
diff --git a/x2engine/framework/test/CTestCase.php b/x2engine/framework/test/CTestCase.php
index 2a7c82e18..49da5ce84 100644
--- a/x2engine/framework/test/CTestCase.php
+++ b/x2engine/framework/test/CTestCase.php
@@ -9,11 +9,11 @@
*/
if(!class_exists('PHPUnit_Runner_Version')) {
- require_once('PHPUnit/Runner/Version.php');
- require_once('PHPUnit/Util/Filesystem.php'); // workaround for PHPUnit <= 3.6.11
+ //require_once('PHPUnit/Runner/Version.php');
+ //require_once('PHPUnit/Util/Filesystem.php'); // workaround for PHPUnit <= 3.6.11
spl_autoload_unregister(array('YiiBase','autoload'));
- require_once('PHPUnit/Autoload.php');
+ //require_once('PHPUnit/Autoload.php');
spl_autoload_register(array('YiiBase','autoload')); // put yii's autoloader at the end
if (in_array('phpunit_autoload', spl_autoload_functions())) { // PHPUnit >= 3.7 'phpunit_autoload' was obsoleted
@@ -22,6 +22,17 @@
}
}
+/* Ensures compatibility with PHPUnit < 6.x */
+
+if(!class_exists('PHPUnit_Framework_Constraint') && class_exists('PHPUnit\Framework\Constraint\Constraint'))
+{
+ abstract class PHPUnit_Framework_Constraint extends \PHPUnit\Framework\Constraint\Constraint {}
+}
+if(!class_exists('PHPUnit_Framework_TestCase') && class_exists('PHPUnit\Framework\TestCase'))
+{
+ abstract class PHPUnit_Framework_TestCase extends \PHPUnit\Framework\TestCase {}
+}
+
/**
* CTestCase is the base class for all test case classes.
*
diff --git a/x2engine/framework/web/CHttpRequest.php b/x2engine/framework/web/CHttpRequest.php
index df8d2222b..403795a44 100644
--- a/x2engine/framework/web/CHttpRequest.php
+++ b/x2engine/framework/web/CHttpRequest.php
@@ -1333,6 +1333,10 @@ public function validateCsrfToken($event)
$cookies=$this->getCookies();
$method=$this->getRequestType();
+ /* x2modstart */
+ // if the POST body is 'empty' JSON may be getting passed instead
+ if (empty($_POST)) $_POST = json_decode(file_get_contents('php://input'), true);
+ /* x2modend */
switch($method)
{
case 'POST':
diff --git a/x2engine/framework/web/CHttpSession.php b/x2engine/framework/web/CHttpSession.php
index c02e33ee6..3217e46b9 100644
--- a/x2engine/framework/web/CHttpSession.php
+++ b/x2engine/framework/web/CHttpSession.php
@@ -355,7 +355,9 @@ public function getTimeout()
*/
public function setTimeout($value)
{
- ini_set('session.gc_maxlifetime',$value);
+ if(!headers_sent()){
+ ini_set('session.gc_maxlifetime',$value);
+ }
}
/**
diff --git a/x2engine/framework/zii/widgets/grid/GroupGridView.php b/x2engine/framework/zii/widgets/grid/GroupGridView.php
new file mode 100755
index 000000000..2e1f5a9b2
--- /dev/null
+++ b/x2engine/framework/zii/widgets/grid/GroupGridView.php
@@ -0,0 +1,326 @@
+
+* @version 1.3
+*/
+class GroupGridView extends CGridView {
+
+ //column values are merged independently
+ const MERGE_SIMPLE = 'simple';
+ //column values are merged if at least one value of nested columns changes (makes sense when several columns in $mergeColumns option)
+ const MERGE_NESTED = 'nested';
+ //column values are merged independently, but value is shown in first row of group and below cells just cleared (instead of `rowspan`)
+ const MERGE_FIRSTROW = 'firstrow';
+
+ public $mergeColumns = array();
+ public $mergeType = self::MERGE_SIMPLE;
+ public $mergeCellCss = 'text-align: center; vertical-align: middle';
+
+ //list of columns on which change extrarow will be triggered
+ public $extraRowColumns = array();
+ //expression to get value shown in extrarow
+ public $extraRowExpression;
+ //position of extraRow relative to group: 'above' | 'below'
+ public $extraRowPos = 'above';
+ //totals expression: function($data, $row, &$totals)
+ public $extraRowTotals;
+
+ //array with groups
+ private $_groups = array();
+
+ public function renderTableBody()
+ {
+ if(!empty($this->mergeColumns) || !empty($this->extraRowColumns)) {
+ $this->groupByColumns();
+ }
+ parent::renderTableBody();
+ }
+
+ /**
+ * find and store changing of group columns
+ *
+ * @param mixed $data
+ */
+ public function groupByColumns()
+ {
+ $data = $this->dataProvider->getData();
+ if(count($data) == 0) return;
+
+ if(!is_array($this->mergeColumns)) $this->mergeColumns = array($this->mergeColumns);
+ if(!is_array($this->extraRowColumns)) $this->extraRowColumns = array($this->extraRowColumns);
+
+ //store columns for group. Set object for existing columns in grid and string for attributes
+ $groupColumns = array_unique(array_merge($this->mergeColumns, $this->extraRowColumns));
+ foreach($groupColumns as $key => $colName) {
+ foreach($this->columns as $column) {
+ if(property_exists($column, 'name') && $column->name == $colName) {
+ $groupColumns[$key] = $column;
+ break;
+ }
+ }
+ }
+
+ //storage for groups in each column
+ $groups = array();
+
+ //values for first row
+ $values = $this->getRowValues($groupColumns, $data[0], 0);
+ foreach($values as $colName => $value) {
+ $groups[$colName][] = array(
+ 'value' => $value,
+ 'column' => $colName,
+ 'start' => 0,
+ //end - later
+ //totals - later
+ );
+ }
+
+ //calc totals for the first row
+ $totals = array();
+ if($this->extraRowTotals) {
+ $this->evaluateExpression($this->extraRowTotals, array('data'=>$data[0], 'row'=>0, 'totals' => &$totals));
+ }
+
+ //iterate data
+ for($i = 1; $i < count($data); $i++) {
+ //save row values in array
+ $current = $this->getRowValues($groupColumns, $data[$i], $i);
+
+ //define is change occured. Need this extra foreach for correctly proceed extraRows
+ $changedColumns = array();
+ foreach($current as $colName => $curValue) {
+ $prev = end($groups[$colName]);
+ if($curValue != $prev['value']) {
+ $changedColumns[] = $colName;
+ }
+ }
+
+ /*
+ if this flag = true -> we will write change for all grouping columns.
+ It's required when change of any column from extraRowColumns occurs
+ */
+ $extraRowColumnChanged = (count(array_intersect($changedColumns, $this->extraRowColumns)) > 0);
+
+ /*
+ this changeOccured related to foreach below. It is required only for mergeType == self::MERGE_NESTED,
+ to write change for all nested columns when change of previous column occured
+ */
+ $changeOccured = false;
+ foreach($current as $colName => $curValue) {
+ //value changed
+ $valueChanged = in_array($colName, $changedColumns);
+ //change already occured in this loop and mergeType set to MERGETYPE_NESTED
+ $saveChange = $valueChanged || ($changeOccured && $this->mergeType == self::MERGE_NESTED);
+
+ if($extraRowColumnChanged || $saveChange) {
+ $changeOccured = true;
+ $lastIndex = count($groups[$colName]) - 1;
+
+ //finalize prev group
+ $groups[$colName][$lastIndex]['end'] = $i - 1;
+ $groups[$colName][$lastIndex]['totals'] = $totals;
+
+ //begin new group
+ $groups[$colName][] = array(
+ 'start' => $i,
+ 'column' => $colName,
+ 'value' => $curValue,
+ );
+ }
+ }
+
+ //if change in extrarowcolumn --> reset totals
+ if($extraRowColumnChanged) {
+ $totals = array();
+ }
+
+ //calc totals for that row
+ if($this->extraRowTotals) {
+ $this->evaluateExpression($this->extraRowTotals, array('data'=>$data[$i], 'row'=>$i, 'totals' => &$totals));
+ }
+ }
+
+ //finalize group for last row
+ foreach($groups as $colName => $v) {
+ $lastIndex = count($groups[$colName]) - 1;
+ $groups[$colName][$lastIndex]['end'] = count($data) - 1;
+ $groups[$colName][$lastIndex]['totals'] = $totals;
+ }
+
+ $this->_groups = $groups;
+ }
+
+ public function renderTableRow($row)
+ {
+ $extraRowEdge = null;
+ if(count($this->extraRowColumns)) {
+ $colName = $this->extraRowColumns[0];
+ $extraRowEdge = $this->isGroupEdge($colName, $row);
+ if($this->extraRowPos == 'above' && isset($extraRowEdge['start'])) {
+ $this->renderExtraRow($row, $extraRowEdge['group']['totals']);
+ }
+ }
+ /*
+ if($this->_changes && array_key_exists($row, $this->_changes)) {
+ $change = $this->_changes[$row];
+ //if change in extracolumns --> put extra row
+ $columnsInExtra = array_intersect(array_keys($change['columns']), $this->extraRowColumns);
+ //extraRowPos = before
+ if(count($columnsInExtra) > 0 && $this->extraRowPos == 'before') {
+ $this->renderExtraRow($row, $this->_changes[$row], $columnsInExtra);
+ }
+ }
+ */
+
+ // original CGridView code
+ if($this->rowCssClassExpression!==null)
+ {
+ $data=$this->dataProvider->data[$row];
+ echo '
';
+ }
+ else if(is_array($this->rowCssClass) && ($n=count($this->rowCssClass))>0)
+ echo ' ';
+ else
+ echo ' ';
+
+
+ foreach($this->columns as $column) {
+ $isGroupColumn = property_exists($column, 'name') && in_array($column->name, $this->mergeColumns);
+
+ if(!$isGroupColumn) {
+ $column->renderDataCell($row);
+ continue;
+ }
+
+ //is curent row appears on edge of group
+ $edge = $this->isGroupEdge($column->name, $row);
+
+ switch($this->mergeType) {
+ case self::MERGE_SIMPLE:
+ case self::MERGE_NESTED:
+ if(isset($edge['start'])) {
+ $options = $column->htmlOptions;
+ $column->htmlOptions['rowspan'] = $edge['group']['end'] - $edge['group']['start'] + 1;
+ $column->htmlOptions['class'] = 'merge';
+ $style = isset($column->htmlOptions['style']) ? $column->htmlOptions['style'] : '';
+ $column->htmlOptions['style'] = $style.';'.$this->mergeCellCss;
+ $column->renderDataCell($row);
+ $column->htmlOptions = $options;
+ }
+ break;
+
+ case self::MERGE_FIRSTROW:
+ if(isset($edge['start'])) {
+ $column->renderDataCell($row);
+ } else {
+ echo ' ';
+ }
+ break;
+ }
+
+ }
+
+ echo " \n";
+
+ //extraRowPos = after
+ if(count($this->extraRowColumns) && $this->extraRowPos == 'below' && isset($extraRowEdge['end'])) {
+ $this->renderExtraRow($row, $extraRowEdge['group']['totals']);
+ }
+ }
+
+ /**
+ * returns array of rendered column values (TD)
+ *
+ * @param mixed $columns
+ * @param mixed $rowIndex
+ */
+ private function getRowValues($columns, $data, $rowIndex)
+ {
+ foreach($columns as $column) {
+ if($column instanceOf CGridColumn) {
+ $result[$column->name] = $this->getDataCellContent($column, $data, $rowIndex);
+ } elseif(is_string($column)) {
+ if(is_array($data) && array_key_exists($column, $data)) {
+ $result[$column] = $data[$column];
+ } elseif($data instanceOf CModel && $data->hasAttribute($column)) {
+ $result[$column] = $data->getAttribute($column);
+ } else {
+ throw new CException('Column or attribute "'.$column.'" not found!');
+ }
+ }
+ }
+
+ return $result;
+ }
+
+ /**
+ * renders extra row
+ *
+ * @param mixed $row
+ * @param mixed $change
+ */
+ private function renderExtraRow($row, $totals)
+ {
+ $data = $this->dataProvider->data[$row];
+ if($this->extraRowExpression) { //user defined expression, use it!
+ $content = $this->evaluateExpression($this->extraRowExpression, array('data'=>$data, 'row'=>$row, 'totals' => $totals));
+ } else { //generate value
+ $values = array();
+ foreach($this->extraRowColumns as $colName) {
+ $values[] = CHtml::encode(CHtml::value($data, $colName));
+ }
+ $content = ''.implode(' :: ', $values).' ';
+ }
+
+ $colspan = count($this->columns);
+
+ echo '';
+ echo '';
+ echo ' ';
+ }
+
+ /**
+ * need to rewrite this function as it is protected in CDataColumn: it is strange as all methods inside are public
+ *
+ * @param mixed $column
+ * @param mixed $row
+ * @param mixed $data
+ */
+ private function getDataCellContent($column, $data, $row)
+ {
+ if($column->value!==null)
+ $value=$column->evaluateExpression($column->value, array('data'=>$data,'row'=>$row));
+ else if($column->name!==null)
+ $value=CHtml::value($data,$column->name);
+
+ return $value===null ? $column->grid->nullDisplay : $column->grid->getFormatter()->format($value, $column->type);
+ }
+
+ /**
+ * Is current row start or end of group in particular column
+ */
+ private function isGroupEdge($colName, $row)
+ {
+ $result = array();
+ foreach($this->_groups[$colName] as $index => $v) {
+ if($v['start'] == $row) {
+ $result['start'] = $row;
+ $result['group'] = $v;
+ }
+ if($v['end'] == $row) {
+ $result['end'] = $row;
+ $result['group'] = $v;
+ }
+ if(count($result)) break;
+ }
+ return $result;
+ }
+
+}
diff --git a/x2engine/initialize.php b/x2engine/initialize.php
index 3dc8ac2cf..aebd85b2d 100755
--- a/x2engine/initialize.php
+++ b/x2engine/initialize.php
@@ -875,7 +875,7 @@ function installStage($stage) {
foreach ($sendArgs as $urlKey) {
$stats[$urlKey] = $config[$urlKey];
}
- $ch = curl_init('http://52.33.121.218/x2planet.com/installs/registry/activity?' . http_build_query($stats));
+ $ch = curl_init('http://x2planet.com/installs/registry/activity?' . http_build_query($stats));
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$gif = curl_exec($ch);
@@ -927,7 +927,7 @@ function installStage($stage) {
Copyright © X2Engine Inc.
-
+
diff --git a/x2engine/initialize_ent.php b/x2engine/initialize_ent.php
new file mode 100755
index 000000000..b901777b1
--- /dev/null
+++ b/x2engine/initialize_ent.php
@@ -0,0 +1,50 @@
+= 0) {
this.legend.splice (index, 1);
this.chart.show (item);
diff --git a/x2engine/js/DataWidget/ScatterPlotWidget.js b/x2engine/js/DataWidget/ScatterPlotWidget.js
index 6fdc44b77..7b7dc3549 100644
--- a/x2engine/js/DataWidget/ScatterPlotWidget.js
+++ b/x2engine/js/DataWidget/ScatterPlotWidget.js
@@ -62,7 +62,8 @@ var MAX_CATEGORIES = 20;
function ScatterPlotWidget (argsDict) {
var defaultArgs = {
- grid: true
+ grid: true,
+ displayType: 'scatter'
};
auxlib.applyArgs (this, defaultArgs, argsDict);
x2.DataWidget.call (this, argsDict);
@@ -81,6 +82,21 @@ ScatterPlotWidget.prototype.setUpConfigBar = function(){
$(this).toggleClass('active', that.grid);
that.draw();
});
+
+ var options = ['scatter', 'bubble'];
+
+ auxlib.map(function(d){
+ that.configBar.find('#'+d).click(function(e){
+ e.preventDefault();
+ $(this).siblings('.display-type').removeClass('active');
+ $(this).addClass('active');
+
+ that.setProperty('displayType', d);
+ that.displayType = d;
+
+ that.draw();
+ });
+ }, options);
};
/**
@@ -107,7 +123,10 @@ ScatterPlotWidget.prototype.draw = function() {
data: {
xs: this.chartData.xs,
json: this.chartData.json,
- type: 'scatter'
+ type: this.displayType
+ },
+ bubble: {
+ maxR: 16,
},
axis: {
x: {
diff --git a/x2engine/js/DataWidget/TimeSeriesWidget.js b/x2engine/js/DataWidget/TimeSeriesWidget.js
index 5480ad171..b127cfc82 100644
--- a/x2engine/js/DataWidget/TimeSeriesWidget.js
+++ b/x2engine/js/DataWidget/TimeSeriesWidget.js
@@ -63,7 +63,7 @@ x2.TimeSeriesWidget = (function() {
var MAX_CATEGORIES = 20;
var MAX_TICKS = 50;
-var MAX_POINTS = 20;
+var MAX_POINTS = 40;
function TimeSeriesWidget (argsDict) {
var defaultArgs = {
@@ -123,7 +123,7 @@ TimeSeriesWidget.prototype = auxlib.create (x2.DataWidget.prototype);
* Set up all handlers for the config bar.
* Many aspects in this function are steamlined-
* IDs of config bar items often correspond to keywords
- * that c3 or d3 understand, such as chart types or time buckets
+ * that bb or d3 understand, such as chart types or time buckets
**************************************************/
TimeSeriesWidget.prototype.setUpConfigBar = function(){
x2.DataWidget.prototype.setUpConfigBar.call(this);
@@ -135,7 +135,7 @@ TimeSeriesWidget.prototype.setUpConfigBar = function(){
/**********************************
* Chart type Menu
**********************************/
- var options = ['line', 'pie', 'gauge', 'bar', 'area'];
+ var options = ['line', 'spline', 'area-spline', 'pie', 'gauge', 'bar', 'area'];
auxlib.map(function(d){
that.configBar.find('#'+d).click(function(e){
@@ -293,10 +293,12 @@ TimeSeriesWidget.prototype.xScale = function(){
// Generate a d3 timescale object
var domain = [timeFrame.start, timeFrame.end];
- var x = d3.time.scale().domain(domain);
+ var x = d3.scaleTime().domain(domain);
// d3 time object for 1 hour, 1 day, 1 month..
- var d3time = d3.time[this.timeBucket];
+ var s = this.timeBucket;
+ var interval = 'time' + s.charAt(0).toUpperCase() + s.slice(1);
+ var d3time = d3[interval];
// Generate the ticks based on the bucketing
var ticks = x.ticks(d3time, 1);
@@ -317,7 +319,7 @@ TimeSeriesWidget.prototype.getTimeFrame = function() {
var unixEnd = this.chartData.timeFrame.end;
// Round to the neared timebuckets
- var start = moment (unixStart * 1000).subtract(1, this.timebucket).startOf(this.timeBucket);
+ var start = moment (unixStart * 1000).subtract(1, this.timeBucket).startOf(this.timeBucket);
var end = moment (unixEnd * 1000).add(1, this.timeBucket).startOf (this.timeBucket);
return {start: start, end: end};
@@ -449,9 +451,13 @@ TimeSeriesWidget.prototype.bucketData = function(sortedData) {
**************************************************/
TimeSeriesWidget.prototype.formatData = function(data, ticks) {
// This sorts the data into the buckets. Very important function!
- var histData = d3.layout.
+ var timeFrame = this.getTimeFrame();
+
+ // Generate a d3 timescale object
+ var domain = [timeFrame.start, timeFrame.end];
+ var histData = d3.
histogram ().
- bins (ticks).value (function(d) {
+ thresholds (ticks).domain(domain).value (function(d) {
return new Date(d.timestamp)
}) (data);
@@ -533,12 +539,12 @@ TimeSeriesWidget.prototype.averageData = function(formattedData) {
TimeSeriesWidget.prototype.colorScale = function() {
var values = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100];
- var colorScale = d3.scale.linear()
+ var colorScale = d3.scaleLinear()
.domain([0,50])
.interpolate(d3.interpolateRgb)
.range(['#FF0000', '#F6C600']);
- var colorScale2 = d3.scale.linear()
+ var colorScale2 = d3.scaleLinear()
.domain([50,100])
.interpolate(d3.interpolateRgb)
.range(['#F6C600', '#60B044']);
@@ -615,19 +621,11 @@ TimeSeriesWidget.prototype.draw = function() {
/**
* call the special gauge render function if gauge is selected
*/
- if( type == 'gauge') {
+ if (type == 'gauge') {
this.drawGauge();
return;
}
- /**
- * Group data if area is selected
- */
- var groups = [];
- if (this.displayType == 'area') {
- groups = [auxlib.keys(this.formattedData)];
- }
-
/**
* Limit ticks if there are greater than MAX_TICKS
*/
@@ -655,11 +653,17 @@ TimeSeriesWidget.prototype.draw = function() {
data: {
x: 'ticks',
json: this.formattedData,
- groups: groups,
selection: {
enabled: true,
- multiple: false
- }
+ multiple: false,
+ isselectable: function(dataPoint) {
+ if(dataPoint["value"] > 0){
+ return true;
+ }
+
+ return false;
+ }
+ },
},
axis: {
x: {
diff --git a/x2engine/js/LoginThemeHelper.js b/x2engine/js/LoginThemeHelper.js
index d659bac8b..4b275b82a 100755
--- a/x2engine/js/LoginThemeHelper.js
+++ b/x2engine/js/LoginThemeHelper.js
@@ -207,6 +207,11 @@ x2.LoginThemeHelper = (function(){
LoginThemeHelper.prototype.setUpClickBehavior = function(){
var that = this;
+ $('#signin-button').click( function() {
+ this.disabled = true;
+ this.form.submit();
+ });
+
$('#dark-theme-button').click( function(e) {
e.preventDefault();
that.element$.slideToggle('fast');
diff --git a/x2engine/js/ProfileLayoutSaver.js b/x2engine/js/ProfileLayoutSaver.js
new file mode 100644
index 000000000..49db3d25a
--- /dev/null
+++ b/x2engine/js/ProfileLayoutSaver.js
@@ -0,0 +1,124 @@
+/***********************************************************************************
+ * X2Engine Open Source Edition is a customer relationship management program developed by
+ * X2 Engine, Inc. Copyright (C) 2011-2019 X2 Engine Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Affero General Public License version 3 as published by the
+ * Free Software Foundation with the addition of the following permission added
+ * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
+ * IN WHICH THE COPYRIGHT IS OWNED BY X2ENGINE, X2ENGINE DISCLAIMS THE WARRANTY
+ * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Affero General Public License along with
+ * this program; if not, see http://www.gnu.org/licenses or write to the Free
+ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ *
+ * You can contact X2Engine, Inc. P.O. Box 610121, Redwood City,
+ * California 94061, USA. or at email address contact@x2engine.com.
+ *
+ * The interactive user interfaces in modified source and object code versions
+ * of this program must display Appropriate Legal Notices, as required under
+ * Section 5 of the GNU Affero General Public License version 3.
+ *
+ * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
+ * these Appropriate Legal Notices must retain the display of the "Powered by
+ * X2 Engine" logo. If the display of the logo is not reasonably feasible for
+ * technical reasons, the Appropriate Legal Notices must display the words
+ * "Powered by X2 Engine".
+ **********************************************************************************/
+
+
+
+/**
+ * Class to manage the profile layout editor
+ */
+
+function ProfileLayoutSaver(argsDict) {
+ var defaultArgs = {
+ saveProfileLayoutUrl: '',
+ };
+ auxlib.applyArgs (this, defaultArgs, argsDict);
+ this._init();
+}
+
+ProfileLayoutSaver.prototype._saveProfileLayout = function (groupId, callback) {
+ var that = this;
+ console.log(that.saveProfileLayoutUrl);
+ $.ajax ({
+ url: this.saveProfileLayoutUrl,
+ data: {
+ 'groupId': groupId,
+ },
+ type: 'POST',
+ dataType: 'json',
+ success: function (data) {
+ if (data !== 'failure') {
+ alert('saved layout')
+ callback ();
+ }
+ }
+ });
+}
+
+ProfileLayoutSaver.prototype._setUpCreateWidgetDialog = function () {
+ var that = this;
+ var dialog$ = $('#save-profile-layout-dialog').dialog ({
+ title: 'Save Layout (translate me)',
+ autoOpen: false,
+ width: 500,
+ buttons: [
+ {
+ text: 'Cancel',
+ click: function () {
+ $(this).dialog ('close');
+ }
+ },
+ {
+ text: 'Save',
+ class: 'highlight',
+ click: function () {
+ var groupId = $(this).find ('#groupSelect').val ();
+ if (groupId === undefined) return;
+ var callback = function (){
+ dialog$.dialog ('close'); };
+
+ that._saveProfileLayout (groupId, callback);
+ }
+ }
+ ]
+ });
+
+ // save-profile-layout-button
+ $('#save-layout').click (function () {
+ dialog$.dialog ('open');
+ });
+
+ // when the dropdown changes
+ $('#currentLayout').change(function () {
+ var selectedValue = $('#currentLayout').val();
+ $.ajax({
+ 'url' : yii.scriptUrl + '/profile/setProfileLayout',
+ 'type' : 'POST',
+ 'data' : {
+ 'selected' : selectedValue
+ },
+ 'success' : function(){
+ location.reload();
+ },
+ 'error' : function(error){
+ alert('error');
+ }
+ });
+ });
+};
+
+ProfileLayoutSaver.prototype._init = function () {
+
+ this._setUpCreateWidgetDialog ();
+}
diff --git a/x2engine/js/X2ConditionList.js b/x2engine/js/X2ConditionList.js
index 555454521..77a46a3e5 100644
--- a/x2engine/js/X2ConditionList.js
+++ b/x2engine/js/X2ConditionList.js
@@ -168,7 +168,19 @@ ConditionList.prototype._addPreexistingValues = function () {
that._sortList$.children ('ol').append (field$);
field$.find ('.x2fields-attribute :input').val (val.name).change ();
field$.find ('.x2fields-operator :input').val (val.operator).change;
- field$.find ('.x2fields-value :input').val (val.value);
+ //field$.find ('.x2fields-value :input').val (val.value);
+
+ /**
+ * replacing value on type checkbox does not check the box.
+ * October 3rd 2019, Justin T
+ */
+ if(field$.find ('.x2fields-value :input[type=checkbox]').val () == '1'){
+ if(val.value == true){
+ field$.find ('.x2fields-value :input[type=checkbox]').attr("checked", "checked");
+ }
+ }else{
+ field$.find ('.x2fields-value :input').val (val.value);
+ }
}
this._reindexInputs ();
};
diff --git a/x2engine/js/X2GrapesJS/X2Grapes.js b/x2engine/js/X2GrapesJS/X2Grapes.js
new file mode 100644
index 000000000..e0a339ed0
--- /dev/null
+++ b/x2engine/js/X2GrapesJS/X2Grapes.js
@@ -0,0 +1,564 @@
+let x2grapes = {
+ config: {
+ urlStore: null,
+ urlLoad: null,
+ csrfTokenName: null,
+ csrfToken: null,
+ insertableattributes: null,
+ container: '#grapes-div',
+ wrapper: '#grapes-wrapper'
+ },
+ initialize: (config) => {
+ var myConfig = (config != undefined) ? config : this.config;
+ window.editor = grapesjs.init({
+ container: myConfig.container,
+ fromElement: true,
+ height: '60em',
+ width: 'auto',
+ layerManager: {
+ appendTo: '.layers-container'
+ },
+ plugins: ['gjs-blocks-basic', 'gjs-preset-newsletter'],
+ pluginsOpts: {
+ 'gjs-preset-newsletter': {
+ modalTitleImport: 'Import template',
+ inlineCss: true
+ },
+ },
+ storageManager: {
+ id: 'gjs-', // Prefix identifier that will be used inside storing and loading
+ type: 'remote', // Type of the storage
+ urlStore: config.urlStore,
+ urlLoad: config.urlLoad,
+ autosave: false,
+ autoload: false,
+ storeComponents: true, // Enable/Disable storing of components in JSON format
+ storeStyles: true, // Enable/Disable storing of rules in JSON format
+ storeHtml: true, // Enable/Disable storing of components as HTML string
+ storeCss: true, // Enable/Disable storing of rules as CSS string
+ contentTypeJson: true,
+ },
+ // Avoid any default panel
+ panels: {
+ defaults: [
+ {
+ id: 'layers',
+ el: '.panel__right',
+ // Make the panel resizable
+ resizable: {
+ maxDim: 350,
+ minDim: 200,
+ tc: 0, // Top handler
+ cl: 1, // Left handler
+ cr: 0, // Right handler
+ bc: 0, // Bottom handler
+ // Being a flex child we need to change `flex-basis` property
+ // instead of the `width` (default)
+ keyWidth: 'flex-basis',
+ },
+ }, {
+ id: 'panel-switcher',
+ el: '.panel__switcher',
+ buttons: [{
+ id: 'undo',
+ className: 'fa fa-undo',
+ command: e => e.runCommand('core:undo'),
+ }, {
+ id: 'show-fullscreen',
+ className: 'fa fa-arrows-alt',
+ command(editor) {
+ if (x2.fullscreen) {
+ x2.fullscreen = 0;
+ editor.stopCommand('fullscreen', { target: '#grapes-wrapper' });
+ } else {
+ x2.fullscreen = 1;
+ editor.runCommand('fullscreen', { target: '#grapes-wrapper' });
+ }
+ },
+ togglable: false,
+ attributes: { title: 'Fullscreen' },
+ }, {
+ id: 'show-layers',
+ className: 'fa fa-bars',
+ command: 'show-layers',
+ // Once activated disable the possibility to turn it off
+ togglable: false,
+ attributes: { title: 'Layers' },
+ }, {
+ id: 'show-style',
+ className: 'fa fa-paint-brush',
+ command: 'show-styles',
+ togglable: false,
+ attributes: { title: 'Style' },
+ }, {
+ id: 'show-traits',
+ className: 'fa fa-cog',
+ command: 'show-traits',
+ togglable: false,
+ attributes: { title: 'Traits' },
+ }, {
+ id: 'show-blocks',
+ active: false,
+ className: 'fa fa-th-large',
+ command: 'show-blocks',
+ togglable: false,
+ attributes: { title: 'Blocks' },
+ }, {
+ id: 'save-button',
+ className: 'btn-save-template fa fa-floppy-o',
+ attributes: { title: 'Save' },
+ context: 'save-template',
+ command(editor) {
+ const RemoteStorage = editor.StorageManager.get('remote');
+ RemoteStorage.set('params', {
+ docName: $('#doc-name').val(),
+ gjsinlineCss: editor.runCommand('gjs-get-inlined-html'),
+ [config.csrfTokenName]: config.csrfToken,
+ info: $('#Docs_info').val(),
+ redirectUrl: $('#Docs_redirectURL').val(),
+ subject:$('#doc-subject').val()
+ });
+ editor.store(res => {
+ if (res.url !== undefined) RemoteStorage.set({urlStore: res.url});
+ });
+ if ($('#doc-name').val()) {
+ alert('Saved!');
+ } else {
+ alert('Please enter a name for the template.');
+ }
+ },
+ },],
+ }, {
+ id: 'panel-devices',
+ el: '.panel__devices',
+ buttons: [{
+ id: 'device-desktop',
+ className: 'fa fa-desktop',
+ command: 'set-device-desktop',
+ active: true,
+ togglable: false,
+ attributes: {
+ 'title': 'Desktop',
+ 'data-tooltip-pos': 'bottom',
+ 'data-tooltip': 'title',
+ }
+ }, {
+ id: 'device-tablet',
+ className: 'fa fa-tablet',
+ command: 'set-device-tablet',
+ togglable: false,
+ attributes: {
+ 'title': 'Tablet',
+ 'data-tooltip-pos': 'bottom',
+ 'data-tooltip': 'title',
+ }
+ }, {
+ id: 'device-mobile',
+ className: 'fa fa-mobile',
+ command: 'set-device-mobile',
+ togglable: false,
+ attributes: {
+ 'title': 'Mobile',
+ 'data-tooltip-pos': 'bottom',
+ 'data-tooltip': 'title',
+ }
+ }],
+ },
+
+ ]
+ },
+ deviceManager: {
+ devices: [{
+ name: 'Desktop',
+ width: '', // default size
+ }, {
+ name: 'Tablet',
+ width: '680px', // this value will be used on canvas width
+ widthMedia: '767px', // this value will be used in CSS @media
+ }, {
+ name: 'Mobile',
+ width: '320px', // this value will be used on canvas width
+ widthMedia: '480px', // this value will be used in CSS @media
+ }]
+ },
+ traitManager: {
+ appendTo: '.traits-container',
+ },
+ selectorManager: {
+ appendTo: '.styles-container'
+ },
+ styleManager: {
+ appendTo: '.styles-container',
+ sectors: [{
+ name: 'Dimension',
+ open: false,
+ // Use built-in properties
+ buildProps: ['width', 'min-height', 'padding'],
+ // Use `properties` to define/override single property
+ properties: [
+ {
+ // Type of the input,
+ // options: integer | radio | select | color | slider | file | composite | stack
+ type: 'integer',
+ name: 'The width', // Label for the property
+ property: 'width', // CSS property (if buildProps contains it will be extended)
+ units: ['px', '%'], // Units, available only for 'integer' types
+ defaults: 'auto', // Default value
+ min: 0, // Min value, available only for 'integer' types
+ }
+ ]
+ }, {
+ name: 'Extra',
+ open: false,
+ buildProps: ['background-color', 'box-shadow', 'custom-prop'],
+ properties: [
+ {
+ id: 'custom-prop',
+ name: 'Custom Label',
+ property: 'font-size',
+ type: 'select',
+ defaults: '32px',
+ // List of options, available only for 'select' and 'radio' types
+ options: [
+ { value: '12px', name: 'Tiny' },
+ { value: '18px', name: 'Medium' },
+ { value: '32px', name: 'Big' },
+ ],
+ }
+ ]
+ }]
+ },
+ blockManager: {
+ appendTo: '#blocks',
+ blocks: [
+ {
+ id: 'section', // id is mandatory
+ label: 'Section ', // You can use HTML/SVG inside labels
+ attributes: { class: 'gjs-block-section' },
+ content: `
+ This is a simple title
+ This is just a Lorem text: Lorem ipsum dolor sit amet
+ `,
+ }, {
+ id: 'text',
+ label: 'Text',
+ content: 'Insert your text here
',
+ }, {
+ id: 'image',
+ label: 'Image',
+ // Select the component once it's dropped
+ select: true,
+ // You can pass components as a JSON instead of a simple HTML string,
+ // in this case we also use a defined component type `image`
+ content: { type: 'image' },
+ // This triggers `active` event on dropped components and the `image`
+ // reacts by opening the AssetManager
+ activate: true,
+ }, {
+ id: 'column1',
+ label: 'Column',
+ //content: 'Insert your text here
',
+ }
+ ]
+ },
+ assetManager: {
+ upload: yii.scriptUrl + '/media/addImages',
+ uploadName: 'upload',
+ params: { [config.csrfTokenName]: config.csrfToken },
+ multiUpload: false,
+ handleAdd: (url) => {
+ if (!url.includes('://')) url = 'https://' + url; //https default protocol
+ url = url.replace(/(^http:\/\/)/, 'https://'); // change http to https
+ editor.AssetManager.add(url);
+ }
+ },
+ });
+
+ editor.Panels.addPanel({
+ id: 'panel-top',
+ el: '.panel__top',
+ });
+
+ editor.Panels.addPanel({
+ id: 'basic-actions',
+ el: '.panel__basic-actions',
+ buttons: [
+ {
+ id: 'visibility',
+ active: false, // active by default
+ className: 'btn-toggle-borders fa fa-object-group',
+ attributes: { title: 'Toggle Borders' },
+ command: 'sw-visibility', // Built-in command
+ }, {
+ id: 'show-preview',
+ className: 'btn-show-preview fa fa-eye',
+ attributes: { title: 'Preview' },
+ context: 'show-preview',
+ command: 'preview',
+ }, {
+ id: 'show-json',
+ className: 'btn-show-json fa fa-cube',
+ attributes: { title: 'JSON' },
+ context: 'show-json',
+ command(editor) {
+ editor.Modal.setTitle('Components JSON')
+ .setContent(``)
+ .open();
+ },
+ }, {
+ id: 'edit',
+ command: 'html-edit',
+ className: 'fa fa-code',
+ attributes: { title: 'Edit HTML' },
+ }, {
+ id: 'export',
+ className: 'btn-open-export fa fa-share-square-o',
+ attributes: { title: 'Export Template' },
+ command: 'export-template',
+ context: 'export-template', // For grouping context of buttons from the same panel
+ },
+ ],
+ });
+ var pfx = editor.getConfig().stylePrefix;
+ var modal = editor.Modal;
+ var cmdm = editor.Commands;
+ var codeViewer = editor.CodeManager.getViewer('CodeMirror').clone();
+ var container = document.createElement('div');
+ var btnEdit = document.createElement('div');
+
+ codeViewer.set({
+ codeName: 'htmlmixed',
+ readOnly: 0,
+ theme: 'hopscotch',
+ autoBeautify: true,
+ autoCloseTags: true,
+ autoCloseBrackets: true,
+ lineWrapping: true,
+ styleActiveLine: true,
+ smartIndent: true,
+ indentWithTabs: true
+ });
+
+ btnEdit.innerHTML = 'Edit';
+ btnEdit.className = pfx + 'btn-prim ' + pfx + 'btn-import';
+ btnEdit.onclick = function () {
+ var code = codeViewer.editor.getValue();
+ editor.DomComponents.getWrapper().set('content', '');
+ editor.setComponents(code.trim());
+ modal.close();
+ };
+
+ cmdm.add('html-edit', {
+ run: function (editor, sender) {
+ sender && sender.set('active', 0);
+ var viewer = codeViewer.editor;
+ modal.setTitle('Edit code');
+ if (!viewer) {
+ var txtarea = document.createElement('textarea');
+ container.appendChild(txtarea);
+ container.appendChild(btnEdit);
+ codeViewer.init(txtarea);
+ viewer = codeViewer.editor;
+ }
+ var InnerHtml = editor.getHtml();
+ var Css = editor.getCss();
+ modal.setContent('');
+ modal.setContent(container);
+ codeViewer.setContent(InnerHtml + '');
+ modal.open();
+ viewer.refresh();
+ }
+ });
+
+ // Define commands
+ editor.Commands.add('show-layers', {
+ getRowEl(editor) { return editor.getContainer().closest('.editor-row'); },
+ getLayersEl(row) { return row.querySelector('.layers-container') },
+
+ run(editor, sender) {
+ const lmEl = this.getLayersEl(this.getRowEl(editor));
+ lmEl.style.display = '';
+ },
+ stop(editor, sender) {
+ const lmEl = this.getLayersEl(this.getRowEl(editor));
+ lmEl.style.display = 'none';
+ },
+ });
+ editor.Commands.add('show-styles', {
+ getRowEl(editor) { return editor.getContainer().closest('.editor-row'); },
+ getStyleEl(row) { return row.querySelector('.styles-container') },
+
+ run(editor, sender) {
+ const smEl = this.getStyleEl(this.getRowEl(editor));
+ smEl.style.display = '';
+ },
+ stop(editor, sender) {
+ const smEl = this.getStyleEl(this.getRowEl(editor));
+ smEl.style.display = 'none';
+ },
+ });
+ editor.Commands.add('show-traits', {
+ getTraitsEl(editor) {
+ const row = editor.getContainer().closest('.editor-row');
+ return row.querySelector('.traits-container');
+ },
+ run(editor, sender) {
+ this.getTraitsEl(editor).style.display = '';
+ },
+ stop(editor, sender) {
+ this.getTraitsEl(editor).style.display = 'none';
+ },
+ });
+ editor.Commands.add('show-blocks', {
+ getBlocksEl(editor) {
+ const row = editor.getContainer().closest('.editor-row');
+ return row.querySelector('.blocks-container');
+ },
+ run(editor, sender) {
+ this.getBlocksEl(editor).style.display = '';
+ },
+ stop(editor, sender) {
+ this.getBlocksEl(editor).style.display = 'none';
+ },
+ });
+ editor.Commands.add('set-device-desktop', {
+ run: editor => editor.setDevice('Desktop')
+ });
+ editor.Commands.add('set-device-mobile', {
+ run: editor => editor.setDevice('Mobile')
+ });
+
+ // populate image gallery
+ $.ajax({
+ type: 'GET',
+ url: yii.scriptUrl + '/media/getImages',
+ dataType: 'json',
+ success: function (data) {
+ window.editor.AssetManager.add(data);
+ }
+ });
+
+ ['a', 'center'].forEach(function (tag) {
+ CKEDITOR.dtd.$editable[tag] = 1;
+ });
+
+ // use CKEditor
+ // code mimics CKEditor plugin code with some amendments to make it actually work
+ editor.setCustomRte({
+ enable: function (el, rte) {
+ // Escape uneditable blocks
+ if (CKEDITOR.dtd.$editable[el.tagName.toLowerCase()] !== 1) return null;
+ let rteToolbar = editor.RichTextEditor.getToolbarEl();
+
+ // Hide default RTE
+ [].forEach.call(rteToolbar.children, (child) => {
+ child.style.display = 'none';
+ });
+
+ //if an RTE does not exist, make one
+ if (!rte) {
+ //
+
+ // Spawn CKE toolbar
+ editor.RichTextEditor.getToolbarEl().id = 'rte-toolbar';
+ rte = CKEDITOR.inline(el, {
+ extraPlugins: 'sharedspace,richcombo,insertattributes',
+ removePlugins: 'magicline,link', //get rid of red lines
+ sharedSpaces: {
+ top: 'rte-toolbar',
+ },
+ toolbar: 'MyGrapesToolbar',
+ insertableAttributes: x2.insertableAttributes
+ });
+
+ // Prevent blur when some of CKEditor's element is clicked
+ rte.on('dialogShow', e => {
+ const editorEls = grapesjs.$('.cke_dialog_background_cover, .cke_dialog');
+ ['off', 'on'].forEach(m => editorEls[m]('mousedown', stopPropagation));
+ });
+ // Correct toolbar position
+ rte.on('instanceReady', e => {
+ let toolbar = rteToolbar.querySelector('#cke_' + rte.name);
+ if (toolbar) toolbar.style.display = 'block';
+ editor.trigger('canvasScroll');
+ });
+ }
+ editor.trigger('canvasScroll'); // also to correct toolbar position
+ this.focus(el, rte);
+
+ // allow mutiple edits of link (bugfix)
+ if (el.tagName == 'A' && el.getAttribute('href')) el.removeAttribute('href');
+
+ return rte;
+ },
+ disable: function (el, rte) {
+ el.contentEditable = false;
+ if (rte && rte.focusManager) {
+ rte.focusManager.blur(true);
+ }
+ },
+ focus: function (el, rte) {
+ // Do nothing if already focused
+ if (rte && rte.focusManager.hasFocus) {
+ return;
+ }
+ el.contentEditable = true;
+ rte && rte.focus();
+ },
+ });
+
+ if (config.urlLoad) editor.load(res => console.log(res));
+
+ // only display show-blocks on start
+ editor.Panels.getButton('panel-switcher', 'show-layers').set('active', true)
+ editor.Panels.getButton('panel-switcher', 'show-style').set('active', true)
+ editor.Panels.getButton('panel-switcher', 'show-traits').set('active', true)
+ editor.Panels.getButton('panel-switcher', 'show-blocks').set('active', true)
+
+ // Switch to style panel when a style-able component is clicked
+ editor.on('component:selected', () => {
+ const openSmBtn = editor.Panels.getButton('panel-switcher', 'show-style');
+ const openLayersBtn = editor.Panels.getButton('panel-switcher', 'show-layers');
+
+ // Don't switch when the Layer Manager is on or
+ // there is no selected component
+ if ((!openLayersBtn || !openLayersBtn.get('active')) && editor.getSelected()) {
+ openSmBtn && openSmBtn.set('active', 1);
+ }
+ });
+ },
+ destroy: () => {
+ $(x2grapes.config.wrapper).html("");
+ },
+ reinitialize: (config) => {
+ $(x2grapes.config.wrapper).html(x2grapes.initElems());
+ x2grapes.initialize(config);
+ },
+ initElems: () => {
+ return `
+
+
+ `;
+ }
+}
+
diff --git a/x2engine/js/X2RelativeConditionList.js b/x2engine/js/X2RelativeConditionList.js
new file mode 100644
index 000000000..33478d8d7
--- /dev/null
+++ b/x2engine/js/X2RelativeConditionList.js
@@ -0,0 +1,181 @@
+/***********************************************************************************
+ * X2Engine Open Source Edition is a customer relationship management program developed by
+ * X2 Engine, Inc. Copyright (C) 2011-2019 X2 Engine Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Affero General Public License version 3 as published by the
+ * Free Software Foundation with the addition of the following permission added
+ * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
+ * IN WHICH THE COPYRIGHT IS OWNED BY X2ENGINE, X2ENGINE DISCLAIMS THE WARRANTY
+ * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Affero General Public License along with
+ * this program; if not, see http://www.gnu.org/licenses or write to the Free
+ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ *
+ * You can contact X2Engine, Inc. P.O. Box 610121, Redwood City,
+ * California 94061, USA. or at email address contact@x2engine.com.
+ *
+ * The interactive user interfaces in modified source and object code versions
+ * of this program must display Appropriate Legal Notices, as required under
+ * Section 5 of the GNU Affero General Public License version 3.
+ *
+ * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
+ * these Appropriate Legal Notices must retain the display of the "Powered by
+ * X2 Engine" logo. If the display of the logo is not reasonably feasible for
+ * technical reasons, the Appropriate Legal Notices must display the words
+ * "Powered by X2 Engine".
+ **********************************************************************************/
+
+
+
+x2.RelativeConditionList = (function () {
+
+function RelativeConditionList (argsDict) {
+ var that = this;
+ var argsDict = typeof argsDict === 'undefined' ? {} : argsDict;
+ var defaultArgs = {
+ DEBUG: x2.DEBUG && false,
+ containerSelector: '',
+ visibilityOptions: {},
+ operatorList: {},
+ allTags: {},
+ options: [],
+ modelClass: '',
+ value: []
+ };
+ auxlib.applyArgs (this, defaultArgs, argsDict);
+
+ this._container$ = $(this.containerSelector);
+ this._sortList$ = this._container$.children ('.x2-cond-list');
+ this._addCondButton$ = this._container$.find ('button');
+ var fieldsOptions = {};
+ var newOptionsCombined = []
+ for (var elemArray in this.options) {
+ newOptionsCombined = newOptionsCombined.concat(this.options[elemArray]);
+ }
+ fieldsOptions[this.modelClass+"_all"] = newOptionsCombined;
+ this._fields = new x2.FieldsGeneric ({
+ templateSelector: this.containerSelector + ' .x2fields-template',
+ options: fieldsOptions,
+ visibilityOptions: this.visibilityOptions,
+ operatorList: this.operatorList,
+ allTags: this.allTags
+ });
+ this._fields.addChangeListener (this.containerSelector, function () {
+ that._reindexInputs ();
+ })
+ this._fields.enableChangedOperator = true;
+ this._init ();
+}
+
+/*
+Public static methods
+*/
+
+/*
+Private static methods
+*/
+
+/*
+Public instance methods
+*/
+
+/*
+Private instance methods
+*/
+
+/**
+ * Sets up behavior of add/delete condition buttons
+ */
+RelativeConditionList.prototype._setUpAddRemoveConditionBehavior = function () {
+ var that = this;
+ this._addCondButton$.click (function () {
+ var field$ = that._fields.createAttrListItem(that.modelClass, that.options)
+ .hide()
+ .appendTo(that._sortList$.children ('ol'))
+ .slideDown(200);
+ var i = that._sortList$.children ('ol').children ().length - 1;
+ var attr;
+ field$.find (':input').each (function (index, elem) {
+ attr = $(elem).attr ('name');
+ if (typeof attr !== 'undefined' && attr !== false && $(elem).attr ('name')) {
+ $(elem).attr ('name', $(elem).attr ('name').replace (/\[i\]/, '[' + i + ']'));
+ }
+ });
+ return false;
+ });
+
+ // Listen for clicks on the "delete condition" buttom
+ this._container$.on("click", "a.del", function() {
+ $(this).closest("li").slideUp(200, function(){
+ $(this).remove();
+ that._reindexInputs ();
+ });
+ });
+};
+
+/**
+ * Used to retrieve condition input values for form submission
+ * @deprecated condition list inputs now have names that allow form to be correctly serialized,
+ * simplifying AJAX form submission
+ * @return object contains information about each condition (name, operator, and value)
+ */
+RelativeConditionList.prototype.getAttributesConfig = function () {
+ var that = this;
+ var attributeRows = this._sortList$.children ('ol').children ('li');
+ var attrConfig = [];
+ if(attributeRows.length) {
+ attributeRows.each(function(i, elem) {
+ attrConfig.push({
+ name:$(elem).find(".x2fields-attribute select, .x2fields-attribute input").
+ first().val(),
+ operator:$(elem).find(".x2fields-operator select").first().val(),
+ value:that._fields.getVal($(elem).
+ find(".x2fields-value :input[name='value']").first())
+ });
+ });
+ }
+ return attrConfig;
+};
+
+/**
+ * Reindexes input names, ensuring that numeric indices are sequential and start at 0
+ */
+RelativeConditionList.prototype._reindexInputs = function () {
+ var that = this;
+ this._sortList$.children ('ol').children ().each (function (i, elem) {
+ $(elem).find (':input').each (function (j, elem) {
+ if ($(elem).attr ('name'))
+ $(elem).attr ('name', $(elem).attr ('name').replace (/\[[i0-9]+\]/, '[' + i + ']'));
+ });
+ });
+};
+
+RelativeConditionList.prototype._addPreexistingValues = function () {
+ var that = this;
+
+ for (var i in this.value) {
+ var val = this.value[i];
+ var field$ = that._fields.createAttrListItem(that.modelClass, that.options)
+ that._sortList$.children ('ol').append (field$);
+ field$.find ('.x2fields-attribute :input').val (val.name).change ();
+ field$.find ('.x2fields-value :input').val (val.value);
+ }
+ this._reindexInputs ();
+};
+
+RelativeConditionList.prototype._init = function () {
+ this._setUpAddRemoveConditionBehavior ();
+ this._addPreexistingValues ();
+};
+
+return RelativeConditionList;
+
+}) ();
diff --git a/x2engine/js/X2SubTotalConditionList.js b/x2engine/js/X2SubTotalConditionList.js
new file mode 100644
index 000000000..2dcb4d370
--- /dev/null
+++ b/x2engine/js/X2SubTotalConditionList.js
@@ -0,0 +1,182 @@
+/***********************************************************************************
+ * X2Engine Open Source Edition is a customer relationship management program developed by
+ * X2 Engine, Inc. Copyright (C) 2011-2019 X2 Engine Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU Affero General Public License version 3 as published by the
+ * Free Software Foundation with the addition of the following permission added
+ * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
+ * IN WHICH THE COPYRIGHT IS OWNED BY X2ENGINE, X2ENGINE DISCLAIMS THE WARRANTY
+ * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Affero General Public License along with
+ * this program; if not, see http://www.gnu.org/licenses or write to the Free
+ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA.
+ *
+ * You can contact X2Engine, Inc. P.O. Box 610121, Redwood City,
+ * California 94061, USA. or at email address contact@x2engine.com.
+ *
+ * The interactive user interfaces in modified source and object code versions
+ * of this program must display Appropriate Legal Notices, as required under
+ * Section 5 of the GNU Affero General Public License version 3.
+ *
+ * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
+ * these Appropriate Legal Notices must retain the display of the "Powered by
+ * X2 Engine" logo. If the display of the logo is not reasonably feasible for
+ * technical reasons, the Appropriate Legal Notices must display the words
+ * "Powered by X2 Engine".
+ **********************************************************************************/
+
+
+
+x2.ConditionList = (function () {
+
+function ConditionList (argsDict) {
+ var that = this;
+ var argsDict = typeof argsDict === 'undefined' ? {} : argsDict;
+ var defaultArgs = {
+ DEBUG: x2.DEBUG && false,
+ containerSelector: '',
+ visibilityOptions: {},
+ operatorList: {},
+ allTags: {},
+ options: [],
+ modelClass: '',
+ value: []
+ };
+ auxlib.applyArgs (this, defaultArgs, argsDict);
+
+ this._container$ = $(this.containerSelector);
+ this._sortList$ = this._container$.children ('.x2-cond-list');
+ this._addCondButton$ = this._container$.find ('button');
+ var fieldsOptions = {};
+ var newOptionsCombined = []
+ for (var elemArray in this.options) {
+ newOptionsCombined = newOptionsCombined.concat(this.options[elemArray]);
+ }
+ fieldsOptions[this.modelClass+"_all"] = newOptionsCombined;
+ this._fields = new x2.FieldsGeneric ({
+ templateSelector: this.containerSelector + ' .x2fields-template',
+ options: fieldsOptions,
+ visibilityOptions: this.visibilityOptions,
+ operatorList: this.operatorList,
+ allTags: this.allTags
+ });
+ this._fields.addChangeListener (this.containerSelector, function () {
+ that._reindexInputs ();
+ })
+ this._fields.enableChangedOperator = true;
+ this._init ();
+}
+
+/*
+Public static methods
+*/
+
+/*
+Private static methods
+*/
+
+/*
+Public instance methods
+*/
+
+/*
+Private instance methods
+*/
+
+/**
+ * Sets up behavior of add/delete condition buttons
+ */
+ConditionList.prototype._setUpAddRemoveConditionBehavior = function () {
+ var that = this;
+ this._addCondButton$.click (function () {
+ var field$ = that._fields.createAttrListItem(that.modelClass, that.options)
+ .hide()
+ .appendTo(that._sortList$.children ('ol'))
+ .slideDown(200);
+ var i = that._sortList$.children ('ol').children ().length - 1;
+ var attr;
+ field$.find (':input').each (function (index, elem) {
+ attr = $(elem).attr ('name');
+ if (typeof attr !== 'undefined' && attr !== false && $(elem).attr ('name')) {
+ $(elem).attr ('name', $(elem).attr ('name').replace (/\[i\]/, '[' + i + ']'));
+ }
+ });
+ return false;
+ });
+
+ // Listen for clicks on the "delete condition" buttom
+ this._container$.on("click", "a.del", function() {
+ $(this).closest("li").slideUp(200, function(){
+ $(this).remove();
+ that._reindexInputs ();
+ });
+ });
+};
+
+/**
+ * Used to retrieve condition input values for form submission
+ * @deprecated condition list inputs now have names that allow form to be correctly serialized,
+ * simplifying AJAX form submission
+ * @return object contains information about each condition (name, operator, and value)
+ */
+ConditionList.prototype.getAttributesConfig = function () {
+ var that = this;
+ var attributeRows = this._sortList$.children ('ol').children ('li');
+ var attrConfig = [];
+ if(attributeRows.length) {
+ attributeRows.each(function(i, elem) {
+ attrConfig.push({
+ name:$(elem).find(".x2fields-attribute select, .x2fields-attribute input").
+ first().val(),
+ operator:$(elem).find(".x2fields-operator select").first().val(),
+ value:that._fields.getVal($(elem).
+ find(".x2fields-value :input[name='value']").first())
+ });
+ });
+ }
+ return attrConfig;
+};
+
+/**
+ * Reindexes input names, ensuring that numeric indices are sequential and start at 0
+ */
+ConditionList.prototype._reindexInputs = function () {
+ var that = this;
+ this._sortList$.children ('ol').children ().each (function (i, elem) {
+ $(elem).find (':input').each (function (j, elem) {
+ if ($(elem).attr ('name'))
+ $(elem).attr ('name', $(elem).attr ('name').replace (/\[[i0-9]+\]/, '[' + i + ']'));
+ });
+ });
+};
+
+ConditionList.prototype._addPreexistingValues = function () {
+ var that = this;
+
+ for (var i in this.value) {
+ var val = this.value[i];
+ var field$ = that._fields.createAttrListItem(that.modelClass, that.options)
+ that._sortList$.children ('ol').append (field$);
+ field$.find ('.x2fields-attribute :input').val (val.name).change ();
+
+ field$.find ('.x2fields-value :input').val (val.value);
+ }
+ this._reindexInputs ();
+};
+
+ConditionList.prototype._init = function () {
+ this._setUpAddRemoveConditionBehavior ();
+ this._addPreexistingValues ();
+};
+
+return ConditionList;
+
+}) ();
diff --git a/x2engine/js/bb/billboard.min.css b/x2engine/js/bb/billboard.min.css
new file mode 100644
index 000000000..1eb76c743
--- /dev/null
+++ b/x2engine/js/bb/billboard.min.css
@@ -0,0 +1,11 @@
+/*!
+ * Copyright (c) 2017 ~ present NAVER Corp.
+ * billboard.js project is licensed under the MIT license
+ *
+ * billboard.js, JavaScript chart library
+ * http://naver.github.io/billboard.js/
+ *
+ * @version 1.10.0
+ */
+.bb svg{font:10px sans-serif;-webkit-tap-highlight-color:rgba(0,0,0,0)}.bb line,.bb path{fill:none;stroke:#000}.bb .bb-button,.bb text{-webkit-user-select:none;-moz-user-select:none;user-select:none}.bb-bars path,.bb-event-rect,.bb-legend-item-tile,.bb-xgrid-focus,.bb-ygrid{shape-rendering:crispEdges}.bb-chart-arc path{stroke:#fff}.bb-chart-arc text{fill:#fff;font-size:13px}.bb-axis{shape-rendering:crispEdges}.bb-grid line{stroke:#aaa}.bb-grid text{fill:#aaa}.bb-xgrid,.bb-ygrid{stroke-dasharray:3 3}.bb-text.bb-empty{fill:grey;font-size:2em}.bb-line{stroke-width:1px}.bb-circle._expanded_{stroke-width:1px;stroke:#fff}.bb-selected-circle{fill:#fff;stroke-width:2px}.bb-bar{stroke-width:0}.bb-bar._expanded_{fill-opacity:.75}.bb-target.bb-focused{opacity:1}.bb-target.bb-focused path.bb-line,.bb-target.bb-focused path.bb-step{stroke-width:2px}.bb-target.bb-defocused{opacity:.3!important}.bb-region{fill:#4682b4;fill-opacity:.1}.bb-brush .extent,.bb-zoom-brush{fill-opacity:.1}.bb-legend-item{font-size:12px;user-select:none}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{opacity:.75;fill:#fff;stroke:#d3d3d3;stroke-width:1}.bb-title{font:14px sans-serif}.bb-tooltip-container{z-index:10}.bb-tooltip{border-collapse:collapse;border-spacing:0;background-color:#fff;empty-cells:show;opacity:.9;-webkit-box-shadow:7px 7px 12px -9px #777;-moz-box-shadow:7px 7px 12px -9px #777;box-shadow:7px 7px 12px -9px #777}.bb-tooltip tr{border:1px solid #ccc}.bb-tooltip th{background-color:#aaa;font-size:14px;padding:2px 5px;text-align:left;color:#fff}.bb-tooltip td{font-size:13px;padding:3px 6px;background-color:#fff;border-left:1px dotted #999}.bb-tooltip td>span,.bb-tooltip td>svg{display:inline-block;width:10px;height:10px;margin-right:6px}.bb-tooltip.value{text-align:right}.bb-area{stroke-width:0;opacity:.2}.bb-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}.bb-chart-arcs-gauge-title{dominant-baseline:middle;font-size:2.7em}.bb-chart-arcs .bb-chart-arcs-background{fill:#e0e0e0;stroke:none}.bb-chart-arcs .bb-chart-arcs-gauge-unit{fill:#000;font-size:16px}.bb-chart-arcs .bb-chart-arcs-gauge-max,.bb-chart-arcs .bb-chart-arcs-gauge-min{fill:#777}.bb-chart-arc .bb-gauge-value{fill:#000}.bb-chart-radars .bb-levels polygon{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-levels text{fill:#848282}.bb-chart-radars .bb-axis line{stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-axis text{font-size:1.15em;cursor:default}.bb-chart-radars .bb-shapes polygon{fill-opacity:.2;stroke-width:1px}.bb-button{position:absolute;top:10px;right:10px}.bb-button .bb-zoom-reset{font-size:11px;border:1px solid #ccc;background-color:#fff;padding:5px;border-radius:5px;cursor:pointer}
+/*# sourceMappingURL=billboard.min.css.map*/
\ No newline at end of file
diff --git a/x2engine/js/bb/billboard.min.js b/x2engine/js/bb/billboard.min.js
new file mode 100644
index 000000000..51d8105cd
--- /dev/null
+++ b/x2engine/js/bb/billboard.min.js
@@ -0,0 +1,11 @@
+/*!
+ * Copyright (c) 2017 ~ present NAVER Corp.
+ * billboard.js project is licensed under the MIT license
+ *
+ * billboard.js, JavaScript chart library
+ * http://naver.github.io/billboard.js/
+ *
+ * @version 1.10.0
+ */
+!function webpackUniversalModuleDefinition(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("d3-time-format"),require("d3-selection"),require("d3-transition"),require("d3-axis"),require("d3-brush"),require("d3-scale"),require("d3-dsv"),require("d3-drag"),require("d3-shape"),require("d3-interpolate"),require("d3-color"),require("d3-zoom"),require("d3-ease"));else if("function"==typeof define&&define.amd)define(["d3-time-format","d3-selection","d3-transition","d3-axis","d3-brush","d3-scale","d3-dsv","d3-drag","d3-shape","d3-interpolate","d3-color","d3-zoom","d3-ease"],e);else{var i="object"==typeof exports?e(require("d3-time-format"),require("d3-selection"),require("d3-transition"),require("d3-axis"),require("d3-brush"),require("d3-scale"),require("d3-dsv"),require("d3-drag"),require("d3-shape"),require("d3-interpolate"),require("d3-color"),require("d3-zoom"),require("d3-ease")):e(t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3,t.d3);for(var n in i)("object"==typeof exports?exports:t)[n]=i[n]}}(this,function(i,n,a,r,o,s,c,l,u,d,g,h,f){return x={},__webpack_require__.m=p=[function(t,e,i){i(1),t.exports=i(28)},function(t,e,i){},function(t,e){t.exports=function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,i){var n=i(4),a=i(5),r=i(6);t.exports=function _slicedToArray(t,e){return n(t)||a(t,e)||r()}},function(t,e){t.exports=function _arrayWithHoles(t){if(Array.isArray(t))return t}},function(t,e){t.exports=function _iterableToArrayLimit(t,e){var i=[],n=!0,a=!1,r=void 0;try{for(var o,s=t[Symbol.iterator]();!(n=(o=s.next()).done)&&(i.push(o.value),!e||i.length!==e);n=!0);}catch(t){a=!0,r=t}finally{try{n||null==s.return||s.return()}finally{if(a)throw r}}return i}},function(t,e){t.exports=function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},function(t,e){function _defineProperties(t,e){for(var i=0;i /g,">"):t}function sc(i,t){var n=2n&&(n=(e=t).values.length)}):e=i?t[0]:null,e},mapToIds:function mapToIds(t){return t.map(function(t){return t.id})},mapToTargetIds:function mapToTargetIds(t){return t?mc(t)?t.concat():[t]:this.mapToIds(this.data.targets)},hasTarget:function hasTarget(t,e){for(var i,n=this.mapToIds(t),a=0;i=n[a];a++)if(i===e)return!0;return!1},isTargetToShow:function isTargetToShow(t){return this.hiddenTargetIds.indexOf(t)<0},isLegendToShow:function isLegendToShow(t){return this.hiddenLegendIds.indexOf(t)<0},filterTargetsToShow:function filterTargetsToShow(t){var e=this;return(t||e.data.targets).filter(function(t){return e.isTargetToShow(t.id)})},mapTargetsToUniqueXs:function mapTargetsToUniqueXs(t){var e=[];return t&&t.length&&(e=function(t){return t.filter(function(t,e,i){return i.indexOf(t)===e})}(Dc(t.map(function(t){return t.values.map(function(t){return+t.x})}))),e=this.isTimeSeries()?e.map(function(t){return new Date(+t)}):e.map(function(t){return+t})),Fc(e)},addHiddenTargetIds:function addHiddenTargetIds(t){this.hiddenTargetIds=this.hiddenTargetIds.concat(t)},removeHiddenTargetIds:function removeHiddenTargetIds(e){this.hiddenTargetIds=this.hiddenTargetIds.filter(function(t){return e.indexOf(t)<0})},addHiddenLegendIds:function addHiddenLegendIds(t){this.hiddenLegendIds=this.hiddenLegendIds.concat(t)},removeHiddenLegendIds:function removeHiddenLegendIds(e){this.hiddenLegendIds=this.hiddenLegendIds.filter(function(t){return e.indexOf(t)<0})},getValuesAsIdKeyed:function getValuesAsIdKeyed(t){var n=this,e={},a=n.isMultipleX(),r=a?n.mapTargetsToUniqueXs(t).map(function(t){return bc(t)?t:+t}):null;return t.forEach(function(t){var i=[];t.values.forEach(function(t){var e=t.value;mc(e)?i.push.apply(i,C()(e)):nc(e)&&"high"in e?i.push.apply(i,C()(Object.values(e))):n.isBubbleZType(t)?i.push(n.getBubbleZData(e,"y")):a?i[n.getIndexByX(t.x,r)]=e:i.push(e)}),e[t.id]=i}),e},checkValueInTargets:function checkValueInTargets(t,e){for(var i,n=Object.keys(t),a=0;a=c)&&(a=!0,t.preventDefault())})(B.event),nA(this)}else r.unselectRect(),r.callOverOutForTouch()}).on("touchend.eventRect",function(){var t=lA();!t.empty()&&t.classed(M.eventRect)&&(r.hasArcType()||!r.toggleShape||r.cancelClick)&&r.cancelClick&&(r.cancelClick=!1)})},updateEventRect:function updateEventRect(t){var e,i,n,a,r=this,o=r.config,s=r.zoomScale||r.x,c=t||r.eventRect.data(),l=o.axis_rotated;if(r.isMultipleX())i=e=0,n=r.width,a=r.height;else{var u,d;if(r.isCategorized())u=r.getEventRectWidth(),d=function(t){return s(t.x)-u/2};else{r.updateXs();var g=function(t){var e=t.index;return{prev:r.getPrevX(e),next:r.getNextX(e)}};u=function(t){var e=g(t);return null===e.prev&&null===e.next?l?r.height:r.width:(null===e.prev&&(e.prev=s.domain()[0]),null===e.next&&(e.next=s.domain()[1]),Math.max(0,(s(e.next)-s(e.prev))/2))},d=function(t){var e=g(t),i=t.x;return null===e.prev&&null===e.next?0:(null===e.prev&&(e.prev=s.domain()[0]),(s(i)+s(e.prev))/2)}}e=l?0:d,i=l?d:0,n=l?r.width:u,a=l?u:r.height}c.attr("class",r.classEvent.bind(r)).attr("x",e).attr("y",i).attr("width",n).attr("height",a)},selectRectForSingle:function selectRectForSingle(i,n,a){var r=this,o=r.config,s=o.data_selection_enabled,c=o.data_selection_grouped,l=o.tooltip_grouped,t=r.getAllValuesOnIndex(a);l&&(r.showTooltip(t,i),r.showXGridFocus(t),!s||c)||r.main.selectAll(".".concat(M.shape,"-").concat(a)).each(function(){Object(B.select)(this).classed(M.EXPANDED,!0),s&&n.style("cursor",c?"pointer":null),l||(r.hideXGridFocus(),r.hideTooltip(),c||r.expandCirclesBars(a))}).filter(function(t){return r.isWithinShape(this,t)}).call(function(t){var e=t.data();s&&(c||o.data_selection_isselectable(e))&&n.style("cursor","pointer"),l||(r.showTooltip(e,i),r.showXGridFocus(e),r.unexpandCircles(),t.each(function(t){return r.expandCirclesBars(a,t.id)}))})},expandCirclesBars:function expandCirclesBars(t,e,i){this.config.point_focus_expand_enabled&&this.expandCircles(t,e,i),this.expandBars(t,e,i)},selectRectForMultipleXs:function selectRectForMultipleXs(t){var e=this,i=e.config,n=e.filterTargetsToShow(e.data.targets);if(!e.dragging&&!e.hasArcType(n)){var a=Object(B.mouse)(t),r=e.findClosestFromTargets(n,a);if(!e.mouseover||r&&r.id===e.mouseover.id||(i.data_onout.call(e.api,e.mouseover),e.mouseover=void 0),!r)return void e.unselectRect();var o=(e.isBubbleType(r)||e.isScatterType(r)||!i.tooltip_grouped?[r]:e.filterByX(n,r.x)).map(function(t){return e.addName(t)});e.showTooltip(o,t),e.expandCirclesBars(r.index,r.id,!0),e.showXGridFocus(o),(e.isBarType(r.id)||e.dist(r,a)i.gauge_max&&(i.gauge_max=o);var s=Math.PI*(i.gauge_fullCircle?2:1),c=i.gauge_startingAngle,l=s*(o/(i.gauge_max-i.gauge_min));n=e.pie.startAngle(c).endAngle(l+c)}return n(e.filterTargetsToShow()).forEach(function(t){r||t.data.id!==a.data.id||(r=!0,a=t)}),isNaN(a.startAngle)&&(a.startAngle=0),isNaN(a.endAngle)&&(a.endAngle=a.startAngle),r?a:null},getSvgArc:function getSvgArc(){function nF(t,e){var i="M 0 0";if(t.value||t.data){cc(r)||(o=o.innerRadius(a.getInnerRadius(t)));var n=!e&&a.updateAngle(t);e?i=o(t):n&&(i=o(n))}return i}var a=this,r=a.getInnerRadius(),o=Object(w.arc)().outerRadius(a.radius).innerRadius(cc(r)?r:0);return nF.centroid=o.centroid,nF},getSvgArcExpanded:function getSvgArcExpanded(t){var i=this,n=Object(w.arc)().outerRadius(i.radiusExpanded*(t||1));return function(t){var e=i.updateAngle(t);return e?n.innerRadius(i.getInnerRadius(t))(e):"M 0 0"}},getArc:function getArc(t,e,i){return i||this.isArcType(t.data)?this.svgArc(t,e):"M 0 0"},transformForArcLabel:function transformForArcLabel(t){var e=this,i=e.config,n=e.updateAngle(t),a="";if(n&&(!e.hasType("gauge")||e.hasMultiTargets())){var r=this.svgArc.centroid(n),o=isNaN(r[0])?0:r[0],s=isNaN(r[1])?0:r[1],c=Math.sqrt(o*o+s*s),l=e.hasType("donut")&&i.donut_label_ratio||e.hasType("pie")&&i.pie_label_ratio;l=l?ac(l)?l(t,e.radius,c):l:e.radius&&(c?(.375<36/e.radius?1.175-36/e.radius:.8)*e.radius/c:0),a="translate(".concat(o*l,",").concat(s*l,")")}return a},convertToArcData:function convertToArcData(t){return this.addName({id:t.data.id,value:t.value,ratio:this.getRatio("arc",t),index:t.index})},textForArcLabel:function textForArcLabel(t){var c=this;c.shouldShowArcLabel()&&t.each(function(t){var e=Object(B.select)(this),i=c.updateAngle(t),n=i?i.value:null,a=c.getRatio("arc",i),r=t.data.id,o=c.hasType("gauge");if(o||c.meetsArcLabelThreshold(a)){var s=(c.getArcLabelFormat()||c.defaultArcValueFormat)(n,a,r).toString();sc(e,s,[-1,1],o)}})},textForGaugeMinMax:function textForGaugeMinMax(t,e){var i=this.getGaugeLabelExtents();return i?i(t,e):t},expandArc:function expandArc(t){var i=this;if(i.transiting)var e=setInterval(function(){i.transiting||(clearInterval(e),0r.width?n=r.width-i.getBoundingClientRect().width:n<0&&(n=4)),s&&(n+=r.getCenteredTextPos(e,t,i)),n+(o.data_labels_position.x||0)},getYForText:function getYForText(t,e,i){var n,a=this,r=a.config,o=r.axis_rotated,s=r.point_r,c=i.getBoundingClientRect(),l=3;if(o)n=(t[0][0]+t[2][0]+.6*c.height)/2;else if(n=t[2][1],cc(s)&&5this.height&&(n=this.height-4)}return o||(n+=a.getCenteredTextPos(e,t,i)),n+(r.data_labels_position.y||0)}});var R={Area:["area","area-spline","area-spline-range","area-line-range","area-step"],AreaRange:["area-spline-range","area-line-range"],Arc:["pie","donut","gauge","radar"],Line:["line","spline","area","area-spline","area-spline-range","area-line-range","step","area-step"],Step:["step","area-step"],Spline:["spline","area-spline","area-spline-range"]};yc(b.prototype,{setTargetType:function setTargetType(t,e){var i=this,n=i.config;i.mapToTargetIds(t).forEach(function(t){i.withoutFadeIn[t]=e===n.data_types[t],n.data_types[t]=e}),t||(n.data_type=e)},hasType:function hasType(i,t){var n=this.config.data_types,e=t||this.data.targets,a=!1;return e&&e.length?e.forEach(function(t){var e=n[t.id];(e&&0<=e.indexOf(i)||!e&&"line"===i)&&(a=!0)}):Object.keys(n).length?Object.keys(n).forEach(function(t){n[t]===i&&(a=!0)}):a=this.config.data_type===i,a},hasTypeOf:function hasTypeOf(t,e,i){var n=this,a=2i&&(n=n.filter(function(t){return(t+"").indexOf(".")<0}));return n},getGridFilterToRemove:function getGridFilterToRemove(t){return t?function(e){var i=!1;return(mc(t)?t.concat():[t]).forEach(function(t){("value"in t&&e.value===t.value||"class"in t&&e.class===t.class)&&(i=!0)}),i}:function(){return!0}},removeGridLines:function removeGridLines(t,e){var i=this.config,n=this.getGridFilterToRemove(t),a=e?M.xgridLines:M.ygridLines,r=e?M.xgridLine:M.ygridLine;this.main.select(".".concat(a)).selectAll(".".concat(r)).filter(n).transition().duration(i.transition_duration).style("opacity","0").remove();var o="grid_".concat(e?"x":"y","_lines");i[o]=i[o].filter(function toShow(t){return!n(t)})}}),yc(b.prototype,{initTooltip:function initTooltip(){var e=this,i=e.config,t=i.tooltip_contents.bindto;if(e.tooltip=Object(B.select)(t),e.tooltip.empty()&&(e.tooltip=e.selectChart.style("position","relative").append("div").attr("class",M.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none")),i.tooltip_init_show){if(e.isTimeSeries()&&bc(i.tooltip_init_x)){var n,a,r=e.data.targets[0];for(i.tooltip_init_x=e.parseDate(i.tooltip_init_x),n=0;(a=r.values[n])&&a.x-i.tooltip_init_x!=0;n++);i.tooltip_init_x=n}e.tooltip.html(e.getTooltipHTML(e.data.targets.map(function(t){return e.addName(t.values[i.tooltip_init_x])}),e.axis.getXAxisTickFormat(),e.getYFormat(e.hasArcType(null,["radar"])),e.color)),t||e.tooltip.style("top",i.tooltip_init_position.top).style("left",i.tooltip_init_position.left).style("display","block")}},getTooltipHTML:function getTooltipHTML(){for(var t,e,i=this,n=i.config,a=arguments.length,r=Array(a),o=0;o'.concat(T," "):""})}if(v=[x.ratio,x.id,x.index,t],m=rc(c.apply(void 0,[BX(x)].concat(C()(v)))),a.isAreaRangeType(x)){var A=["high","low"].map(function(t){return rc(c.apply(void 0,[a.getAreaRangeData(x,t)].concat(C()(v))))}),w=k()(A,2),L=w[0],S=w[1];m="Mid: ".concat(m," High: ").concat(L," Low: ").concat(S)}if(void 0!==m)if("continue"===function(){if(null===x.name)return"continue";var t=rc(s.apply(void 0,[x.name].concat(C()(v)))),e=u(x),i={CLASS_TOOLTIP_NAME:M.tooltipName+a.getTargetSelectorSuffix(x.id),COLOR:g||!a.patterns?e:' '),NAME:t,VALUE:m};if(g&&nc(d.text)){var n=h.indexOf(x.id);Object.keys(d.text).forEach(function(t){i[t]=d.text[t][n]})}p+=Jc(y[1],i)}())continue}return"".concat(p,"")},getTooltipContentTemplate:function getTooltipContentTemplate(t){return(t||'')).replace(/(\r?\n|\t)/g,"").split(/{{(.*)}}/)},tooltipPosition:function tooltipPosition(t,e,i,n){var a=this,r=a.config,o=Object(B.mouse)(n),s=k()(o,2),c=s[0],l=s[1],u=a.getSvgLeft(!0),d=u+a.currentWidth-a.getCurrentPaddingRight();if(l+=20,a.hasArcType()){"touch"===a.inputType||a.hasType("radar")||(l+=a.height/2,c+=(a.width-(a.isLegendRight?a.getLegendWidth():0))/2)}else{var g=a.x(t[0].x);r.axis_rotated?(l=g+20,c+=u+100,d-=u):(l-=5,c=u+a.getCurrentPaddingLeft(!0)+20+(a.zoomScale?c:g))}var h=c+e;return da.currentHeight&&(l-=i+30),l<0&&(l=0),{top:l,left:c}},showTooltip:function showTooltip(t,e){var i=this,n=i.config,a=n.tooltip_contents.bindto,r=i.hasArcType(null,["radar"]),o=t.filter(function(t){return t&&_b(i.getBaseValue(t))}),s=n.tooltip_position||i.tooltipPosition;if(0!==o.length&&n.tooltip_show){var c=i.tooltip.datum(),l=JSON.stringify(t),u=c&&c.width||0,d=c&&c.height||0;if(!c||c.current!==l){var g=t.concat().sort()[0].index;qc(n.tooltip_onshow,i),i.tooltip.html(i.getTooltipHTML(t,i.axis.getXAxisTickFormat(),i.getYFormat(r),i.color)).style("display",null).style("visibility",null).datum({index:g,current:l,width:u=i.tooltip.property("offsetWidth"),height:d=i.tooltip.property("offsetHeight")}),qc(n.tooltip_onshown,i),i._handleLinkedCharts(!0,g)}if(!a){var h=s.call(this,o,u,d,e);i.tooltip.style("top","".concat(h.top,"px")).style("left","".concat(h.left,"px"))}}},hideTooltip:function hideTooltip(t){var e=this.config;e.tooltip_doNotHide&&!t||(qc(e.tooltip_onhide,this),this.tooltip.style("display","none").style("visibility","hidden").datum(null),qc(e.tooltip_onhidden,this))},_handleLinkedCharts:function _handleLinkedCharts(s,c){var l=this;if(l.config.tooltip_linked){var u=l.config.tooltip_linked_name;(l.api.internal.charts||[]).forEach(function(t){if(t!==l.api){var e=t.internal.config,i=e.tooltip_linked,n=e.tooltip_linked_name,a=O.a.body.contains(t.element);if(i&&u===n&&a){var r=t.internal.tooltip.data()[0],o=c!==(r&&r.index);try{s&&o?t.tooltip.show({index:c}):s||t.tooltip.hide()}catch(t){}}}})}}}),yc(b.prototype,{initLegend:function initLegend(){var t=this,e=t.config;t.legendItemTextBox={},t.legendHasRendered=!1,t.legend=t.svg.append("g"),e.legend_show?(t.legend.attr("transform",t.getTranslate("legend")),t.updateLegend()):(t.legend.style("visibility","hidden"),t.hiddenLegendIds=t.mapToIds(t.data.targets))},updateLegend:function updateLegend(t,e,i){var n=this,a=n.config,r=e||{withTransform:!1,withTransitionForTransform:!1,withTransition:!1};r.withTransition=oc(r,"withTransition",!0),r.withTransitionForTransform=oc(r,"withTransitionForTransform",!0),a.legend_contents_bindto&&a.legend_contents_template?n.updateLegendTemplate():n.updateLegendElement(t||n.mapToIds(n.data.targets),r,i),n.legend.selectAll(".".concat(M.legendItem)).classed(M.legendItemHidden,function(t){return!n.isTargetToShow(t)}),n.updateScales(!1,!n.zoomScale),n.updateSvgSize(),n.transformAll(r.withTransitionForTransform,i),n.legendHasRendered=!0},updateLegendTemplate:function updateLegendTemplate(){var i=this,t=i.config,e=Object(B.select)(t.legend_contents_bindto),n=t.legend_contents_template;if(!e.empty()){var a=i.mapToIds(i.data.targets),r=[],o="";a.forEach(function(t){var e=ac(n)?n.call(i,t,i.color(t),i.api.data(t)[0].values):Jc(n,{COLOR:i.color(t),TITLE:t});e&&(r.push(t),o+=e)});var s=e.html(o).selectAll(function(){return this.childNodes}).data(r);i.setLegendItem(s),i.legend=e}},updateSizeForLegend:function updateSizeForLegend(t){var e=this,i=e.config,n=t.width,a=t.height,r={top:e.isLegendTop?e.getCurrentPaddingTop()+i.legend_inset_y+5.5:e.currentHeight-a-e.getCurrentPaddingBottom()-i.legend_inset_y,left:e.isLegendLeft?e.getCurrentPaddingLeft()+i.legend_inset_x+.5:e.currentWidth-n-e.getCurrentPaddingRight()-i.legend_inset_x+.5};e.margin3={top:e.isLegendRight?0:e.isLegendInset?r.top:e.currentHeight-a,right:NaN,bottom:0,left:e.isLegendRight?e.currentWidth-n:e.isLegendInset?r.left:0}},transformLegend:function transformLegend(t){(t?this.legend.transition():this.legend).attr("transform",this.getTranslate("legend"))},updateLegendStep:function updateLegendStep(t){this.legendStep=t},updateLegendItemWidth:function updateLegendItemWidth(t){this.legendItemWidth=t},updateLegendItemHeight:function updateLegendItemHeight(t){this.legendItemHeight=t},getLegendWidth:function getLegendWidth(){var t=this;return t.config.legend_show?t.isLegendRight||t.isLegendInset?t.legendItemWidth*(t.legendStep+1):t.currentWidth:0},getLegendHeight:function getLegendHeight(){var t=this;return t.config.legend_show?t.isLegendRight?t.currentHeight:Math.max(20,t.legendItemHeight)*(t.legendStep+1):0},opacityForLegend:function opacityForLegend(t){return t.classed(M.legendItemHidden)?null:"1"},opacityForUnfocusedLegend:function opacityForUnfocusedLegend(t){return t.classed(M.legendItemHidden)?null:"0.3"},toggleFocusLegend:function toggleFocusLegend(t,e){var i=this,n=i.mapToTargetIds(t);i.legend.selectAll(".".concat(M.legendItem)).filter(function(t){return 0<=n.indexOf(t)}).classed(M.legendItemFocused,e).transition().duration(100).style("opacity",function(){return(e?i.opacityForLegend:i.opacityForUnfocusedLegend).call(i,Object(B.select)(this))})},revertLegend:function revertLegend(){var t=this;t.legend.selectAll(".".concat(M.legendItem)).classed(M.legendItemFocused,!1).transition().duration(100).style("opacity",function(){return t.opacityForLegend(Object(B.select)(this))})},showLegend:function showLegend(t){var e=this,i=e.config;i.legend_show||(i.legend_show=!0,e.legend.style("visibility","visible"),e.legendHasRendered||e.updateLegend()),e.removeHiddenLegendIds(t),e.legend.selectAll(e.selectorLegends(t)).style("visibility","visible").transition().style("opacity",function(){return e.opacityForLegend(Object(B.select)(this))})},hideLegend:function hideLegend(t){var e=this,i=e.config;i.legend_show&&kc(t)&&(i.legend_show=!1,e.legend.style("visibility","hidden")),e.addHiddenLegendIds(t),e.legend.selectAll(e.selectorLegends(t)).style("opacity","0").style("visibility","hidden")},clearLegendItemTextBoxCache:function clearLegendItemTextBoxCache(){this.legendItemTextBox={}},setLegendItem:function setLegendItem(t){var i=this,e=i.config,n="touch"===i.inputType;t.attr("class",function(t){var e=Object(B.select)(this);return(!e.empty()&&e.attr("class")||"")+i.generateClass(M.legendItem,t)}).style("visibility",function(t){return i.isLegendToShow(t)?"visible":"hidden"}).style("cursor","pointer").on("click",function(t){qc(e.legend_item_onclick,i,t)||(B.event.altKey?(i.api.hide(),i.api.show(t)):(i.api.toggle(t),!n&&i.isTargetToShow(t)?i.api.focus(t):i.api.revert())),n&&i.hideTooltip()}),n||t.on("mouseout",function(t){qc(e.legend_item_onout,i,t)||(Object(B.select)(this).classed(M.legendItemFocused,!1),i.api.revert())}).on("mouseover",function(t){qc(e.legend_item_onover,i,t)||(Object(B.select)(this).classed(M.legendItemFocused,!0),!i.transiting&&i.isTargetToShow(t)&&i.api.focus(t))})},updateLegendElement:function updateLegendElement(t,e){function E$(t,e,i){function f_(t,e){e||(n=(l-x-c)/2)<10&&(n=(l-c)/2,x=0,T++),b[t]=T,y[T]=d.isLegendInset?10:n,v[t]=x,x+=c}var n,a=i===w.length-1,r=function(t,e){return d.legendItemTextBox[e]||(d.legendItemTextBox[e]=d.getTextRect(t,M.legendItem)),d.legendItemTextBox[e]}(t,e),o=r.width+h+(a&&!A?0:10)+g.legend_padding,s=r.height+4,c=A?s:o,l=A?d.getLegendHeight():d.getLegendWidth();if(0===i&&(p=f=T=x=0),g.legend_show&&!d.isLegendToShow(e))return m[e]=0,_[e]=0,b[e]=0,void(v[e]=0);m[e]=o,_[e]=s,(!f||f<=o)&&(f=o),(!p||p<=s)&&(p=s);var u=A?p:f;g.legend_equally?(Object.keys(m).forEach(function(t){return m[t]=f}),Object.keys(_).forEach(function(t){return _[t]=p}),(n=(l-u*w.length)/2)<10?(T=x=0,w.forEach(function(t){return f_(t)})):f_(e,!0)):f_(e)}var i,n,a,d=this,g=d.config,h=g.legend_item_tile_width+5,f=0,p=0,x=0,v={},m={},_={},y=[0],b={},T=0,A=d.isLegendRight||d.isLegendInset,w=t.filter(function(t){return!ec(g.data_names[t])||null!==g.data_names[t]}),r=e.withTransition;d.isLegendInset&&(T=g.legend_inset_step?g.legend_inset_step:w.length,d.updateLegendStep(T)),n=d.isLegendRight?(i=function(t){return f*b[t]},function(t){return y[b[t]]+v[t]}):d.isLegendInset?(i=function(t){return f*b[t]+10},function(t){return y[b[t]]+v[t]}):(i=function(t){return y[b[t]]+v[t]},function(t){return p*b[t]});function F$(t,e){return i(t,e)+4+g.legend_item_tile_width}function G$(t,e){return i(t,e)}function H$(t,e){return i(t,e)-2}function I$(t,e){return i(t,e)-2+g.legend_item_tile_width}function J$(t,e){return n(t,e)+9}function K$(t,e){return n(t,e)-5}function L$(t,e){return n(t,e)+4}var o=-200,s=d.legend.selectAll(".".concat(M.legendItem)).data(w).enter().append("g");d.setLegendItem(s),s.append("text").text(function(t){return ec(g.data_names[t])?g.data_names[t]:t}).each(function(t,e){E$(this,t,e)}).style("pointer-events","none").attr("x",A?F$:o).attr("y",A?o:J$),s.append("rect").attr("class",M.legendItemEvent).style("fill-opacity","0").attr("x",A?G$:o).attr("y",A?o:K$);var c=d.config.legend_usePoint;if(c){var l=[];s.append(function(t){var e=lc(g.point_pattern)?g.point_pattern:[g.point_type];-1===l.indexOf(t)&&l.push(t);var i=e[l.indexOf(t)%e.length];return"rectangle"===i&&(i="rect"),O.a.createElementNS(B.namespaces.svg,d.hasValidPointType(i)?i:"use")}).attr("class",M.legendItemPoint).style("fill",function(t){return d.color(t)}).style("pointer-events","none").attr("href",function(t,e,i){return"use"===i[e].nodeName.toLowerCase()?"#".concat(d.datetimeId,"-point-").concat(t):void 0})}else s.append("line").attr("class",M.legendItemTile).style("stroke",d.color).style("pointer-events","none").attr("x1",A?H$:o).attr("y1",A?o:L$).attr("x2",A?I$:o).attr("y2",A?o:L$).attr("stroke-width",g.legend_item_tile_height);a=d.legend.select(".".concat(M.legendBackground," rect")),d.isLegendInset&&0'":;\[\]\/|~`{}\\]/g,"-"):""},selectorTarget:function selectorTarget(t,e){return"".concat(e||"",".").concat(M.target+this.getTargetSelectorSuffix(t))},selectorTargets:function selectorTargets(t,e){var i=this,n=t||[];return n.length?n.map(function(t){return i.selectorTarget(t,e)}):null},selectorLegend:function selectorLegend(t){return".".concat(M.legendItem+this.getTargetSelectorSuffix(t))},selectorLegends:function selectorLegends(t){var e=this;return t&&t.length?t.map(function(t){return e.selectorLegend(t)}):null}}),yc(Rc.prototype,{focus:function focus(t){var e=this.internal,i=e.mapToTargetIds(t),n=e.svg.selectAll(e.selectorTargets(i.filter(e.isTargetToShow,e)));this.revert(),this.defocus(),n.classed(M.focused,!0).classed(M.defocused,!1),e.hasArcType()&&e.expandArc(i),e.toggleFocusLegend(i,!0),e.focusedTargetIds=i,e.defocusedTargetIds=e.defocusedTargetIds.filter(function(t){return i.indexOf(t)<0})},defocus:function defocus(t){var e=this.internal,i=e.mapToTargetIds(t);e.svg.selectAll(e.selectorTargets(i.filter(e.isTargetToShow,e))).classed(M.focused,!1).classed(M.defocused,!0),e.hasArcType()&&e.unexpandArc(i),e.toggleFocusLegend(i,!1),e.focusedTargetIds=e.focusedTargetIds.filter(function(t){return i.indexOf(t)<0}),e.defocusedTargetIds=i},revert:function revert(t){var e=this.internal,i=e.mapToTargetIds(t);e.svg.selectAll(e.selectorTargets(i)).classed(M.focused,!1).classed(M.defocused,!1),e.hasArcType()&&e.unexpandArc(i),e.config.legend_show&&(e.showLegend(i.filter(e.isLegendToShow.bind(e))),e.legend.selectAll(e.selectorLegends(i)).filter(function(){return Object(B.select)(this).classed(M.legendItemFocused)}).classed(M.legendItemFocused,!1)),e.focusedTargetIds=[],e.defocusedTargetIds=[]}}),yc(Rc.prototype,{_showHide:function _showHide(t,e,i){var n=this.internal,a=n.mapToTargetIds(e);n["".concat(t?"remove":"add","HiddenTargetIds")](a);var r=n.svg.selectAll(n.selectorTargets(a)),o=t?"1":"0";r.transition().style("opacity",o,"important").call(n.endall,function(){r.style("opacity",null).style("opacity",o)}),i.withLegend&&n["".concat(t?"show":"hide","Legend")](a),n.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},show:function show(t,e){var i=1\n\t\t\t\n\t\t\t\t').concat(s,"\n\t\t\t\t").concat(r.replace(/(url\()[^#]+/g,"$1"),"\n\t\t\t ").replace("/\n/g","%0A");return"data:image/svg+xml;base64,".concat(function(t){return btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(t,e){return String.fromCharCode("0x".concat(e))}))}(c))}yc(Rc.prototype,{export:function _export(i,n){var t=this.internal,a={width:t.currentWidth,height:t.currentHeight},e=td(this.element,a);if(ac(n)){var r=new Image;r.crosssOrigin="Anonymous",r.onload=function(){var t=O.a.createElement("canvas"),e=t.getContext("2d");t.width=a.width,t.height=a.height,e.drawImage(r,0,0),n(t.toDataURL(i))},r.src=e}return e}}),i.d(e,"bb",function(){return N});var V={},N={version:"1.10.0",generate:function generate(t){var e=p({},V,t),i=new Rc(e);return i.internal.charts=this.instance,this.instance.push(i),i},defaults:function defaults(t){return nc(t)&&(V=t),V},instance:[],plugin:{},chart:{fn:Rc.prototype,internal:{fn:b.prototype,axis:{fn:y.prototype}}}};e.default=N}],__webpack_require__.c=x,__webpack_require__.d=function(t,e,i){__webpack_require__.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},__webpack_require__.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(__webpack_require__.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)__webpack_require__.d(i,n,function(t){return e[t]}.bind(null,n));return i},__webpack_require__.n=function(t){var e=t&&t.__esModule?function getDefault(){return t.default}:function getModuleExports(){return t};return __webpack_require__.d(e,"a",e),e},__webpack_require__.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=0);function __webpack_require__(t){if(x[t])return x[t].exports;var e=x[t]={i:t,l:!1,exports:{}};return p[t].call(e.exports,e,e.exports,__webpack_require__),e.l=!0,e.exports}var p,x});
+//# sourceMappingURL=billboard.min.js.map
diff --git a/x2engine/js/c3/c3.css b/x2engine/js/c3/c3.css
deleted file mode 100644
index 20ca7ca00..000000000
--- a/x2engine/js/c3/c3.css
+++ /dev/null
@@ -1,219 +0,0 @@
-/*-- Chart --*/
-
-.c3 svg {
- font: 10px sans-serif;
-}
-.c3 path, .c3 line {
- fill: none;
- stroke: #000;
-}
-.c3 text {
- -webkit-user-select: none;
- -moz-user-select: none;
- user-select: none;
-}
-
-.c3-legend-item-tile,
-.c3-xgrid-focus,
-.c3-ygrid,
-.c3-event-rect,
-.c3-bars path {
- shape-rendering: crispEdges;
-}
-
-.c3-chart-arc path {
- stroke: #fff;
-
-}
-.c3-chart-arc text {
- fill: #fff;
- font-size: 13px;
-}
-
-/*-- Axis --*/
-
-.c3-axis-x .tick {
-}
-.c3-axis-x-label {
-}
-
-.c3-axis-y .tick {
-}
-.c3-axis-y-label {
-}
-
-.c3-axis-y2 .tick {
-}
-.c3-axis-y2-label {
-}
-
-/*-- Grid --*/
-
-.c3-grid line {
- stroke: #aaa;
-}
-.c3-grid text {
- fill: #aaa;
-}
-.c3-xgrid, .c3-ygrid {
- stroke-dasharray: 3 3;
-}
-.c3-xgrid-focus {
-}
-
-/*-- Text on Chart --*/
-
-.c3-text {
-}
-
-.c3-text.c3-empty {
- fill: #808080;
- font-size: 2em;
-}
-
-/*-- Line --*/
-
-.c3-line {
- stroke-width: 1px;
-}
-/*-- Point --*/
-
-.c3-circle._expanded_ {
- stroke-width: 1px;
- stroke: white;
-}
-.c3-selected-circle {
- fill: white;
- stroke-width: 2px;
-}
-
-/*-- Bar --*/
-
-.c3-bar {
- stroke-width: 0;
-}
-.c3-bar._expanded_ {
- fill-opacity: 0.75;
-}
-
-/*-- Arc --*/
-
-.c3-chart-arcs-title {
- dominant-baseline: middle;
- font-size: 1.3em;
-}
-
-/*-- Focus --*/
-
-.c3-target.c3-focused {
- opacity: 1;
-}
-.c3-target.c3-focused path.c3-line, .c3-target.c3-focused path.c3-step {
- stroke-width: 2px;
-}
-.c3-target.c3-defocused {
- opacity: 0.3 !important;
-}
-
-
-/*-- Region --*/
-
-.c3-region {
- fill: steelblue;
- fill-opacity: .1;
-}
-
-/*-- Brush --*/
-
-.c3-brush .extent {
- fill-opacity: .1;
-}
-
-/*-- Select - Drag --*/
-
-.c3-dragarea {
-}
-
-/*-- Legend --*/
-
-.c3-legend-item {
- font-size: 12px;
-}
-.c3-legend-item-hidden {
- opacity: 0.15;
-}
-
-.c3-legend-background {
- opacity: 0.75;
- fill: white;
- stroke: lightgray;
- stroke-width: 1
-}
-
-/*-- Tooltip --*/
-
-.c3-tooltip-container {
- z-index: 10;
-}
-.c3-tooltip {
- border-collapse:collapse;
- border-spacing:0;
- background-color:#fff;
- empty-cells:show;
- width:auto;
- -webkit-box-shadow: 7px 7px 12px -9px rgb(119,119,119);
- -moz-box-shadow: 7px 7px 12px -9px rgb(119,119,119);
- box-shadow: 7px 7px 12px -9px rgb(119,119,119);
- opacity: 0.9;
-}
-.c3-tooltip tr {
- border:1px solid #CCC;
-}
-.c3-tooltip th {
- background-color: #aaa;
- font-size:14px;
- padding:2px 5px;
- text-align:left;
- color:#FFF;
-}
-.c3-tooltip td {
- font-size:13px;
- padding: 3px 6px;
- background-color:#fff;
- border-left:1px dotted #999;
- color: #000;
-}
-.c3-tooltip td > span {
- display: inline-block;
- width: 10px;
- height: 10px;
- margin-right: 6px;
-}
-.c3-tooltip td.value{
- text-align: right;
-}
-
-.c3-area {
- stroke-width: 0;
- opacity: 0.2;
-}
-
-.c3-chart-arcs .c3-chart-arcs-background {
- fill: #FAFAFA;
- stroke: none;
-}
-.c3-chart-arcs .c3-chart-arcs-gauge-unit {
- fill: #000;
- font-size: 16px;
-}
-.c3-chart-arcs .c3-chart-arcs-gauge-max {
- fill: #777;
-}
-.c3-chart-arcs .c3-chart-arcs-gauge-min {
- fill: #777;
-}
-
-.c3-chart-arc .c3-gauge-value {
- fill: #000;
-/* font-size: 28px !important;*/
-}
\ No newline at end of file
diff --git a/x2engine/js/c3/c3.min.js b/x2engine/js/c3/c3.min.js
deleted file mode 100644
index e0f88ec9f..000000000
--- a/x2engine/js/c3/c3.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-!function(a){"use strict";function b(a){this.owner=a}function c(a,b){if(Object.create)b.prototype=Object.create(a.prototype);else{var c=function(){};c.prototype=a.prototype,b.prototype=new c}return b.prototype.constructor=b,b}function d(a){var b=this.internal=new e(this);b.loadConfig(a),b.init(),function c(a,b,d){Object.keys(a).forEach(function(e){b[e]=a[e].bind(d),Object.keys(a[e]).length>0&&c(a[e],b[e],d)})}(h,this,this)}function e(b){var c=this;c.d3=a.d3?a.d3:"undefined"!=typeof require?require("d3"):void 0,c.api=b,c.config=c.getDefaultConfig(),c.data={},c.cache={},c.axes={}}function f(a){b.call(this,a)}function g(a,b){function c(a,b){a.attr("transform",function(a){return"translate("+Math.ceil(b(a)+t)+", 0)"})}function d(a,b){a.attr("transform",function(a){return"translate(0,"+Math.ceil(b(a))+")"})}function e(a){var b=a[0],c=a[a.length-1];return c>b?[b,c]:[c,b]}function f(a){var b,c,d=[];if(a.ticks)return a.ticks.apply(a,m);for(c=a.domain(),b=Math.ceil(c[0]);b0&&d[0]>0&&d.unshift(d[0]-(d[1]-d[0])),d}function g(){var a,c=o.copy();return b.isCategory&&(a=o.domain(),c.domain([a[0],a[1]-1])),c}function h(a){var b=l?l(a):a;return"undefined"!=typeof b?b:""}function i(a){if(A)return A;var b={h:11.5,w:5.5};return a.select("text").text(h).each(function(a){var c=this.getBoundingClientRect(),d=h(a),e=c.height,f=d?c.width/d.length:void 0;e&&f&&(b.h=e,b.w=f)}).text(""),A=b,b}function j(l){l.each(function(){function l(a,c){function d(a,b){f=void 0;for(var h=1;hc)return d(a.concat(b.substr(0,f?f:h)),b.slice(f?f+1:h));return a.concat(b)}var e,f,g,i=h(a),j=[];return"[object Array]"===Object.prototype.toString.call(i)?i:((!c||0>=c)&&(c=S?95:b.isCategory?Math.ceil(A(B[1])-A(B[0]))-12:110),d(j,i+""))}function m(a,b){var c=P.h;return 0===b&&(c="left"===p||"right"===p?-((Q[a.index]-1)*(P.h/2)-3):".71em"),c}function u(a){var b=o(a)+(n?0:t);return G[0]=0&&J.select(this).style("display",b%D?"none":"block")})}else H.svg.selectAll("."+m.axisX+" .tick text").style("display","block");q=H.generateDrawArea?H.generateDrawArea(L,!1):void 0,r=H.generateDrawBar?H.generateDrawBar(M):void 0,s=H.generateDrawLine?H.generateDrawLine(N,!1):void 0,t=H.generateXYForText(L,M,N,!0),u=H.generateXYForText(L,M,N,!1),c&&(H.subY.domain(H.getYDomain(P,"y")),H.subY2.domain(H.getYDomain(P,"y2"))),H.tooltip.style("display","none"),H.updateXgridFocus(),I.select("text."+m.text+"."+m.empty).attr("x",H.width/2).attr("y",H.height/2).text(K.data_empty_label_text).transition().style("opacity",P.length?0:1),H.updateGrid(v),H.updateRegion(v),H.updateBar(w),H.updateLine(w),H.updateArea(w),H.updateCircle(),H.hasDataLabel()&&H.updateText(w),H.redrawArc&&H.redrawArc(v,w,h),H.redrawSubchart&&H.redrawSubchart(d,b,v,w,L,M,N),I.selectAll("."+m.selectedCircles).filter(H.isBarType.bind(H)).selectAll("circle").remove(),K.interaction_enabled&&!a.flow&&n&&(H.redrawEventRect(),H.updateZoom&&H.updateZoom()),H.updateCircleY(),F=(H.config.axis_rotated?H.circleY:H.circleX).bind(H),G=(H.config.axis_rotated?H.circleX:H.circleY).bind(H),a.flow&&(A=H.generateFlow({targets:P,flow:a.flow,duration:a.flow.duration,drawBar:r,drawLine:s,drawArea:q,cx:F,cy:G,xv:Q,xForText:t,yForText:u})),(v||A)&&H.isTabVisible()?J.transition().duration(v).each(function(){var b=[];[H.redrawBar(r,!0),H.redrawLine(s,!0),H.redrawArea(q,!0),H.redrawCircle(F,G,!0),H.redrawText(t,u,a.flow,!0),H.redrawRegion(!0),H.redrawGrid(!0)].forEach(function(a){a.forEach(function(a){b.push(a)})}),z=H.generateWait(),b.forEach(function(a){z.add(a)})}).call(z,function(){A&&A(),K.onrendered&&K.onrendered.call(H)}):(H.redrawBar(r),H.redrawLine(s),H.redrawArea(q),H.redrawCircle(F,G),H.redrawText(t,u,a.flow),H.redrawRegion(),H.redrawGrid(),K.onrendered&&K.onrendered.call(H)),H.mapToIds(H.data.targets).forEach(function(a){H.withoutFadeIn[a]=!0})},i.updateAndRedraw=function(a){var b,c=this,d=c.config;a=a||{},a.withTransition=x(a,"withTransition",!0),a.withTransform=x(a,"withTransform",!1),a.withLegend=x(a,"withLegend",!1),a.withUpdateXDomain=!0,a.withUpdateOrgXDomain=!0,a.withTransitionForExit=!1,a.withTransitionForTransform=x(a,"withTransitionForTransform",a.withTransition),c.updateSizes(),a.withLegend&&d.legend_show||(b=c.axis.generateTransitions(a.withTransitionForAxis?d.transition_duration:0),c.updateScales(),c.updateSvgSize(),c.transformAll(a.withTransitionForTransform,b)),c.redraw(a,b)},i.redrawWithoutRescale=function(){this.redraw({withY:!1,withSubchart:!1,withEventRect:!1,withTransitionForAxis:!1})},i.isTimeSeries=function(){return"timeseries"===this.config.axis_x_type},i.isCategorized=function(){return this.config.axis_x_type.indexOf("categor")>=0},i.isCustomX=function(){var a=this,b=a.config;return!a.isTimeSeries()&&(b.data_x||w(b.data_xs))},i.isTimeSeriesY=function(){return"timeseries"===this.config.axis_y_type},i.getTranslate=function(a){var b,c,d=this,e=d.config;return"main"===a?(b=t(d.margin.left),c=t(d.margin.top)):"context"===a?(b=t(d.margin2.left),c=t(d.margin2.top)):"legend"===a?(b=d.margin3.left,c=d.margin3.top):"x"===a?(b=0,c=e.axis_rotated?0:d.height):"y"===a?(b=0,c=e.axis_rotated?d.height:0):"y2"===a?(b=e.axis_rotated?0:d.width,c=e.axis_rotated?1:0):"subx"===a?(b=0,c=e.axis_rotated?0:d.height2):"arc"===a&&(b=d.arcWidth/2,c=d.arcHeight/2),"translate("+b+","+c+")"},i.initialOpacity=function(a){return null!==a.value&&this.withoutFadeIn[a.id]?1:0},i.initialOpacityForCircle=function(a){return null!==a.value&&this.withoutFadeIn[a.id]?this.opacityForCircle(a):0},i.opacityForCircle=function(a){var b=this.config.point_show?1:0;return n(a.value)?this.isScatterType(a)?.5:b:0},i.opacityForText=function(){return this.hasDataLabel()?1:0},i.xx=function(a){return a?this.x(a.x):null},i.xv=function(a){var b=this,c=a.value;return b.isTimeSeries()?c=b.parseDate(a.value):b.isCategorized()&&"string"==typeof a.value&&(c=b.config.axis_x_categories.indexOf(a.value)),Math.ceil(b.x(c))},i.yv=function(a){var b=this,c=a.axis&&"y2"===a.axis?b.y2:b.y;return Math.ceil(c(a.value))},i.subxx=function(a){return a?this.subX(a.x):null},i.transformMain=function(a,b){var c,d,e,f=this;b&&b.axisX?c=b.axisX:(c=f.main.select("."+m.axisX),a&&(c=c.transition())),b&&b.axisY?d=b.axisY:(d=f.main.select("."+m.axisY),a&&(d=d.transition())),b&&b.axisY2?e=b.axisY2:(e=f.main.select("."+m.axisY2),a&&(e=e.transition())),(a?f.main.transition():f.main).attr("transform",f.getTranslate("main")),c.attr("transform",f.getTranslate("x")),d.attr("transform",f.getTranslate("y")),e.attr("transform",f.getTranslate("y2")),f.main.select("."+m.chartArcs).attr("transform",f.getTranslate("arc"))},i.transformAll=function(a,b){var c=this;c.transformMain(a,b),c.config.subchart_show&&c.transformContext(a,b),c.legend&&c.transformLegend(a)},i.updateSvgSize=function(){var a=this,b=a.svg.select(".c3-brush .background");a.svg.attr("width",a.currentWidth).attr("height",a.currentHeight),a.svg.selectAll(["#"+a.clipId,"#"+a.clipIdForGrid]).select("rect").attr("width",a.width).attr("height",a.height),a.svg.select("#"+a.clipIdForXAxis).select("rect").attr("x",a.getXAxisClipX.bind(a)).attr("y",a.getXAxisClipY.bind(a)).attr("width",a.getXAxisClipWidth.bind(a)).attr("height",a.getXAxisClipHeight.bind(a)),a.svg.select("#"+a.clipIdForYAxis).select("rect").attr("x",a.getYAxisClipX.bind(a)).attr("y",a.getYAxisClipY.bind(a)).attr("width",a.getYAxisClipWidth.bind(a)).attr("height",a.getYAxisClipHeight.bind(a)),a.svg.select("#"+a.clipIdForSubchart).select("rect").attr("width",a.width).attr("height",b.size()?b.attr("height"):0),a.svg.select("."+m.zoomRect).attr("width",a.width).attr("height",a.height),a.selectChart.style("max-height",a.currentHeight+"px")},i.updateDimension=function(a){var b=this;a||(b.config.axis_rotated?(b.axes.x.call(b.xAxis),b.axes.subx.call(b.subXAxis)):(b.axes.y.call(b.yAxis),b.axes.y2.call(b.y2Axis))),b.updateSizes(),b.updateScales(),b.updateSvgSize(),b.transformAll(!1)},i.observeInserted=function(b){var c,d=this;return"undefined"==typeof MutationObserver?void a.console.error("MutationObserver not defined."):(c=new MutationObserver(function(e){e.forEach(function(e){"childList"===e.type&&e.previousSibling&&(c.disconnect(),d.intervalForObserveInserted=a.setInterval(function(){b.node().parentNode&&(a.clearInterval(d.intervalForObserveInserted),d.updateDimension(),d.config.oninit.call(d),d.redraw({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),b.transition().style("opacity",1))},10))})}),void c.observe(b.node(),{attributes:!0,childList:!0,characterData:!0}))},i.generateResize=function(){function a(){b.forEach(function(a){a()})}var b=[];return a.add=function(a){b.push(a)},a},i.endall=function(a,b){var c=0;a.each(function(){++c}).each("end",function(){--c||b.apply(this,arguments)})},i.generateWait=function(){var a=[],b=function(b,c){var d=setInterval(function(){var b=0;a.forEach(function(a){if(a.empty())return void(b+=1);try{a.transition()}catch(c){b+=1}}),b===a.length&&(clearInterval(d),c&&c())},10)};return b.add=function(b){a.push(b)},b},i.parseDate=function(b){var c,d=this;return b instanceof Date?c=b:"string"==typeof b?c=d.dataTimeFormat(d.config.data_xFormat).parse(b):"number"!=typeof b&&isNaN(b)||(c=new Date(+b)),(!c||isNaN(+c))&&a.console.error("Failed to parse x '"+b+"' to Date object"),c},i.isTabVisible=function(){var a;return"undefined"!=typeof document.hidden?a="hidden":"undefined"!=typeof document.mozHidden?a="mozHidden":"undefined"!=typeof document.msHidden?a="msHidden":"undefined"!=typeof document.webkitHidden&&(a="webkitHidden"),document[a]?!1:!0},i.getDefaultConfig=function(){var a={bindto:"#chart",size_width:void 0,size_height:void 0,padding_left:void 0,padding_right:void 0,padding_top:void 0,padding_bottom:void 0,zoom_enabled:!1,zoom_extent:void 0,zoom_privileged:!1,zoom_rescale:!1,zoom_onzoom:function(){},zoom_onzoomstart:function(){},zoom_onzoomend:function(){},interaction_enabled:!0,onmouseover:function(){},onmouseout:function(){},onresize:function(){},onresized:function(){},oninit:function(){},onrendered:function(){},transition_duration:350,data_x:void 0,data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:!0,data_xSort:!0,data_idConverter:function(a){return a},data_names:{},data_classes:{},data_groups:[],data_axes:{},data_type:void 0,data_types:{},data_labels:{},data_order:"desc",data_regions:{},data_color:void 0,data_colors:{},data_hide:!1,data_filter:void 0,data_selection_enabled:!1,data_selection_grouped:!1,data_selection_isselectable:function(){return!0},data_selection_multiple:!0,data_selection_draggable:!1,data_onclick:function(){},data_onmouseover:function(){},data_onmouseout:function(){},data_onselected:function(){},data_onunselected:function(){},data_url:void 0,data_json:void 0,data_rows:void 0,data_columns:void 0,data_mimeType:void 0,data_keys:void 0,data_empty_label_text:"",subchart_show:!1,subchart_size_height:60,subchart_onbrush:function(){},color_pattern:[],color_threshold:{},legend_show:!0,legend_hide:!1,legend_position:"bottom",legend_inset_anchor:"top-left",legend_inset_x:10,legend_inset_y:0,legend_inset_step:void 0,legend_item_onclick:void 0,legend_item_onmouseover:void 0,legend_item_onmouseout:void 0,legend_equally:!1,axis_rotated:!1,axis_x_show:!0,axis_x_type:"indexed",axis_x_localtime:!0,axis_x_categories:[],axis_x_tick_centered:!1,axis_x_tick_format:void 0,axis_x_tick_culling:{},axis_x_tick_culling_max:10,axis_x_tick_count:void 0,axis_x_tick_fit:!0,axis_x_tick_values:null,axis_x_tick_rotate:0,axis_x_tick_outer:!0,axis_x_tick_multiline:!0,axis_x_tick_width:null,axis_x_max:void 0,axis_x_min:void 0,axis_x_padding:{},axis_x_height:void 0,axis_x_extent:void 0,axis_x_label:{},axis_y_show:!0,axis_y_type:void 0,axis_y_max:void 0,axis_y_min:void 0,axis_y_inverted:!1,axis_y_center:void 0,axis_y_inner:void 0,axis_y_label:{},axis_y_tick_format:void 0,axis_y_tick_outer:!0,axis_y_tick_values:null,axis_y_tick_count:void 0,axis_y_tick_time_value:void 0,axis_y_tick_time_interval:void 0,axis_y_padding:{},axis_y_default:void 0,axis_y2_show:!1,axis_y2_max:void 0,axis_y2_min:void 0,axis_y2_inverted:!1,axis_y2_center:void 0,axis_y2_inner:void 0,axis_y2_label:{},axis_y2_tick_format:void 0,axis_y2_tick_outer:!0,axis_y2_tick_values:null,axis_y2_tick_count:void 0,axis_y2_padding:{},axis_y2_default:void 0,grid_x_show:!1,grid_x_type:"tick",grid_x_lines:[],grid_y_show:!1,grid_y_lines:[],grid_y_ticks:10,grid_focus_show:!0,grid_lines_front:!0,point_show:!0,point_r:2.5,point_focus_expand_enabled:!0,point_focus_expand_r:void 0,point_select_r:void 0,line_connectNull:!1,line_step_type:"step",bar_width:void 0,bar_width_ratio:.6,bar_width_max:void 0,bar_zerobased:!0,area_zerobased:!0,pie_label_show:!0,pie_label_format:void 0,pie_label_threshold:.05,pie_expand:!0,gauge_label_show:!0,gauge_label_format:void 0,gauge_expand:!0,gauge_min:0,gauge_max:100,gauge_units:void 0,gauge_width:void 0,donut_label_show:!0,donut_label_format:void 0,donut_label_threshold:.05,donut_width:void 0,donut_expand:!0,donut_title:"",regions:[],tooltip_show:!0,tooltip_grouped:!0,tooltip_format_title:void 0,tooltip_format_name:void 0,tooltip_format_value:void 0,tooltip_position:void 0,tooltip_contents:function(a,b,c,d){return this.getTooltipContent?this.getTooltipContent(a,b,c,d):""},tooltip_init_show:!1,tooltip_init_x:0,tooltip_init_position:{top:"0px",left:"50px"}};return Object.keys(this.additionalConfig).forEach(function(b){a[b]=this.additionalConfig[b]},this),a},i.additionalConfig={},i.loadConfig=function(a){function b(){var a=d.shift();return a&&c&&"object"==typeof c&&a in c?(c=c[a],b()):a?void 0:c}var c,d,e,f=this.config;Object.keys(f).forEach(function(g){c=a,d=g.split("_"),e=b(),r(e)&&(f[g]=e)})},i.getScale=function(a,b,c){return(c?this.d3.time.scale():this.d3.scale.linear()).range([a,b])},i.getX=function(a,b,c,d){var e,f=this,g=f.getScale(a,b,f.isTimeSeries()),h=c?g.domain(c):g;f.isCategorized()?(d=d||function(){return 0},g=function(a,b){var c=h(a)+d(a);return b?c:Math.ceil(c)}):g=function(a,b){var c=h(a);return b?c:Math.ceil(c)};for(e in h)g[e]=h[e];return g.orgDomain=function(){return h.domain()},f.isCategorized()&&(g.domain=function(a){return arguments.length?(h.domain(a),g):(a=this.orgDomain(),[a[0],a[1]+1])}),g},i.getY=function(a,b,c){var d=this.getScale(a,b,this.isTimeSeriesY());return c&&d.domain(c),d},i.getYScale=function(a){return"y2"===this.axis.getId(a)?this.y2:this.y},i.getSubYScale=function(a){return"y2"===this.axis.getId(a)?this.subY2:this.subY},i.updateScales=function(){var a=this,b=a.config,c=!a.x;a.xMin=b.axis_rotated?1:0,a.xMax=b.axis_rotated?a.height:a.width,a.yMin=b.axis_rotated?0:a.height,a.yMax=b.axis_rotated?a.width:1,a.subXMin=a.xMin,a.subXMax=a.xMax,a.subYMin=b.axis_rotated?0:a.height2,a.subYMax=b.axis_rotated?a.width2:1,a.x=a.getX(a.xMin,a.xMax,c?void 0:a.x.orgDomain(),function(){return a.xAxis.tickOffset()}),a.y=a.getY(a.yMin,a.yMax,c?b.axis_y_default:a.y.domain()),a.y2=a.getY(a.yMin,a.yMax,c?b.axis_y2_default:a.y2.domain()),a.subX=a.getX(a.xMin,a.xMax,a.orgXDomain,function(b){return b%1?0:a.subXAxis.tickOffset()}),a.subY=a.getY(a.subYMin,a.subYMax,c?b.axis_y_default:a.subY.domain()),a.subY2=a.getY(a.subYMin,a.subYMax,c?b.axis_y2_default:a.subY2.domain()),a.xAxisTickFormat=a.axis.getXAxisTickFormat(),a.xAxisTickValues=a.axis.getXAxisTickValues(),a.yAxisTickValues=a.axis.getYAxisTickValues(),a.y2AxisTickValues=a.axis.getY2AxisTickValues(),a.xAxis=a.axis.getXAxis(a.x,a.xOrient,a.xAxisTickFormat,a.xAxisTickValues,b.axis_x_tick_outer),a.subXAxis=a.axis.getXAxis(a.subX,a.subXOrient,a.xAxisTickFormat,a.xAxisTickValues,b.axis_x_tick_outer),a.yAxis=a.axis.getYAxis(a.y,a.yOrient,b.axis_y_tick_format,a.yAxisTickValues,b.axis_y_tick_outer),a.y2Axis=a.axis.getYAxis(a.y2,a.y2Orient,b.axis_y2_tick_format,a.y2AxisTickValues,b.axis_y2_tick_outer),c||(a.brush&&a.brush.scale(a.subX),b.zoom_enabled&&a.zoom.scale(a.x)),a.updateArc&&a.updateArc()},i.getYDomainMin=function(a){var b,c,d,e,f,g,h=this,i=h.config,j=h.mapToIds(a),k=h.getValuesAsIdKeyed(a);if(i.data_groups.length>0)for(g=h.hasNegativeValueInTargets(a),b=0;b=0}),0!==e.length)for(d=e[0],g&&k[d]&&k[d].forEach(function(a,b){k[d][b]=0>a?a:0}),c=1;c0||(k[d][b]+=+a)});return h.d3.min(Object.keys(k).map(function(a){return h.d3.min(k[a])}))},i.getYDomainMax=function(a){var b,c,d,e,f,g,h=this,i=h.config,j=h.mapToIds(a),k=h.getValuesAsIdKeyed(a);if(i.data_groups.length>0)for(g=h.hasPositiveValueInTargets(a),b=0;b=0}),0!==e.length)for(d=e[0],g&&k[d]&&k[d].forEach(function(a,b){k[d][b]=a>0?a:0}),c=1;c+a||(k[d][b]+=+a)});return h.d3.max(Object.keys(k).map(function(a){return h.d3.max(k[a])}))},i.getYDomain=function(a,b,c){var d,e,f,g,h,i,j,k,l,m,o,p=this,q=p.config,r=a.filter(function(a){return p.axis.getId(a.id)===b}),s=c?p.filterByXDomain(r,c):r,t="y2"===b?q.axis_y2_min:q.axis_y_min,v="y2"===b?q.axis_y2_max:q.axis_y_max,x=p.getYDomainMin(s),y=p.getYDomainMax(s),z="y2"===b?q.axis_y2_center:q.axis_y_center,A=p.hasType("bar",s)&&q.bar_zerobased||p.hasType("area",s)&&q.area_zerobased,B="y2"===b?q.axis_y2_inverted:q.axis_y_inverted,C=p.hasDataLabel()&&q.axis_rotated,D=p.hasDataLabel()&&!q.axis_rotated;return x=n(t)?t:n(v)?v>x?x:v-10:x,y=n(v)?v:n(t)?y>t?y:t+10:y,0===s.length?"y2"===b?p.y2.domain():p.y.domain():(isNaN(x)&&(x=0),isNaN(y)&&(y=x),x===y&&(0>x?y=0:x=0),m=x>=0&&y>=0,o=0>=x&&0>=y,(n(t)&&m||n(v)&&o)&&(A=!1),A&&(m&&(x=0),o&&(y=0)),e=Math.abs(y-x),f=g=h=.1*e,"undefined"!=typeof z&&(i=Math.max(Math.abs(x),Math.abs(y)),y=z+i,x=z-i),C?(j=p.getDataLabelLength(x,y,"width"),k=u(p.y.range()),l=[j[0]/k,j[1]/k],g+=e*(l[1]/(1-l[0]-l[1])),h+=e*(l[0]/(1-l[0]-l[1]))):D&&(j=p.getDataLabelLength(x,y,"height"),g+=p.axis.convertPixelsToAxisPadding(j[1],e),h+=p.axis.convertPixelsToAxisPadding(j[0],e)),"y"===b&&w(q.axis_y_padding)&&(g=p.axis.getPadding(q.axis_y_padding,"top",g,e),h=p.axis.getPadding(q.axis_y_padding,"bottom",h,e)),"y2"===b&&w(q.axis_y2_padding)&&(g=p.axis.getPadding(q.axis_y2_padding,"top",g,e),h=p.axis.getPadding(q.axis_y2_padding,"bottom",h,e)),A&&(m&&(h=x),o&&(g=-y)),d=[x-h,y+g],B?d.reverse():d)},i.getXDomainMin=function(a){var b=this,c=b.config;return r(c.axis_x_min)?b.isTimeSeries()?this.parseDate(c.axis_x_min):c.axis_x_min:b.d3.min(a,function(a){return b.d3.min(a.values,function(a){return a.x})})},i.getXDomainMax=function(a){var b=this,c=b.config;return r(c.axis_x_max)?b.isTimeSeries()?this.parseDate(c.axis_x_max):c.axis_x_max:b.d3.max(a,function(a){return b.d3.max(a.values,function(a){return a.x})})},i.getXDomainPadding=function(a){var b,c,d,e,f=this,g=f.config,h=a[1]-a[0];return f.isCategorized()?c=0:f.hasType("bar")?(b=f.getMaxDataCount(),c=b>1?h/(b-1)/2:.5):c=.01*h,"object"==typeof g.axis_x_padding&&w(g.axis_x_padding)?(d=n(g.axis_x_padding.left)?g.axis_x_padding.left:c,e=n(g.axis_x_padding.right)?g.axis_x_padding.right:c):d=e="number"==typeof g.axis_x_padding?g.axis_x_padding:c,{left:d,right:e}},i.getXDomain=function(a){var b=this,c=[b.getXDomainMin(a),b.getXDomainMax(a)],d=c[0],e=c[1],f=b.getXDomainPadding(c),g=0,h=0;return d-e!==0||b.isCategorized()||(b.isTimeSeries()?(d=new Date(.5*d.getTime()),e=new Date(1.5*e.getTime())):(d=0===d?1:.5*d,e=0===e?-1:1.5*e)),(d||0===d)&&(g=b.isTimeSeries()?new Date(d.getTime()-f.left):d-f.left),(e||0===e)&&(h=b.isTimeSeries()?new Date(e.getTime()+f.right):e+f.right),[g,h]
-},i.updateXDomain=function(a,b,c,d,e){var f=this,g=f.config;return c&&(f.x.domain(e?e:f.d3.extent(f.getXDomain(a))),f.orgXDomain=f.x.domain(),g.zoom_enabled&&f.zoom.scale(f.x).updateScaleExtent(),f.subX.domain(f.x.domain()),f.brush&&f.brush.scale(f.subX)),b&&(f.x.domain(e?e:!f.brush||f.brush.empty()?f.orgXDomain:f.brush.extent()),g.zoom_enabled&&f.zoom.scale(f.x).updateScaleExtent()),d&&f.x.domain(f.trimXDomain(f.x.orgDomain())),f.x.domain()},i.trimXDomain=function(a){var b=this;return a[0]<=b.orgXDomain[0]&&(a[1]=+a[1]+(b.orgXDomain[0]-a[0]),a[0]=b.orgXDomain[0]),b.orgXDomain[1]<=a[1]&&(a[0]=+a[0]-(a[1]-b.orgXDomain[1]),a[1]=b.orgXDomain[1]),a},i.isX=function(a){var b=this,c=b.config;return c.data_x&&a===c.data_x||w(c.data_xs)&&y(c.data_xs,a)},i.isNotX=function(a){return!this.isX(a)},i.getXKey=function(a){var b=this,c=b.config;return c.data_x?c.data_x:w(c.data_xs)?c.data_xs[a]:null},i.getXValuesOfXKey=function(a,b){var c,d=this,e=b&&w(b)?d.mapToIds(b):[];return e.forEach(function(b){d.getXKey(b)===a&&(c=d.data.xs[b])}),c},i.getIndexByX=function(a){var b=this,c=b.filterByX(b.data.targets,a);return c.length?c[0].index:null},i.getXValue=function(a,b){var c=this;return a in c.data.xs&&c.data.xs[a]&&n(c.data.xs[a][b])?c.data.xs[a][b]:b},i.getOtherTargetXs=function(){var a=this,b=Object.keys(a.data.xs);return b.length?a.data.xs[b[0]]:null},i.getOtherTargetX=function(a){var b=this.getOtherTargetXs();return b&&a1},i.isMultipleX=function(){return w(this.config.data_xs)||!this.config.data_xSort||this.hasType("scatter")},i.addName=function(a){var b,c=this;return a&&(b=c.config.data_names[a.id],a.name=b?b:a.id),a},i.getValueOnIndex=function(a,b){var c=a.filter(function(a){return a.index===b});return c.length?c[0]:null},i.updateTargetX=function(a,b){var c=this;a.forEach(function(a){a.values.forEach(function(d,e){d.x=c.generateTargetX(b[e],a.id,e)}),c.data.xs[a.id]=b})},i.updateTargetXs=function(a,b){var c=this;a.forEach(function(a){b[a.id]&&c.updateTargetX([a],b[a.id])})},i.generateTargetX=function(a,b,c){var d,e=this;return d=e.isTimeSeries()?e.parseDate(a?a:e.getXValue(b,c)):e.isCustomX()&&!e.isCategorized()?n(a)?+a:e.getXValue(b,c):c},i.cloneTarget=function(a){return{id:a.id,id_org:a.id_org,values:a.values.map(function(a){return{x:a.x,value:a.value,id:a.id}})}},i.updateXs=function(){var a=this;a.data.targets.length&&(a.xs=[],a.data.targets[0].values.forEach(function(b){a.xs[b.index]=b.x}))},i.getPrevX=function(a){var b=this.xs[a-1];return"undefined"!=typeof b?b:null},i.getNextX=function(a){var b=this.xs[a+1];return"undefined"!=typeof b?b:null},i.getMaxDataCount=function(){var a=this;return a.d3.max(a.data.targets,function(a){return a.values.length})},i.getMaxDataCountTarget=function(a){var b,c=a.length,d=0;return c>1?a.forEach(function(a){a.values.length>d&&(b=a,d=a.values.length)}):b=c?a[0]:null,b},i.getEdgeX=function(a){var b=this;return a.length?[b.d3.min(a,function(a){return a.values[0].x}),b.d3.max(a,function(a){return a.values[a.values.length-1].x})]:[0,0]},i.mapToIds=function(a){return a.map(function(a){return a.id})},i.mapToTargetIds=function(a){var b=this;return a?p(a)?[a]:a:b.mapToIds(b.data.targets)},i.hasTarget=function(a,b){var c,d=this.mapToIds(a);for(c=0;ca})},i.hasPositiveValueInTargets=function(a){return this.checkValueInTargets(a,function(a){return a>0})},i.isOrderDesc=function(){var a=this.config;return"string"==typeof a.data_order&&"desc"===a.data_order.toLowerCase()},i.isOrderAsc=function(){var a=this.config;return"string"==typeof a.data_order&&"asc"===a.data_order.toLowerCase()},i.orderTargets=function(a){var b=this,c=b.config,d=b.isOrderAsc(),e=b.isOrderDesc();return d||e?a.sort(function(a,b){var c=function(a,b){return a+Math.abs(b.value)},e=a.values.reduce(c,0),f=b.values.reduce(c,0);return d?f-e:e-f}):o(c.data_order)&&a.sort(c.data_order),a},i.filterByX=function(a,b){return this.d3.merge(a.map(function(a){return a.values})).filter(function(a){return a.x-b===0})},i.filterRemoveNull=function(a){return a.filter(function(a){return n(a.value)})},i.filterByXDomain=function(a,b){return a.map(function(a){return{id:a.id,id_org:a.id_org,values:a.values.filter(function(a){return b[0]<=a.x&&a.x<=b[1]})}})},i.hasDataLabel=function(){var a=this.config;return"boolean"==typeof a.data_labels&&a.data_labels?!0:"object"==typeof a.data_labels&&w(a.data_labels)?!0:!1},i.getDataLabelLength=function(a,b,c){var d=this,e=[0,0],f=1.3;return d.selectChart.select("svg").selectAll(".dummy").data([a,b]).enter().append("text").text(function(a){return d.dataLabelFormat(a.id)(a)}).each(function(a,b){e[b]=this.getBoundingClientRect()[c]*f}).remove(),e},i.isNoneArc=function(a){return this.hasTarget(this.data.targets,a.id)},i.isArc=function(a){return"data"in a&&this.hasTarget(this.data.targets,a.data.id)},i.findSameXOfValues=function(a,b){var c,d=a[b].x,e=[];for(c=b-1;c>=0&&d===a[c].x;c--)e.push(a[c]);for(c=b;cf&&(e=f,c=a)}),c},i.dist=function(a,b){var c=this,d=c.config,e=d.axis_rotated?1:0,f=d.axis_rotated?0:1,g=c.circleY(a,a.index),h=c.x(a.x);return Math.pow(h-b[e],2)+Math.pow(g-b[f],2)},i.convertValuesToStep=function(a){var b,c=[].concat(a);if(!this.isCategorized())return a;for(b=a.length+1;b>0;b--)c[b]=c[b-1];return c[0]={x:c[0].x-1,value:c[0].value,id:c[0].id},c[a.length+1]={x:c[a.length].x+1,value:c[a.length].value,id:c[a.length].id},c},i.updateDataAttributes=function(a,b){var c=this,d=c.config,e=d["data_"+a];return"undefined"==typeof b?e:(Object.keys(b).forEach(function(a){e[a]=b[a]}),c.redraw({withLegend:!0}),e)},i.convertUrlToData=function(a,b,c,d){var e=this,f=b?b:"csv";e.d3.xhr(a,function(a,b){var g;if(!b)throw new Error(a.responseURL+" "+a.status+" ("+a.statusText+")");g="json"===f?e.convertJsonToData(JSON.parse(b.response),c):"tsv"===f?e.convertTsvToData(b.response):e.convertCsvToData(b.response),d.call(e,g)})},i.convertXsvToData=function(a,b){var c,d=b.parseRows(a);return 1===d.length?(c=[{}],d[0].forEach(function(a){c[0][a]=null})):c=b.parse(a),c},i.convertCsvToData=function(a){return this.convertXsvToData(a,this.d3.csv)},i.convertTsvToData=function(a){return this.convertXsvToData(a,this.d3.tsv)},i.convertJsonToData=function(a,b){var c,d,e=this,f=[];return b?(c=b.value,b.x&&(c.push(b.x),e.config.data_x=b.x),f.push(c),a.forEach(function(a){var b=[];c.forEach(function(c){var d=q(a[c])?null:a[c];b.push(d)}),f.push(b)}),d=e.convertRowsToData(f)):(Object.keys(a).forEach(function(b){f.push([b].concat(a[b]))}),d=e.convertColumnsToData(f)),d},i.convertRowsToData=function(a){var b,c,d=a[0],e={},f=[];for(b=1;b=0?d.data.xs[c]=(b&&d.data.xs[c]?d.data.xs[c]:[]).concat(a.map(function(a){return a[f]}).filter(n).map(function(a,b){return d.generateTargetX(a,c,b)})):e.data_x?d.data.xs[c]=d.getOtherTargetXs():w(e.data_xs)&&(d.data.xs[c]=d.getXValuesOfXKey(f,d.data.targets)):d.data.xs[c]=a.map(function(a,b){return b})}),f.forEach(function(a){if(!d.data.xs[a])throw new Error('x is not defined for id = "'+a+'".')}),c=f.map(function(b,c){var f=e.data_idConverter(b);return{id:f,id_org:b,values:a.map(function(a,g){var h=d.getXKey(b),i=a[h],j=d.generateTargetX(i,b,g);return d.isCustomX()&&d.isCategorized()&&0===c&&i&&(0===g&&(e.axis_x_categories=[]),e.axis_x_categories.push(i)),(q(a[b])||d.data.xs[b].length<=g)&&(j=void 0),{x:j,value:null===a[b]||isNaN(a[b])?null:+a[b],id:f}}).filter(function(a){return r(a.x)})}}),c.forEach(function(a){var b;e.data_xSort&&(a.values=a.values.sort(function(a,b){var c=a.x||0===a.x?a.x:1/0,d=b.x||0===b.x?b.x:1/0;return c-d})),b=0,a.values.forEach(function(a){a.index=b++}),d.data.xs[a.id].sort(function(a,b){return a-b})}),e.data_type&&d.setTargetType(d.mapToIds(c).filter(function(a){return!(a in e.data_types)}),e.data_type),c.forEach(function(a){d.addCache(a.id_org,a)}),c},i.load=function(a,b){var c=this;a&&(b.filter&&(a=a.filter(b.filter)),(b.type||b.types)&&a.forEach(function(a){c.setTargetType(a.id,b.types?b.types[a.id]:b.type)}),c.data.targets.forEach(function(b){for(var c=0;c0?c:320/(a.hasType("gauge")?2:1)},i.getCurrentPaddingTop=function(){var a=this.config;return n(a.padding_top)?a.padding_top:0},i.getCurrentPaddingBottom=function(){var a=this.config;return n(a.padding_bottom)?a.padding_bottom:0},i.getCurrentPaddingLeft=function(a){var b=this,c=b.config;return n(c.padding_left)?c.padding_left:c.axis_rotated?c.axis_x_show?Math.max(s(b.getAxisWidthByAxisId("x",a)),40):1:!c.axis_y_show||c.axis_y_inner?b.axis.getYAxisLabelPosition().isOuter?30:1:s(b.getAxisWidthByAxisId("y",a))},i.getCurrentPaddingRight=function(){var a=this,b=a.config,c=10,d=a.isLegendRight?a.getLegendWidth()+20:0;return n(b.padding_right)?b.padding_right+1:b.axis_rotated?c+d:!b.axis_y2_show||b.axis_y2_inner?2+d+(a.axis.getY2AxisLabelPosition().isOuter?20:0):s(a.getAxisWidthByAxisId("y2"))+d},i.getParentRectValue=function(a){for(var b,c=this.selectChart.node();c&&"BODY"!==c.tagName&&!(b=c.getBoundingClientRect()[a]);)c=c.parentNode;return b},i.getParentWidth=function(){return this.getParentRectValue("width")},i.getParentHeight=function(){var a=this.selectChart.style("height");return a.indexOf("px")>0?+a.replace("px",""):0},i.getSvgLeft=function(a){var b=this,c=b.config,d=c.axis_rotated||!c.axis_rotated&&!c.axis_y_inner,e=c.axis_rotated?m.axisX:m.axisY,f=b.main.select("."+e).node(),g=f&&d?f.getBoundingClientRect():{right:0},h=b.selectChart.node().getBoundingClientRect(),i=b.hasArcType(),j=g.right-h.left-(i?0:b.getCurrentPaddingLeft(a));return j>0?j:0},i.getAxisWidthByAxisId=function(a,b){var c=this,d=c.axis.getLabelPositionById(a);return c.axis.getMaxTickWidth(a,b)+(d.isInner?20:40)},i.getHorizontalAxisHeight=function(a){var b=this,c=b.config,d=30;return"x"!==a||c.axis_x_show?"x"===a&&c.axis_x_height?c.axis_x_height:"y"!==a||c.axis_y_show?"y2"!==a||c.axis_y2_show?("x"===a&&!c.axis_rotated&&c.axis_x_tick_rotate&&(d=b.axis.getMaxTickWidth(a)*Math.cos(Math.PI*(90-c.axis_x_tick_rotate)/180)),d+(b.axis.getLabelPositionById(a).isInner?0:10)+("y2"===a?-10:0)):b.rotated_padding_top:!c.legend_show||b.isLegendRight||b.isLegendInset?1:10:8},i.getEventRectWidth=function(){return this.xAxis.tickInterval()},i.getShapeIndices=function(a){var b,c,d=this,e=d.config,f={},g=0;return d.filterTargetsToShow(d.data.targets.filter(a,d)).forEach(function(a){for(b=0;b=0&&(j+=h(e[g].value)-i)}),j}},i.isWithinShape=function(a,b){var c,d=this,e=d.d3.select(a);return d.isTargetToShow(b.id)?"circle"===a.nodeName?c=d.isStepType(b)?d.isWithinStep(a,d.getYScale(b.id)(b.value)):d.isWithinCircle(a,1.5*d.pointSelectR(b)):"path"===a.nodeName&&(c=e.classed(m.bar)?d.isWithinBar(a):!0):c=!1,c},i.getInterpolate=function(a){var b=this;return b.isSplineType(a)?"cardinal":b.isStepType(a)?b.config.line_step_type:"linear"},i.initLine=function(){var a=this;a.main.select("."+m.chart).append("g").attr("class",m.chartLines)},i.updateTargetsForLine=function(a){var b,c,d=this,e=d.config,f=d.classChartLine.bind(d),g=d.classLines.bind(d),h=d.classAreas.bind(d),i=d.classCircles.bind(d),j=d.classFocus.bind(d);b=d.main.select("."+m.chartLines).selectAll("."+m.chartLine).data(a).attr("class",function(a){return f(a)+j(a)}),c=b.enter().append("g").attr("class",f).style("opacity",0).style("pointer-events","none"),c.append("g").attr("class",g),c.append("g").attr("class",h),c.append("g").attr("class",function(a){return d.generateClass(m.selectedCircles,a.id)}),c.append("g").attr("class",i).style("cursor",function(a){return e.data_selection_isselectable(a)?"pointer":null}),a.forEach(function(a){d.main.selectAll("."+m.selectedCircles+d.getTargetSelectorSuffix(a.id)).selectAll("."+m.selectedCircle).each(function(b){b.value=a.values[b.index].value})})},i.updateLine=function(a){var b=this;b.mainLine=b.main.selectAll("."+m.lines).selectAll("."+m.line).data(b.lineData.bind(b)),b.mainLine.enter().append("path").attr("class",b.classLine.bind(b)).style("stroke",b.color),b.mainLine.style("opacity",b.initialOpacity.bind(b)).style("shape-rendering",function(a){return b.isStepType(a)?"crispEdges":""}).attr("transform",null),b.mainLine.exit().transition().duration(a).style("opacity",0).remove()},i.redrawLine=function(a,b){return[(b?this.mainLine.transition():this.mainLine).attr("d",a).style("stroke",this.color).style("opacity",1)]},i.generateDrawLine=function(a,b){var c=this,d=c.config,e=c.d3.svg.line(),f=c.generateGetLinePoints(a,b),g=b?c.getSubYScale:c.getYScale,h=function(a){return(b?c.subxx:c.xx).call(c,a)},i=function(a,b){return d.data_groups.length>0?f(a,b)[0][1]:g.call(c,a.id)(a.value)};return e=d.axis_rotated?e.x(i).y(h):e.x(h).y(i),d.line_connectNull||(e=e.defined(function(a){return null!=a.value})),function(a){var f,h=d.line_connectNull?c.filterRemoveNull(a.values):a.values,i=b?c.x:c.subX,j=g.call(c,a.id),k=0,l=0;return c.isLineType(a)?d.data_regions[a.id]?f=c.lineWithRegions(h,i,j,d.data_regions[a.id]):(c.isStepType(a)&&(h=c.convertValuesToStep(h)),f=e.interpolate(c.getInterpolate(a))(h)):(h[0]&&(k=i(h[0].x),l=j(h[0].value)),f=d.axis_rotated?"M "+l+" "+k:"M "+k+" "+l),f?f:"M 0 0"}},i.generateGetLinePoints=function(a,b){var c=this,d=c.config,e=a.__max__+1,f=c.getShapeX(0,e,a,!!b),g=c.getShapeY(!!b),h=c.getShapeOffset(c.isLineType,a,!!b),i=b?c.getSubYScale:c.getYScale;return function(a,b){var e=i.call(c,a.id)(0),j=h(a,b)||e,k=f(a),l=g(a);return d.axis_rotated&&(0l||a.value<0&&l>e)&&(l=e),[[k,l-(e-j)],[k,l-(e-j)],[k,l-(e-j)],[k,l-(e-j)]]}},i.lineWithRegions=function(a,b,c,d){function e(a,b){var c;for(c=0;c=g;g+=o)w+=h(a[f-1],a[f],g,n);v=a[f].x}return w},i.updateArea=function(a){var b=this,c=b.d3;b.mainArea=b.main.selectAll("."+m.areas).selectAll("."+m.area).data(b.lineData.bind(b)),b.mainArea.enter().append("path").attr("class",b.classArea.bind(b)).style("fill",b.color).style("opacity",function(){return b.orgAreaOpacity=+c.select(this).style("opacity"),0}),b.mainArea.style("opacity",b.orgAreaOpacity),b.mainArea.exit().transition().duration(a).style("opacity",0).remove()},i.redrawArea=function(a,b){return[(b?this.mainArea.transition():this.mainArea).attr("d",a).style("fill",this.color).style("opacity",this.orgAreaOpacity)]},i.generateDrawArea=function(a,b){var c=this,d=c.config,e=c.d3.svg.area(),f=c.generateGetAreaPoints(a,b),g=b?c.getSubYScale:c.getYScale,h=function(a){return(b?c.subxx:c.xx).call(c,a)},i=function(a,b){return d.data_groups.length>0?f(a,b)[0][1]:g.call(c,a.id)(c.getAreaBaseValue(a.id))},j=function(a,b){return d.data_groups.length>0?f(a,b)[1][1]:g.call(c,a.id)(a.value)};return e=d.axis_rotated?e.x0(i).x1(j).y(h):e.x(h).y0(i).y1(j),d.line_connectNull||(e=e.defined(function(a){return null!==a.value})),function(a){var b,f=d.line_connectNull?c.filterRemoveNull(a.values):a.values,g=0,h=0;return c.isAreaType(a)?(c.isStepType(a)&&(f=c.convertValuesToStep(f)),b=e.interpolate(c.getInterpolate(a))(f)):(f[0]&&(g=c.x(f[0].x),h=c.getYScale(a.id)(f[0].value)),b=d.axis_rotated?"M "+h+" "+g:"M "+g+" "+h),b?b:"M 0 0"}},i.getAreaBaseValue=function(){return 0},i.generateGetAreaPoints=function(a,b){var c=this,d=c.config,e=a.__max__+1,f=c.getShapeX(0,e,a,!!b),g=c.getShapeY(!!b),h=c.getShapeOffset(c.isAreaType,a,!!b),i=b?c.getSubYScale:c.getYScale;return function(a,b){var e=i.call(c,a.id)(0),j=h(a,b)||e,k=f(a),l=g(a);return d.axis_rotated&&(0l||a.value<0&&l>e)&&(l=e),[[k,j],[k,l-(e-j)],[k,l-(e-j)],[k,j]]}},i.updateCircle=function(){var a=this;a.mainCircle=a.main.selectAll("."+m.circles).selectAll("."+m.circle).data(a.lineOrScatterData.bind(a)),a.mainCircle.enter().append("circle").attr("class",a.classCircle.bind(a)).attr("r",a.pointR.bind(a)).style("fill",a.color),a.mainCircle.style("opacity",a.initialOpacityForCircle.bind(a)),a.mainCircle.exit().remove()},i.redrawCircle=function(a,b,c){var d=this.main.selectAll("."+m.selectedCircle);return[(c?this.mainCircle.transition():this.mainCircle).style("opacity",this.opacityForCircle.bind(this)).style("fill",this.color).attr("cx",a).attr("cy",b),(c?d.transition():d).attr("cx",a).attr("cy",b)]},i.circleX=function(a){return a.x||0===a.x?this.x(a.x):null},i.updateCircleY=function(){var a,b,c=this;c.config.data_groups.length>0?(a=c.getShapeIndices(c.isLineType),b=c.generateGetLinePoints(a),c.circleY=function(a,c){return b(a,c)[0][1]}):c.circleY=function(a){return c.getYScale(a.id)(a.value)}},i.getCircles=function(a,b){var c=this;return(b?c.main.selectAll("."+m.circles+c.getTargetSelectorSuffix(b)):c.main).selectAll("."+m.circle+(n(a)?"-"+a:""))},i.expandCircles=function(a,b,c){var d=this,e=d.pointExpandedR.bind(d);c&&d.unexpandCircles(),d.getCircles(a,b).classed(m.EXPANDED,!0).attr("r",e)},i.unexpandCircles=function(a){var b=this,c=b.pointR.bind(b);b.getCircles(a).filter(function(){return b.d3.select(this).classed(m.EXPANDED)}).classed(m.EXPANDED,!1).attr("r",c)},i.pointR=function(a){var b=this,c=b.config;return b.isStepType(a)?0:o(c.point_r)?c.point_r(a):c.point_r},i.pointExpandedR=function(a){var b=this,c=b.config;return c.point_focus_expand_enabled?c.point_focus_expand_r?c.point_focus_expand_r:1.75*b.pointR(a):b.pointR(a)},i.pointSelectR=function(a){var b=this,c=b.config;return c.point_select_r?c.point_select_r:4*b.pointR(a)},i.isWithinCircle=function(a,b){var c=this.d3,d=c.mouse(a),e=c.select(a),f=+e.attr("cx"),g=+e.attr("cy");return Math.sqrt(Math.pow(f-d[0],2)+Math.pow(g-d[1],2))d.bar_width_max?d.bar_width_max:e},i.getBars=function(a,b){var c=this;return(b?c.main.selectAll("."+m.bars+c.getTargetSelectorSuffix(b)):c.main).selectAll("."+m.bar+(n(a)?"-"+a:""))},i.expandBars=function(a,b,c){var d=this;c&&d.unexpandBars(),d.getBars(a,b).classed(m.EXPANDED,!0)},i.unexpandBars=function(a){var b=this;b.getBars(a).classed(m.EXPANDED,!1)},i.generateDrawBar=function(a,b){var c=this,d=c.config,e=c.generateGetBarPoints(a,b);return function(a,b){var c=e(a,b),f=d.axis_rotated?1:0,g=d.axis_rotated?0:1,h="M "+c[0][f]+","+c[0][g]+" L"+c[1][f]+","+c[1][g]+" L"+c[2][f]+","+c[2][g]+" L"+c[3][f]+","+c[3][g]+" z";return h}},i.generateGetBarPoints=function(a,b){var c=this,d=b?c.subXAxis:c.xAxis,e=a.__max__+1,f=c.getBarW(d,e),g=c.getShapeX(f,e,a,!!b),h=c.getShapeY(!!b),i=c.getShapeOffset(c.isBarType,a,!!b),j=b?c.getSubYScale:c.getYScale;return function(a,b){var d=j.call(c,a.id)(0),e=i(a,b)||d,k=g(a),l=h(a);return c.config.axis_rotated&&(0l||a.value<0&&l>d)&&(l=d),[[k,e],[k,l-(d-e)],[k+f,l-(d-e)],[k+f,e]]}},i.isWithinBar=function(a){var b=this.d3.mouse(a),c=a.getBoundingClientRect(),d=a.pathSegList.getItem(0),e=a.pathSegList.getItem(1),f=Math.min(d.x,e.x),g=Math.min(d.y,e.y),h=c.width,i=c.height,j=2,k=f-j,l=f+h+j,m=g+i+j,n=g-j;return kf.width?d=f.width-g.width:0>d&&(d=4)),d},i.getYForText=function(a,b,c){var d,e=this,f=c.getBoundingClientRect();return d=e.config.axis_rotated?(a[0][0]+a[2][0]+.6*f.height)/2:a[2][1]+(b.value<0?1.3*f.height:e.isBarType(b)?-3:-6),null!==b.value||e.config.axis_rotated||(dthis.height&&(d=this.height-4)),d},i.setTargetType=function(a,b){var c=this,d=c.config;c.mapToTargetIds(a).forEach(function(a){c.withoutFadeIn[a]=b===d.data_types[a],d.data_types[a]=b}),a||(d.data_type=b)},i.hasType=function(a,b){var c=this,d=c.config.data_types,e=!1;return b=b||c.data.targets,b&&b.length?b.forEach(function(b){var c=d[b.id];(c&&c.indexOf(a)>=0||!c&&"line"===a)&&(e=!0)}):Object.keys(d).length?Object.keys(d).forEach(function(b){d[b]===a&&(e=!0)}):e=c.config.data_type===a,e},i.hasArcType=function(a){return this.hasType("pie",a)||this.hasType("donut",a)||this.hasType("gauge",a)},i.isLineType=function(a){var b=this.config,c=p(a)?a:a.id;return!b.data_types[c]||["line","spline","area","area-spline","step","area-step"].indexOf(b.data_types[c])>=0},i.isStepType=function(a){var b=p(a)?a:a.id;return["step","area-step"].indexOf(this.config.data_types[b])>=0},i.isSplineType=function(a){var b=p(a)?a:a.id;return["spline","area-spline"].indexOf(this.config.data_types[b])>=0},i.isAreaType=function(a){var b=p(a)?a:a.id;return["area","area-spline","area-step"].indexOf(this.config.data_types[b])>=0},i.isBarType=function(a){var b=p(a)?a:a.id;return"bar"===this.config.data_types[b]},i.isScatterType=function(a){var b=p(a)?a:a.id;return"scatter"===this.config.data_types[b]},i.isPieType=function(a){var b=p(a)?a:a.id;return"pie"===this.config.data_types[b]},i.isGaugeType=function(a){var b=p(a)?a:a.id;return"gauge"===this.config.data_types[b]},i.isDonutType=function(a){var b=p(a)?a:a.id;return"donut"===this.config.data_types[b]},i.isArcType=function(a){return this.isPieType(a)||this.isDonutType(a)||this.isGaugeType(a)},i.lineData=function(a){return this.isLineType(a)?[a]:[]},i.arcData=function(a){return this.isArcType(a.data)?[a]:[]},i.barData=function(a){return this.isBarType(a)?a.values:[]},i.lineOrScatterData=function(a){return this.isLineType(a)||this.isScatterType(a)?a.values:[]},i.barOrLineData=function(a){return this.isBarType(a)||this.isLineType(a)?a.values:[]},i.initGrid=function(){var a=this,b=a.config,c=a.d3;a.grid=a.main.append("g").attr("clip-path",a.clipPathForGrid).attr("class",m.grid),b.grid_x_show&&a.grid.append("g").attr("class",m.xgrids),b.grid_y_show&&a.grid.append("g").attr("class",m.ygrids),b.grid_focus_show&&a.grid.append("g").attr("class",m.xgridFocus).append("line").attr("class",m.xgridFocus),a.xgrid=c.selectAll([]),b.grid_lines_front||a.initGridLines()},i.initGridLines=function(){var a=this,b=a.d3;a.gridLines=a.main.append("g").attr("clip-path",a.clipPathForGrid).attr("class",m.grid+" "+m.gridLines),a.gridLines.append("g").attr("class",m.xgridLines),a.gridLines.append("g").attr("class",m.ygridLines),a.xgridLines=b.selectAll([])},i.updateXGrid=function(a){var b=this,c=b.config,d=b.d3,e=b.generateGridData(c.grid_x_type,b.x),f=b.isCategorized()?b.xAxis.tickOffset():0;b.xgridAttr=c.axis_rotated?{x1:0,x2:b.width,y1:function(a){return b.x(a)-f},y2:function(a){return b.x(a)-f}}:{x1:function(a){return b.x(a)+f},x2:function(a){return b.x(a)+f},y1:0,y2:b.height},b.xgrid=b.main.select("."+m.xgrids).selectAll("."+m.xgrid).data(e),b.xgrid.enter().append("line").attr("class",m.xgrid),a||b.xgrid.attr(b.xgridAttr).style("opacity",function(){return+d.select(this).attr(c.axis_rotated?"y1":"x1")===(c.axis_rotated?b.height:0)?0:1}),b.xgrid.exit().remove()},i.updateYGrid=function(){var a=this,b=a.config,c=a.yAxis.tickValues()||a.y.ticks(b.grid_y_ticks);a.ygrid=a.main.select("."+m.ygrids).selectAll("."+m.ygrid).data(c),a.ygrid.enter().append("line").attr("class",m.ygrid),a.ygrid.attr("x1",b.axis_rotated?a.y:0).attr("x2",b.axis_rotated?a.y:a.width).attr("y1",b.axis_rotated?0:a.y).attr("y2",b.axis_rotated?a.height:a.y),a.ygrid.exit().remove(),a.smoothLines(a.ygrid,"grid")},i.gridTextAnchor=function(a){return a.position?a.position:"end"},i.gridTextDx=function(a){return"start"===a.position?4:"middle"===a.position?0:-4},i.xGridTextX=function(a){return"start"===a.position?-this.height:"middle"===a.position?-this.height/2:0},i.yGridTextX=function(a){return"start"===a.position?0:"middle"===a.position?this.width/2:this.width},i.updateGrid=function(a){var b,c,d,e=this,f=e.main,g=e.config;e.grid.style("visibility",e.hasArcType()?"hidden":"visible"),f.select("line."+m.xgridFocus).style("visibility","hidden"),g.grid_x_show&&e.updateXGrid(),e.xgridLines=f.select("."+m.xgridLines).selectAll("."+m.xgridLine).data(g.grid_x_lines),b=e.xgridLines.enter().append("g").attr("class",function(a){return m.xgridLine+(a["class"]?" "+a["class"]:"")}),b.append("line").style("opacity",0),b.append("text").attr("text-anchor",e.gridTextAnchor).attr("transform",g.axis_rotated?"":"rotate(-90)").attr("dx",e.gridTextDx).attr("dy",-5).style("opacity",0),e.xgridLines.exit().transition().duration(a).style("opacity",0).remove(),g.grid_y_show&&e.updateYGrid(),e.ygridLines=f.select("."+m.ygridLines).selectAll("."+m.ygridLine).data(g.grid_y_lines),c=e.ygridLines.enter().append("g").attr("class",function(a){return m.ygridLine+(a["class"]?" "+a["class"]:"")}),c.append("line").style("opacity",0),c.append("text").attr("text-anchor",e.gridTextAnchor).attr("transform",g.axis_rotated?"rotate(-90)":"").attr("dx",e.gridTextDx).attr("dy",-5).style("opacity",0),d=e.yv.bind(e),e.ygridLines.select("line").transition().duration(a).attr("x1",g.axis_rotated?d:0).attr("x2",g.axis_rotated?d:e.width).attr("y1",g.axis_rotated?0:d).attr("y2",g.axis_rotated?e.height:d).style("opacity",1),e.ygridLines.select("text").transition().duration(a).attr("x",g.axis_rotated?e.xGridTextX.bind(e):e.yGridTextX.bind(e)).attr("y",d).text(function(a){return a.text}).style("opacity",1),e.ygridLines.exit().transition().duration(a).style("opacity",0).remove()},i.redrawGrid=function(a){var b=this,c=b.config,d=b.xv.bind(b),e=b.xgridLines.select("line"),f=b.xgridLines.select("text");return[(a?e.transition():e).attr("x1",c.axis_rotated?0:d).attr("x2",c.axis_rotated?b.width:d).attr("y1",c.axis_rotated?d:0).attr("y2",c.axis_rotated?d:b.height).style("opacity",1),(a?f.transition():f).attr("x",c.axis_rotated?b.yGridTextX.bind(b):b.xGridTextX.bind(b)).attr("y",d).text(function(a){return a.text}).style("opacity",1)]},i.showXGridFocus=function(a){var b=this,c=b.config,d=a.filter(function(a){return a&&n(a.value)}),e=b.main.selectAll("line."+m.xgridFocus),f=b.xx.bind(b);c.tooltip_show&&(b.hasType("scatter")||b.hasArcType()||(e.style("visibility","visible").data([d[0]]).attr(c.axis_rotated?"y1":"x1",f).attr(c.axis_rotated?"y2":"x2",f),b.smoothLines(e,"grid")))},i.hideXGridFocus=function(){this.main.select("line."+m.xgridFocus).style("visibility","hidden")},i.updateXgridFocus=function(){var a=this,b=a.config;a.main.select("line."+m.xgridFocus).attr("x1",b.axis_rotated?0:-10).attr("x2",b.axis_rotated?a.width:-10).attr("y1",b.axis_rotated?-10:0).attr("y2",b.axis_rotated?-10:a.height)},i.generateGridData=function(a,b){var c,d,e,f,g=this,h=[],i=g.main.select("."+m.axisX).selectAll(".tick").size();if("year"===a)for(c=g.getXDomain(),d=c[0].getFullYear(),e=c[1].getFullYear(),f=d;e>=f;f++)h.push(new Date(f+"-01-01 00:00:00"));else h=b.ticks(10),h.length>i&&(h=h.filter(function(a){return(""+a).indexOf(".")<0}));return h},i.getGridFilterToRemove=function(a){return a?function(b){var c=!1;return[].concat(a).forEach(function(a){("value"in a&&b.value===a.value||"class"in a&&b["class"]===a["class"])&&(c=!0)}),c}:function(){return!0}},i.removeGridLines=function(a,b){var c=this,d=c.config,e=c.getGridFilterToRemove(a),f=function(a){return!e(a)},g=b?m.xgridLines:m.ygridLines,h=b?m.xgridLine:m.ygridLine;c.main.select("."+g).selectAll("."+h).filter(e).transition().duration(d.transition_duration).style("opacity",0).remove(),b?d.grid_x_lines=d.grid_x_lines.filter(f):d.grid_y_lines=d.grid_y_lines.filter(f)},i.initTooltip=function(){var a,b=this,c=b.config;if(b.tooltip=b.selectChart.style("position","relative").append("div").attr("class",m.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none"),c.tooltip_init_show){if(b.isTimeSeries()&&p(c.tooltip_init_x)){for(c.tooltip_init_x=b.parseDate(c.tooltip_init_x),a=0;a"+(g||0===g?""+g+" ":"")),h=p(a[f].value,a[f].ratio,a[f].id,a[f].index),void 0!==h&&(i=o(a[f].name,a[f].ratio,a[f].id,a[f].index),j=k.levelColor?k.levelColor(a[f].value):d(a[f].id),e+="",e+=" "+i+" ",e+=""+h+" ",e+=" "));return e+""},i.tooltipPosition=function(a,b,c,d){var e,f,g,h,i,j=this,k=j.config,l=j.d3,m=j.hasArcType(),n=l.mouse(d);return m?(f=(j.width-(j.isLegendRight?j.getLegendWidth():0))/2+n[0],h=j.height/2+n[1]+20):(e=j.getSvgLeft(!0),k.axis_rotated?(f=e+n[0]+100,g=f+b,i=j.currentWidth-j.getCurrentPaddingRight(),h=j.x(a[0].x)+20):(f=e+j.getCurrentPaddingLeft(!0)+j.x(a[0].x)+20,g=f+b,i=e+j.currentWidth-j.getCurrentPaddingRight(),h=n[1]+15),g>i&&(f-=g-i+20),h+c>j.currentHeight&&(h-=c+30)),0>h&&(h=0),{top:h,left:f}},i.showTooltip=function(a,b){var c,d,e,f=this,g=f.config,h=f.hasArcType(),j=a.filter(function(a){return a&&n(a.value)}),k=g.tooltip_position||i.tooltipPosition;0!==j.length&&g.tooltip_show&&(f.tooltip.html(g.tooltip_contents.call(f,a,f.axis.getXAxisTickFormat(),f.getYFormat(h),f.color)).style("display","block"),c=f.tooltip.property("offsetWidth"),d=f.tooltip.property("offsetHeight"),e=k.call(this,j,c,d,b),f.tooltip.style("top",e.top+"px").style("left",e.left+"px"))},i.hideTooltip=function(){this.tooltip.style("display","none")},i.initLegend=function(){var a=this;return a.legendHasRendered=!1,a.legend=a.svg.append("g").attr("transform",a.getTranslate("legend")),a.config.legend_show?void a.updateLegendWithDefaults():(a.legend.style("visibility","hidden"),void(a.hiddenLegendIds=a.mapToIds(a.data.targets)))},i.updateLegendWithDefaults=function(){var a=this;a.updateLegend(a.mapToIds(a.data.targets),{withTransform:!1,withTransitionForTransform:!1,withTransition:!1})},i.updateSizeForLegend=function(a,b){var c=this,d=c.config,e={top:c.isLegendTop?c.getCurrentPaddingTop()+d.legend_inset_y+5.5:c.currentHeight-a-c.getCurrentPaddingBottom()-d.legend_inset_y,left:c.isLegendLeft?c.getCurrentPaddingLeft()+d.legend_inset_x+.5:c.currentWidth-b-c.getCurrentPaddingRight()-d.legend_inset_x+.5};c.margin3={top:c.isLegendRight?0:c.isLegendInset?e.top:c.currentHeight-a,right:0/0,bottom:0,left:c.isLegendRight?c.currentWidth-b:c.isLegendInset?e.left:0}},i.transformLegend=function(a){var b=this;(a?b.legend.transition():b.legend).attr("transform",b.getTranslate("legend"))},i.updateLegendStep=function(a){this.legendStep=a},i.updateLegendItemWidth=function(a){this.legendItemWidth=a},i.updateLegendItemHeight=function(a){this.legendItemHeight=a},i.getLegendWidth=function(){var a=this;return a.config.legend_show?a.isLegendRight||a.isLegendInset?a.legendItemWidth*(a.legendStep+1):a.currentWidth:0},i.getLegendHeight=function(){var a=this,b=0;return a.config.legend_show&&(b=a.isLegendRight?a.currentHeight:Math.max(20,a.legendItemHeight)*(a.legendStep+1)),b},i.opacityForLegend=function(a){return a.classed(m.legendItemHidden)?null:1},i.opacityForUnfocusedLegend=function(a){return a.classed(m.legendItemHidden)?null:.3},i.toggleFocusLegend=function(a,b){var c=this;a=c.mapToTargetIds(a),c.legend.selectAll("."+m.legendItem).filter(function(b){return a.indexOf(b)>=0}).classed(m.legendItemFocused,b).transition().duration(100).style("opacity",function(){var a=b?c.opacityForLegend:c.opacityForUnfocusedLegend;return a.call(c,c.d3.select(this))})},i.revertLegend=function(){var a=this,b=a.d3;a.legend.selectAll("."+m.legendItem).classed(m.legendItemFocused,!1).transition().duration(100).style("opacity",function(){return a.opacityForLegend(b.select(this))})},i.showLegend=function(a){var b=this,c=b.config;c.legend_show||(c.legend_show=!0,b.legend.style("visibility","visible"),b.legendHasRendered||b.updateLegendWithDefaults()),b.removeHiddenLegendIds(a),b.legend.selectAll(b.selectorLegends(a)).style("visibility","visible").transition().style("opacity",function(){return b.opacityForLegend(b.d3.select(this))})},i.hideLegend=function(a){var b=this,c=b.config;c.legend_show&&v(a)&&(c.legend_show=!1,b.legend.style("visibility","hidden")),b.addHiddenLegendIds(a),b.legend.selectAll(b.selectorLegends(a)).style("opacity",0).style("visibility","hidden")};var l={};i.clearLegendItemTextBoxCache=function(){l={}},i.updateLegend=function(a,b,c){function d(a,b){return l[b]||(l[b]=v.getTextRect(a.textContent,m.legendItem)),l[b]}function e(b,c,e){function f(a,b){b||(g=(o-E-n)/2,C>g&&(g=(o-n)/2,E=0,K++)),J[a]=K,I[K]=v.isLegendInset?10:g,F[a]=E,E+=n}var g,h,i=0===e,j=e===a.length-1,k=d(b,c),l=k.width+D+(!j||v.isLegendRight||v.isLegendInset?z:0),m=k.height+y,n=v.isLegendRight||v.isLegendInset?m:l,o=v.isLegendRight||v.isLegendInset?v.getLegendHeight():v.getLegendWidth();return i&&(E=0,K=0,A=0,B=0),w.legend_show&&!v.isLegendToShow(c)?void(G[c]=H[c]=J[c]=F[c]=0):(G[c]=l,H[c]=m,(!A||l>=A)&&(A=l),(!B||m>=B)&&(B=m),h=v.isLegendRight||v.isLegendInset?B:A,void(w.legend_equally?(Object.keys(G).forEach(function(a){G[a]=A}),Object.keys(H).forEach(function(a){H[a]=B}),g=(o-h*a.length)/2,C>g?(E=0,K=0,a.forEach(function(a){f(a)})):f(c,!0)):f(c)))}var f,g,h,i,j,k,n,o,p,q,s,t,u,v=this,w=v.config,y=4,z=10,A=0,B=0,C=10,D=15,E=0,F={},G={},H={},I=[0],J={},K=0;b=b||{},o=x(b,"withTransition",!0),p=x(b,"withTransitionForTransform",!0),v.isLegendInset&&(K=w.legend_inset_step?w.legend_inset_step:a.length,v.updateLegendStep(K)),v.isLegendRight?(f=function(a){return A*J[a]},i=function(a){return I[J[a]]+F[a]}):v.isLegendInset?(f=function(a){return A*J[a]+10},i=function(a){return I[J[a]]+F[a]}):(f=function(a){return I[J[a]]+F[a]},i=function(a){return B*J[a]}),g=function(a,b){return f(a,b)+14},j=function(a,b){return i(a,b)+9},h=function(a,b){return f(a,b)},k=function(a,b){return i(a,b)-5},n=v.legend.selectAll("."+m.legendItem).data(a).enter().append("g").attr("class",function(a){return v.generateClass(m.legendItem,a)}).style("visibility",function(a){return v.isLegendToShow(a)?"visible":"hidden"}).style("cursor","pointer").on("click",function(a){w.legend_item_onclick?w.legend_item_onclick.call(v,a):v.d3.event.altKey?(v.api.hide(),v.api.show(a)):(v.api.toggle(a),v.isTargetToShow(a)?v.api.focus(a):v.api.revert())}).on("mouseover",function(a){v.d3.select(this).classed(m.legendItemFocused,!0),!v.transiting&&v.isTargetToShow(a)&&v.api.focus(a),w.legend_item_onmouseover&&w.legend_item_onmouseover.call(v,a)}).on("mouseout",function(a){v.d3.select(this).classed(m.legendItemFocused,!1),v.api.revert(),w.legend_item_onmouseout&&w.legend_item_onmouseout.call(v,a)}),n.append("text").text(function(a){return r(w.data_names[a])?w.data_names[a]:a}).each(function(a,b){e(this,a,b)}).style("pointer-events","none").attr("x",v.isLegendRight||v.isLegendInset?g:-200).attr("y",v.isLegendRight||v.isLegendInset?-200:j),n.append("rect").attr("class",m.legendItemEvent).style("fill-opacity",0).attr("x",v.isLegendRight||v.isLegendInset?h:-200).attr("y",v.isLegendRight||v.isLegendInset?-200:k),n.append("rect").attr("class",m.legendItemTile).style("pointer-events","none").style("fill",v.color).attr("x",v.isLegendRight||v.isLegendInset?g:-200).attr("y",v.isLegendRight||v.isLegendInset?-200:i).attr("width",10).attr("height",10),u=v.legend.select("."+m.legendBackground+" rect"),v.isLegendInset&&A>0&&0===u.size()&&(u=v.legend.insert("g","."+m.legendItem).attr("class",m.legendBackground).append("rect")),q=v.legend.selectAll("text").data(a).text(function(a){return r(w.data_names[a])?w.data_names[a]:a}).each(function(a,b){e(this,a,b)}),(o?q.transition():q).attr("x",g).attr("y",j),s=v.legend.selectAll("rect."+m.legendItemEvent).data(a),(o?s.transition():s).attr("width",function(a){return G[a]}).attr("height",function(a){return H[a]}).attr("x",h).attr("y",k),t=v.legend.selectAll("rect."+m.legendItemTile).data(a),(o?t.transition():t).style("fill",v.color).attr("x",f).attr("y",i),u&&(o?u.transition():u).attr("height",v.getLegendHeight()-12).attr("width",A*(K+1)+10),v.legend.selectAll("."+m.legendItem).classed(m.legendItemHidden,function(a){return!v.isTargetToShow(a)}),v.updateLegendItemWidth(A),v.updateLegendItemHeight(B),v.updateLegendStep(K),v.updateSizes(),v.updateScales(),v.updateSvgSize(),v.transformAll(p,c),v.legendHasRendered=!0},c(b,f),f.prototype.init=function(){var a=this.owner,b=a.config,c=a.main;a.axes.x=c.append("g").attr("class",m.axis+" "+m.axisX).attr("clip-path",a.clipPathForXAxis).attr("transform",a.getTranslate("x")).style("visibility",b.axis_x_show?"visible":"hidden"),a.axes.x.append("text").attr("class",m.axisXLabel).attr("transform",b.axis_rotated?"rotate(-90)":"").style("text-anchor",this.textAnchorForXAxisLabel.bind(this)),a.axes.y=c.append("g").attr("class",m.axis+" "+m.axisY).attr("clip-path",b.axis_y_inner?"":a.clipPathForYAxis).attr("transform",a.getTranslate("y")).style("visibility",b.axis_y_show?"visible":"hidden"),a.axes.y.append("text").attr("class",m.axisYLabel).attr("transform",b.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForYAxisLabel.bind(this)),a.axes.y2=c.append("g").attr("class",m.axis+" "+m.axisY2).attr("transform",a.getTranslate("y2")).style("visibility",b.axis_y2_show?"visible":"hidden"),a.axes.y2.append("text").attr("class",m.axisY2Label).attr("transform",b.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForY2AxisLabel.bind(this))},f.prototype.getXAxis=function(a,b,c,d,e,f){var h=this.owner,i=h.config,j={isCategory:h.isCategorized(),withOuterTick:e,tickMultiline:i.axis_x_tick_multiline,tickWidth:i.axis_x_tick_width,withoutTransition:f},k=g(h.d3,j).scale(a).orient(b);return h.isTimeSeries()&&d&&(d=d.map(function(a){return h.parseDate(a)})),k.tickFormat(c).tickValues(d),h.isCategorized()&&(k.tickCentered(i.axis_x_tick_centered),v(i.axis_x_tick_culling)&&(i.axis_x_tick_culling=!1)),k},f.prototype.updateXAxisTickValues=function(a,b){var c,d=this.owner,e=d.config;return(e.axis_x_tick_fit||e.axis_x_tick_count)&&(c=this.generateTickValues(d.mapTargetsToUniqueXs(a),e.axis_x_tick_count,d.isTimeSeries())),b?b.tickValues(c):(d.xAxis.tickValues(c),d.subXAxis.tickValues(c)),c},f.prototype.getYAxis=function(a,b,c,d,e){var f={withOuterTick:e},h=this.owner,i=h.d3,j=h.config,k=g(i,f).scale(a).orient(b).tickFormat(c);return h.isTimeSeriesY()?k.ticks(i.time[j.axis_y_tick_time_value],j.axis_y_tick_time_interval):k.tickValues(d),k},f.prototype.getId=function(a){var b=this.owner.config;return a in b.data_axes?b.data_axes[a]:"y"},f.prototype.getXAxisTickFormat=function(){var a=this.owner,b=a.config,c=a.isTimeSeries()?a.defaultAxisTimeFormat:a.isCategorized()?a.categoryName:function(a){return 0>a?a.toFixed(0):a};return b.axis_x_tick_format&&(o(b.axis_x_tick_format)?c=b.axis_x_tick_format:a.isTimeSeries()&&(c=function(c){return c?a.axisTimeFormat(b.axis_x_tick_format)(c):""})),o(c)?function(b){return c.call(a,b)}:c},f.prototype.getTickValues=function(a,b){return a?a:b?b.tickValues():void 0},f.prototype.getXAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_x_tick_values,this.owner.xAxis)},f.prototype.getYAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y_tick_values,this.owner.yAxis)},f.prototype.getY2AxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y2_tick_values,this.owner.y2Axis)},f.prototype.getLabelOptionByAxisId=function(a){var b,c=this.owner,d=c.config;return"y"===a?b=d.axis_y_label:"y2"===a?b=d.axis_y2_label:"x"===a&&(b=d.axis_x_label),b},f.prototype.getLabelText=function(a){var b=this.getLabelOptionByAxisId(a);return p(b)?b:b?b.text:null},f.prototype.setLabelText=function(a,b){var c=this.owner,d=c.config,e=this.getLabelOptionByAxisId(a);p(e)?"y"===a?d.axis_y_label=b:"y2"===a?d.axis_y2_label=b:"x"===a&&(d.axis_x_label=b):e&&(e.text=b)},f.prototype.getLabelPosition=function(a,b){var c=this.getLabelOptionByAxisId(a),d=c&&"object"==typeof c&&c.position?c.position:b;return{isInner:d.indexOf("inner")>=0,isOuter:d.indexOf("outer")>=0,isLeft:d.indexOf("left")>=0,isCenter:d.indexOf("center")>=0,isRight:d.indexOf("right")>=0,isTop:d.indexOf("top")>=0,isMiddle:d.indexOf("middle")>=0,isBottom:d.indexOf("bottom")>=0}},f.prototype.getXAxisLabelPosition=function(){return this.getLabelPosition("x",this.owner.config.axis_rotated?"inner-top":"inner-right")},f.prototype.getYAxisLabelPosition=function(){return this.getLabelPosition("y",this.owner.config.axis_rotated?"inner-right":"inner-top")},f.prototype.getY2AxisLabelPosition=function(){return this.getLabelPosition("y2",this.owner.config.axis_rotated?"inner-right":"inner-top")},f.prototype.getLabelPositionById=function(a){return"y2"===a?this.getY2AxisLabelPosition():"y"===a?this.getYAxisLabelPosition():this.getXAxisLabelPosition()},f.prototype.textForXAxisLabel=function(){return this.getLabelText("x")},f.prototype.textForYAxisLabel=function(){return this.getLabelText("y")},f.prototype.textForY2AxisLabel=function(){return this.getLabelText("y2")},f.prototype.xForAxisLabel=function(a,b){var c=this.owner;return a?b.isLeft?0:b.isCenter?c.width/2:c.width:b.isBottom?-c.height:b.isMiddle?-c.height/2:0},f.prototype.dxForAxisLabel=function(a,b){return a?b.isLeft?"0.5em":b.isRight?"-0.5em":"0":b.isTop?"-0.5em":b.isBottom?"0.5em":"0"},f.prototype.textAnchorForAxisLabel=function(a,b){return a?b.isLeft?"start":b.isCenter?"middle":"end":b.isBottom?"start":b.isMiddle?"middle":"end"},f.prototype.xForXAxisLabel=function(){return this.xForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},f.prototype.xForYAxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},f.prototype.xForY2AxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},f.prototype.dxForXAxisLabel=function(){return this.dxForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},f.prototype.dxForYAxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},f.prototype.dxForY2AxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},f.prototype.dyForXAxisLabel=function(){var a=this.owner,b=a.config,c=this.getXAxisLabelPosition();return b.axis_rotated?c.isInner?"1.2em":-25-this.getMaxTickWidth("x"):c.isInner?"-0.5em":b.axis_x_height?b.axis_x_height-10:"3em"},f.prototype.dyForYAxisLabel=function(){var a=this.owner,b=this.getYAxisLabelPosition();return a.config.axis_rotated?b.isInner?"-0.5em":"3em":b.isInner?"1.2em":-10-(a.config.axis_y_inner?0:this.getMaxTickWidth("y")+10)},f.prototype.dyForY2AxisLabel=function(){var a=this.owner,b=this.getY2AxisLabelPosition();return a.config.axis_rotated?b.isInner?"1.2em":"-2.2em":b.isInner?"-0.5em":15+(a.config.axis_y2_inner?0:this.getMaxTickWidth("y2")+15)},f.prototype.textAnchorForXAxisLabel=function(){var a=this.owner;return this.textAnchorForAxisLabel(!a.config.axis_rotated,this.getXAxisLabelPosition())},f.prototype.textAnchorForYAxisLabel=function(){var a=this.owner;return this.textAnchorForAxisLabel(a.config.axis_rotated,this.getYAxisLabelPosition())},f.prototype.textAnchorForY2AxisLabel=function(){var a=this.owner;return this.textAnchorForAxisLabel(a.config.axis_rotated,this.getY2AxisLabelPosition())},f.prototype.xForRotatedTickText=function(a){return 8*Math.sin(Math.PI*(a/180))},f.prototype.yForRotatedTickText=function(a){return 11.5-2.5*(a/15)*(a>0?1:-1)},f.prototype.rotateTickText=function(a,b,c){a.selectAll(".tick text").style("text-anchor",c>0?"start":"end"),b.selectAll(".tick text").attr("y",this.yForRotatedTickText(c)).attr("transform","rotate("+c+")").selectAll("tspan").attr("dx",this.xForRotatedTickText(c))},f.prototype.getMaxTickWidth=function(b,c){var d,e,f,g,h,i=this.owner,j=i.config,k=0;return c&&i.currentMaxTickWidths[b]?i.currentMaxTickWidths[b]:(i.svg&&(d=i.filterTargetsToShow(i.data.targets),"y"===b?(e=i.y.copy().domain(i.getYDomain(d,"y")),f=this.getYAxis(e,i.yOrient,j.axis_y_tick_format,i.yAxisTickValues)):"y2"===b?(e=i.y2.copy().domain(i.getYDomain(d,"y2")),f=this.getYAxis(e,i.y2Orient,j.axis_y2_tick_format,i.y2AxisTickValues)):(e=i.x.copy().domain(i.getXDomain(d)),f=this.getXAxis(e,i.xOrient,i.xAxisTickFormat,i.xAxisTickValues),this.updateXAxisTickValues(d,f)),g=i.d3.select("body").classed("c3",!0),h=g.append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0),h.append("g").call(f).each(function(){i.d3.select(this).selectAll("text tspan").each(function(){var a=this.getBoundingClientRect();k=k?i.currentMaxTickWidths[b]:k,i.currentMaxTickWidths[b])},f.prototype.updateLabels=function(a){var b=this.owner,c=b.main.select("."+m.axisX+" ."+m.axisXLabel),d=b.main.select("."+m.axisY+" ."+m.axisYLabel),e=b.main.select("."+m.axisY2+" ."+m.axisY2Label);(a?c.transition():c).attr("x",this.xForXAxisLabel.bind(this)).attr("dx",this.dxForXAxisLabel.bind(this)).attr("dy",this.dyForXAxisLabel.bind(this)).text(this.textForXAxisLabel.bind(this)),(a?d.transition():d).attr("x",this.xForYAxisLabel.bind(this)).attr("dx",this.dxForYAxisLabel.bind(this)).attr("dy",this.dyForYAxisLabel.bind(this)).text(this.textForYAxisLabel.bind(this)),(a?e.transition():e).attr("x",this.xForY2AxisLabel.bind(this)).attr("dx",this.dxForY2AxisLabel.bind(this)).attr("dy",this.dyForY2AxisLabel.bind(this)).text(this.textForY2AxisLabel.bind(this))},f.prototype.getPadding=function(a,b,c,d){return n(a[b])?"ratio"===a.unit?a[b]*d:this.convertPixelsToAxisPadding(a[b],d):c},f.prototype.convertPixelsToAxisPadding=function(a,b){var c=this.owner,d=c.config.axis_rotated?c.width:c.height;return b*(a/d)},f.prototype.generateTickValues=function(a,b,c){var d,e,f,g,h,i,j,k=a;if(b)if(d=o(b)?b():b,1===d)k=[a[0]];else if(2===d)k=[a[0],a[a.length-1]];else if(d>2){for(g=d-2,e=a[0],f=a[a.length-1],h=(f-e)/(g+1),k=[e],i=0;g>i;i++)j=+e+h*(i+1),k.push(c?new Date(j):j);k.push(f)}return c||(k=k.sort(function(a,b){return a-b})),k},f.prototype.generateTransitions=function(a){var b=this.owner,c=b.axes;return{axisX:a?c.x.transition().duration(a):c.x,axisY:a?c.y.transition().duration(a):c.y,axisY2:a?c.y2.transition().duration(a):c.y2,axisSubX:a?c.subx.transition().duration(a):c.subx}},f.prototype.redraw=function(a,b){var c=this.owner,d=c.config;c.axes.x.style("opacity",b?0:1),c.axes.y.style("opacity",b?0:1),c.axes.y2.style("opacity",b?0:1),c.axes.subx.style("opacity",b?0:1),a.axisX.call(c.xAxis),a.axisY.call(c.yAxis),a.axisY2.call(c.y2Axis),a.axisSubX.call(c.subXAxis),!d.axis_rotated&&d.axis_x_tick_rotate&&(this.rotateTickText(c.axes.x,a.axisX,d.axis_x_tick_rotate),this.rotateTickText(c.axes.subx,a.axisSubX,d.axis_x_tick_rotate))},i.getClipPath=function(b){var c=a.navigator.appVersion.toLowerCase().indexOf("msie 9.")>=0;return"url("+(c?"":document.URL.split("#")[0])+"#"+b+")"},i.appendClip=function(a,b){return a.append("clipPath").attr("id",b).append("rect")},i.getAxisClipX=function(a){var b=Math.max(30,this.margin.left);return a?-(1+b):-(b-1)},i.getAxisClipY=function(a){return a?-20:-this.margin.top},i.getXAxisClipX=function(){var a=this;return a.getAxisClipX(!a.config.axis_rotated)},i.getXAxisClipY=function(){var a=this;return a.getAxisClipY(!a.config.axis_rotated)},i.getYAxisClipX=function(){var a=this;return a.config.axis_y_inner?-1:a.getAxisClipX(a.config.axis_rotated)},i.getYAxisClipY=function(){var a=this;return a.getAxisClipY(a.config.axis_rotated)},i.getAxisClipWidth=function(a){var b=this,c=Math.max(30,b.margin.left),d=Math.max(30,b.margin.right);return a?b.width+2+c+d:b.margin.left+20},i.getAxisClipHeight=function(a){return(a?this.margin.bottom:this.margin.top+this.height)+20},i.getXAxisClipWidth=function(){var a=this;return a.getAxisClipWidth(!a.config.axis_rotated)},i.getXAxisClipHeight=function(){var a=this;return a.getAxisClipHeight(!a.config.axis_rotated)},i.getYAxisClipWidth=function(){var a=this;return a.getAxisClipWidth(a.config.axis_rotated)+(a.config.axis_y_inner?20:0)},i.getYAxisClipHeight=function(){var a=this;return a.getAxisClipHeight(a.config.axis_rotated)},i.initPie=function(){var a=this,b=a.d3,c=a.config;a.pie=b.layout.pie().value(function(a){return a.values.reduce(function(a,b){return a+b.value},0)}),c.data_order||a.pie.sort(null)},i.updateRadius=function(){var a=this,b=a.config,c=b.gauge_width||b.donut_width;a.radiusExpanded=Math.min(a.arcWidth,a.arcHeight)/2,a.radius=.95*a.radiusExpanded,a.innerRadiusRatio=c?(a.radius-c)/a.radius:.6,a.innerRadius=a.hasType("donut")||a.hasType("gauge")?a.radius*a.innerRadiusRatio:0},i.updateArc=function(){var a=this;a.svgArc=a.getSvgArc(),a.svgArcExpanded=a.getSvgArcExpanded(),a.svgArcExpandedSub=a.getSvgArcExpanded(.98)},i.updateAngle=function(a){var b,c,d=this,e=d.config,f=!1,g=0,h=e.gauge_min,i=e.gauge_max;return d.pie(d.filterTargetsToShow(d.data.targets)).forEach(function(b){f||b.data.id!==a.data.id||(f=!0,a=b,a.index=g),g++}),isNaN(a.startAngle)&&(a.startAngle=0),isNaN(a.endAngle)&&(a.endAngle=a.startAngle),d.isGaugeType(a.data)&&(b=Math.PI/(i-h),c=a.value.375?1.175-36/g.radius:.8)*g.radius/e:0,i="translate("+c*f+","+d*f+")"),i},i.getArcRatio=function(a){var b=this,c=b.hasType("gauge")?Math.PI:2*Math.PI;return a?(a.endAngle-a.startAngle)/c:null},i.convertToArcData=function(a){return this.addName({id:a.data.id,value:a.value,ratio:this.getArcRatio(a),index:a.index})},i.textForArcLabel=function(a){var b,c,d,e,f,g=this;return g.shouldShowArcLabel()?(b=g.updateAngle(a),c=b?b.value:null,d=g.getArcRatio(b),e=a.data.id,g.hasType("gauge")||g.meetsArcLabelThreshold(d)?(f=g.getArcLabelFormat(),f?f(c,d,e):g.defaultArcValueFormat(c,d)):""):""},i.expandArc=function(b){var c,d=this;return d.transiting?void(c=a.setInterval(function(){d.transiting||(a.clearInterval(c),d.legend.selectAll(".c3-legend-item-focused").size()>0&&d.expandArc(b))},10)):(b=d.mapToTargetIds(b),void d.svg.selectAll(d.selectorTargets(b,"."+m.chartArc)).each(function(a){d.shouldExpand(a.data.id)&&d.d3.select(this).selectAll("path").transition().duration(50).attr("d",d.svgArcExpanded).transition().duration(100).attr("d",d.svgArcExpandedSub).each(function(a){d.isDonutType(a.data)})}))},i.unexpandArc=function(a){var b=this;b.transiting||(a=b.mapToTargetIds(a),b.svg.selectAll(b.selectorTargets(a,"."+m.chartArc)).selectAll("path").transition().duration(50).attr("d",b.svgArc),b.svg.selectAll("."+m.arc).style("opacity",1))},i.shouldExpand=function(a){var b=this,c=b.config;return b.isDonutType(a)&&c.donut_expand||b.isGaugeType(a)&&c.gauge_expand||b.isPieType(a)&&c.pie_expand},i.shouldShowArcLabel=function(){var a=this,b=a.config,c=!0;return a.hasType("donut")?c=b.donut_label_show:a.hasType("pie")&&(c=b.pie_label_show),c},i.meetsArcLabelThreshold=function(a){var b=this,c=b.config,d=b.hasType("donut")?c.donut_label_threshold:c.pie_label_threshold;return a>=d},i.getArcLabelFormat=function(){var a=this,b=a.config,c=b.pie_label_format;return a.hasType("gauge")?c=b.gauge_label_format:a.hasType("donut")&&(c=b.donut_label_format),c},i.getArcTitle=function(){var a=this;return a.hasType("donut")?a.config.donut_title:""},i.updateTargetsForArc=function(a){var b,c,d=this,e=d.main,f=d.classChartArc.bind(d),g=d.classArcs.bind(d),h=d.classFocus.bind(d);b=e.select("."+m.chartArcs).selectAll("."+m.chartArc).data(d.pie(a)).attr("class",function(a){return f(a)+h(a.data)}),c=b.enter().append("g").attr("class",f),c.append("g").attr("class",g),c.append("text").attr("dy",d.hasType("gauge")?"-.1em":".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none")},i.initArc=function(){var a=this;a.arcs=a.main.select("."+m.chart).append("g").attr("class",m.chartArcs).attr("transform",a.getTranslate("arc")),a.arcs.append("text").attr("class",m.chartArcsTitle).style("text-anchor","middle").text(a.getArcTitle())},i.redrawArc=function(a,b,c){var d,e=this,f=e.d3,g=e.config,h=e.main;d=h.selectAll("."+m.arcs).selectAll("."+m.arc).data(e.arcData.bind(e)),d.enter().append("path").attr("class",e.classArc.bind(e)).style("fill",function(a){return e.color(a.data)}).style("cursor",function(a){return g.interaction_enabled&&g.data_selection_isselectable(a)?"pointer":null}).style("opacity",0).each(function(a){e.isGaugeType(a.data)&&(a.startAngle=a.endAngle=-1*(Math.PI/2)),this._current=a}),d.attr("transform",function(a){return!e.isGaugeType(a.data)&&c?"scale(0)":""}).style("opacity",function(a){return a===this._current?0:1}).on("mouseover",g.interaction_enabled?function(a){var b,c;e.transiting||(b=e.updateAngle(a),c=e.convertToArcData(b),e.expandArc(b.data.id),e.api.focus(b.data.id),e.toggleFocusLegend(b.data.id,!0),e.config.data_onmouseover(c,this))}:null).on("mousemove",g.interaction_enabled?function(a){var b=e.updateAngle(a),c=e.convertToArcData(b),d=[c];e.showTooltip(d,this)}:null).on("mouseout",g.interaction_enabled?function(a){var b,c;e.transiting||(b=e.updateAngle(a),c=e.convertToArcData(b),e.unexpandArc(b.data.id),e.api.revert(),e.revertLegend(),e.hideTooltip(),e.config.data_onmouseout(c,this))}:null).on("click",g.interaction_enabled?function(a,b){var c=e.updateAngle(a),d=e.convertToArcData(c);e.toggleShape&&e.toggleShape(this,d,b),e.config.data_onclick.call(e.api,d,this)}:null).each(function(){e.transiting=!0}).transition().duration(a).attrTween("d",function(a){var b,c=e.updateAngle(a);return c?(isNaN(this._current.startAngle)&&(this._current.startAngle=0),isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle),b=f.interpolate(this._current,c),this._current=b(0),function(c){var d=b(c);return d.data=a.data,e.getArc(d,!0)}):function(){return"M 0 0"}}).attr("transform",c?"scale(1)":"").style("fill",function(a){return e.levelColor?e.levelColor(a.data.values[0].value):e.color(a.data.id)}).style("opacity",1).call(e.endall,function(){e.transiting=!1}),d.exit().transition().duration(b).style("opacity",0).remove(),h.selectAll("."+m.chartArc).select("text").style("opacity",0).attr("class",function(a){return e.isGaugeType(a.data)?m.gaugeValue:""}).text(e.textForArcLabel.bind(e)).attr("transform",e.transformForArcLabel.bind(e)).style("font-size",function(a){return e.isGaugeType(a.data)?Math.round(e.radius/5)+"px":""}).transition().duration(a).style("opacity",function(a){return e.isTargetToShow(a.data.id)&&e.isArcType(a.data)?1:0}),h.select("."+m.chartArcsTitle).style("opacity",e.hasType("donut")||e.hasType("gauge")?1:0),e.hasType("gauge")&&(e.arcs.select("."+m.chartArcsBackground).attr("d",function(){var a={data:[{value:g.gauge_max}],startAngle:-1*(Math.PI/2),endAngle:Math.PI/2};return e.getArc(a,!0,!0)}),e.arcs.select("."+m.chartArcsGaugeUnit).attr("dy",".75em").text(g.gauge_label_show?g.gauge_units:""),e.arcs.select("."+m.chartArcsGaugeMin).attr("dx",-1*(e.innerRadius+(e.radius-e.innerRadius)/2)+"px").attr("dy","1.2em").text(g.gauge_label_show?g.gauge_min:""),e.arcs.select("."+m.chartArcsGaugeMax).attr("dx",e.innerRadius+(e.radius-e.innerRadius)/2+"px").attr("dy","1.2em").text(g.gauge_label_show?g.gauge_max:""))},i.initGauge=function(){var a=this.arcs;this.hasType("gauge")&&(a.append("path").attr("class",m.chartArcsBackground),a.append("text").attr("class",m.chartArcsGaugeUnit).style("text-anchor","middle").style("pointer-events","none"),a.append("text").attr("class",m.chartArcsGaugeMin).style("text-anchor","middle").style("pointer-events","none"),a.append("text").attr("class",m.chartArcsGaugeMax).style("text-anchor","middle").style("pointer-events","none"))},i.getGaugeLabelHeight=function(){return this.config.gauge_label_show?20:0},i.initRegion=function(){var a=this;a.region=a.main.append("g").attr("clip-path",a.clipPath).attr("class",m.regions)},i.updateRegion=function(a){var b=this,c=b.config;b.region.style("visibility",b.hasArcType()?"hidden":"visible"),b.mainRegion=b.main.select("."+m.regions).selectAll("."+m.region).data(c.regions),b.mainRegion.enter().append("g").attr("class",b.classRegion.bind(b)).append("rect").style("fill-opacity",0),b.mainRegion.exit().transition().duration(a).style("opacity",0).remove()},i.redrawRegion=function(a){var b=this,c=b.mainRegion.selectAll("rect"),d=b.regionX.bind(b),e=b.regionY.bind(b),f=b.regionWidth.bind(b),g=b.regionHeight.bind(b);return[(a?c.transition():c).attr("x",d).attr("y",e).attr("width",f).attr("height",g).style("fill-opacity",function(a){return n(a.opacity)?a.opacity:.1})]},i.regionX=function(a){var b,c=this,d=c.config,e="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d.axis_rotated&&"start"in a?e(a.start):0:d.axis_rotated?0:"start"in a?c.x(c.isTimeSeries()?c.parseDate(a.start):a.start):0},i.regionY=function(a){var b,c=this,d=c.config,e="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d.axis_rotated?0:"end"in a?e(a.end):0:d.axis_rotated&&"start"in a?c.x(c.isTimeSeries()?c.parseDate(a.start):a.start):0},i.regionWidth=function(a){var b,c=this,d=c.config,e=c.regionX(a),f="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d.axis_rotated&&"end"in a?f(a.end):c.width:d.axis_rotated?c.width:"end"in a?c.x(c.isTimeSeries()?c.parseDate(a.end):a.end):c.width,e>b?0:b-e},i.regionHeight=function(a){var b,c=this,d=c.config,e=this.regionY(a),f="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d.axis_rotated?c.height:"start"in a?f(a.start):c.height:d.axis_rotated&&"end"in a?c.x(c.isTimeSeries()?c.parseDate(a.end):a.end):c.height,e>b?0:b-e},i.isRegionOnX=function(a){return!a.axis||"x"===a.axis},i.drag=function(a){var b,c,d,e,f,g,h,i,j=this,k=j.config,l=j.main,n=j.d3;j.hasArcType()||k.data_selection_enabled&&(!k.zoom_enabled||j.zoom.altDomain)&&k.data_selection_multiple&&(b=j.dragStart[0],c=j.dragStart[1],d=a[0],e=a[1],f=Math.min(b,d),g=Math.max(b,d),h=k.data_selection_grouped?j.margin.top:Math.min(c,e),i=k.data_selection_grouped?j.height:Math.max(c,e),l.select("."+m.dragarea).attr("x",f).attr("y",h).attr("width",g-f).attr("height",i-h),l.selectAll("."+m.shapes).selectAll("."+m.shape).filter(function(a){return k.data_selection_isselectable(a)}).each(function(a,b){var c,d,e,k,l,o,p=n.select(this),q=p.classed(m.SELECTED),r=p.classed(m.INCLUDED),s=!1;if(p.classed(m.circle))c=1*p.attr("cx"),d=1*p.attr("cy"),l=j.togglePoint,s=c>f&&g>c&&d>h&&i>d;else{if(!p.classed(m.bar))return;o=z(this),c=o.x,d=o.y,e=o.width,k=o.height,l=j.togglePath,s=!(c>g||f>c+e||d>i||h>d+k)}s^r&&(p.classed(m.INCLUDED,!r),p.classed(m.SELECTED,!q),l.call(j,!q,p,a,b))}))},i.dragstart=function(a){var b=this,c=b.config;b.hasArcType()||c.data_selection_enabled&&(b.dragStart=a,b.main.select("."+m.chart).append("rect").attr("class",m.dragarea).style("opacity",.1),b.dragging=!0)},i.dragend=function(){var a=this,b=a.config;a.hasArcType()||b.data_selection_enabled&&(a.main.select("."+m.dragarea).transition().duration(100).style("opacity",0).remove(),a.main.selectAll("."+m.shape).classed(m.INCLUDED,!1),a.dragging=!1)},i.selectPoint=function(a,b,c){var d=this,e=d.config,f=(e.axis_rotated?d.circleY:d.circleX).bind(d),g=(e.axis_rotated?d.circleX:d.circleY).bind(d),h=d.pointSelectR.bind(d);e.data_onselected.call(d.api,b,a.node()),d.main.select("."+m.selectedCircles+d.getTargetSelectorSuffix(b.id)).selectAll("."+m.selectedCircle+"-"+c).data([b]).enter().append("circle").attr("class",function(){return d.generateClass(m.selectedCircle,c)}).attr("cx",f).attr("cy",g).attr("stroke",function(){return d.color(b)}).attr("r",function(a){return 1.4*d.pointSelectR(a)}).transition().duration(100).attr("r",h)},i.unselectPoint=function(a,b,c){var d=this;d.config.data_onunselected(b,a.node()),d.main.select("."+m.selectedCircles+d.getTargetSelectorSuffix(b.id)).selectAll("."+m.selectedCircle+"-"+c).transition().duration(100).attr("r",0).remove()},i.togglePoint=function(a,b,c,d){a?this.selectPoint(b,c,d):this.unselectPoint(b,c,d)},i.selectPath=function(a,b){var c=this;c.config.data_onselected.call(c,b,a.node()),a.transition().duration(100).style("fill",function(){return c.d3.rgb(c.color(b)).brighter(.75)})},i.unselectPath=function(a,b){var c=this;c.config.data_onunselected.call(c,b,a.node()),a.transition().duration(100).style("fill",function(){return c.color(b)})},i.togglePath=function(a,b,c,d){a?this.selectPath(b,c,d):this.unselectPath(b,c,d)},i.getToggle=function(a,b){var c,d=this;return"circle"===a.nodeName?c=d.isStepType(b)?function(){}:d.togglePoint:"path"===a.nodeName&&(c=d.togglePath),c},i.toggleShape=function(a,b,c){var d=this,e=d.d3,f=d.config,g=e.select(a),h=g.classed(m.SELECTED),i=d.getToggle(a,b).bind(d);f.data_selection_enabled&&f.data_selection_isselectable(b)&&(f.data_selection_multiple||d.main.selectAll("."+m.shapes+(f.data_selection_grouped?d.getTargetSelectorSuffix(b.id):"")).selectAll("."+m.shape).each(function(a,b){var c=e.select(this);c.classed(m.SELECTED)&&i(!1,c.classed(m.SELECTED,!1),a,b)}),g.classed(m.SELECTED,!h),i(!h,g,b,c))},i.initBrush=function(){var a=this,b=a.d3;a.brush=b.svg.brush().on("brush",function(){a.redrawForBrush()}),a.brush.update=function(){return a.context&&a.context.select("."+m.brush).call(this),this},a.brush.scale=function(b){return a.config.axis_rotated?this.y(b):this.x(b)}},i.initSubchart=function(){var a=this,b=a.config,c=a.context=a.svg.append("g").attr("transform",a.getTranslate("context"));c.style("visibility",b.subchart_show?"visible":"hidden"),c.append("g").attr("clip-path",a.clipPathForSubchart).attr("class",m.chart),c.select("."+m.chart).append("g").attr("class",m.chartBars),c.select("."+m.chart).append("g").attr("class",m.chartLines),c.append("g").attr("clip-path",a.clipPath).attr("class",m.brush).call(a.brush),a.axes.subx=c.append("g").attr("class",m.axisX).attr("transform",a.getTranslate("subx")).attr("clip-path",b.axis_rotated?"":a.clipPathForXAxis)},i.updateTargetsForSubchart=function(a){var b,c,d,e,f=this,g=f.context,h=f.config,i=f.classChartBar.bind(f),j=f.classBars.bind(f),k=f.classChartLine.bind(f),l=f.classLines.bind(f),n=f.classAreas.bind(f);h.subchart_show&&(e=g.select("."+m.chartBars).selectAll("."+m.chartBar).data(a).attr("class",i),d=e.enter().append("g").style("opacity",0).attr("class",i),d.append("g").attr("class",j),c=g.select("."+m.chartLines).selectAll("."+m.chartLine).data(a).attr("class",k),b=c.enter().append("g").style("opacity",0).attr("class",k),b.append("g").attr("class",l),b.append("g").attr("class",n),g.selectAll("."+m.brush+" rect").attr(h.axis_rotated?"width":"height",h.axis_rotated?f.width2:f.height2))},i.updateBarForSubchart=function(a){var b=this;b.contextBar=b.context.selectAll("."+m.bars).selectAll("."+m.bar).data(b.barData.bind(b)),b.contextBar.enter().append("path").attr("class",b.classBar.bind(b)).style("stroke","none").style("fill",b.color),b.contextBar.style("opacity",b.initialOpacity.bind(b)),b.contextBar.exit().transition().duration(a).style("opacity",0).remove()},i.redrawBarForSubchart=function(a,b,c){(b?this.contextBar.transition().duration(c):this.contextBar).attr("d",a).style("opacity",1)},i.updateLineForSubchart=function(a){var b=this;b.contextLine=b.context.selectAll("."+m.lines).selectAll("."+m.line).data(b.lineData.bind(b)),b.contextLine.enter().append("path").attr("class",b.classLine.bind(b)).style("stroke",b.color),b.contextLine.style("opacity",b.initialOpacity.bind(b)),b.contextLine.exit().transition().duration(a).style("opacity",0).remove()},i.redrawLineForSubchart=function(a,b,c){(b?this.contextLine.transition().duration(c):this.contextLine).attr("d",a).style("opacity",1)},i.updateAreaForSubchart=function(a){var b=this,c=b.d3;b.contextArea=b.context.selectAll("."+m.areas).selectAll("."+m.area).data(b.lineData.bind(b)),b.contextArea.enter().append("path").attr("class",b.classArea.bind(b)).style("fill",b.color).style("opacity",function(){return b.orgAreaOpacity=+c.select(this).style("opacity"),0}),b.contextArea.style("opacity",0),b.contextArea.exit().transition().duration(a).style("opacity",0).remove()},i.redrawAreaForSubchart=function(a,b,c){(b?this.contextArea.transition().duration(c):this.contextArea).attr("d",a).style("fill",this.color).style("opacity",this.orgAreaOpacity)},i.redrawSubchart=function(a,b,c,d,e,f,g){var h,i,j,k=this,l=k.d3,m=k.config;k.context.style("visibility",m.subchart_show?"visible":"hidden"),m.subchart_show&&(l.event&&"zoom"===l.event.type&&k.brush.extent(k.x.orgDomain()).update(),a&&(k.brush.empty()||k.brush.extent(k.x.orgDomain()).update(),h=k.generateDrawArea(e,!0),i=k.generateDrawBar(f,!0),j=k.generateDrawLine(g,!0),k.updateBarForSubchart(c),k.updateLineForSubchart(c),k.updateAreaForSubchart(c),k.redrawBarForSubchart(i,c,c),k.redrawLineForSubchart(j,c,c),k.redrawAreaForSubchart(h,c,c)))},i.redrawForBrush=function(){var a=this,b=a.x;a.redraw({withTransition:!1,withY:a.config.zoom_rescale,withSubchart:!1,withUpdateXDomain:!0,withDimension:!1}),a.config.subchart_onbrush.call(a.api,b.orgDomain())},i.transformContext=function(a,b){var c,d=this;b&&b.axisSubX?c=b.axisSubX:(c=d.context.select("."+m.axisX),a&&(c=c.transition())),d.context.attr("transform",d.getTranslate("context")),c.attr("transform",d.getTranslate("subx"))},i.getDefaultExtent=function(){var a=this,b=a.config,c=o(b.axis_x_extent)?b.axis_x_extent(a.getXDomain(a.data.targets)):b.axis_x_extent;return a.isTimeSeries()&&(c=[a.parseDate(c[0]),a.parseDate(c[1])]),c},i.initZoom=function(){var a,b=this,c=b.d3,d=b.config;b.zoom=c.behavior.zoom().on("zoomstart",function(){a=c.event.sourceEvent,b.zoom.altDomain=c.event.sourceEvent.altKey?b.x.orgDomain():null,d.zoom_onzoomstart.call(b.api,c.event.sourceEvent)}).on("zoom",function(){b.redrawForZoom.call(b)}).on("zoomend",function(){var e=c.event.sourceEvent;e&&a.clientX===e.clientX&&a.clientY===e.clientY||(b.redrawEventRect(),b.updateZoom(),d.zoom_onzoomend.call(b.api,b.x.orgDomain()))}),b.zoom.scale=function(a){return d.axis_rotated?this.y(a):this.x(a)},b.zoom.orgScaleExtent=function(){var a=d.zoom_extent?d.zoom_extent:[1,10];return[a[0],Math.max(b.getMaxDataCount()/a[1],a[1])]},b.zoom.updateScaleExtent=function(){var a=u(b.x.orgDomain())/u(b.orgXDomain),c=this.orgScaleExtent();return this.scaleExtent([c[0]*a,c[1]*a]),this}},i.updateZoom=function(){var a=this,b=a.config.zoom_enabled?a.zoom:function(){};a.main.select("."+m.zoomRect).call(b).on("dblclick.zoom",null),a.main.selectAll("."+m.eventRect).call(b).on("dblclick.zoom",null)},i.redrawForZoom=function(){var a=this,b=a.d3,c=a.config,d=a.zoom,e=a.x;if(c.zoom_enabled&&0!==a.filterTargetsToShow(a.data.targets).length){if("mousemove"===b.event.sourceEvent.type&&d.altDomain)return e.domain(d.altDomain),void d.scale(e).updateScaleExtent();a.isCategorized()&&e.orgDomain()[0]===a.orgXDomain[0]&&e.domain([a.orgXDomain[0]-1e-10,e.orgDomain()[1]]),a.redraw({withTransition:!1,withY:c.zoom_rescale,withSubchart:!1,withEventRect:!1,withDimension:!1}),"mousemove"===b.event.sourceEvent.type&&(a.cancelClick=!0),c.zoom_onzoom.call(a.api,e.orgDomain())}},i.generateColor=function(){var a=this,b=a.config,c=a.d3,d=b.data_colors,e=w(b.color_pattern)?b.color_pattern:c.scale.category10().range(),f=b.data_color,g=[];return function(a){var b,c=a.id||a.data&&a.data.id||a;return d[c]instanceof Function?b=d[c](a):d[c]?b=d[c]:(g.indexOf(c)<0&&g.push(c),b=e[g.indexOf(c)%e.length],d[c]=b),f instanceof Function?f(b,a):b}},i.generateLevelColor=function(){var a=this,b=a.config,c=b.color_pattern,d=b.color_threshold,e="value"===d.unit,f=d.values&&d.values.length?d.values:[],g=d.max||100;return w(b.color_threshold)?function(a){var b,d,h=c[c.length-1];for(b=0;b=0?m.focused:"")},i.classDefocused=function(a){return" "+(this.defocusedTargetIds.indexOf(a.id)>=0?m.defocused:"")},i.classChartText=function(a){return m.chartText+this.classTarget(a.id)},i.classChartLine=function(a){return m.chartLine+this.classTarget(a.id)},i.classChartBar=function(a){return m.chartBar+this.classTarget(a.id)},i.classChartArc=function(a){return m.chartArc+this.classTarget(a.data.id)},i.getTargetSelectorSuffix=function(a){return a||0===a?("-"+a).replace(/[\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\]/g,"-"):""},i.selectorTarget=function(a,b){return(b||"")+"."+m.target+this.getTargetSelectorSuffix(a)},i.selectorTargets=function(a,b){var c=this;return a=a||[],a.length?a.map(function(a){return c.selectorTarget(a,b)}):null},i.selectorLegend=function(a){return"."+m.legendItem+this.getTargetSelectorSuffix(a)},i.selectorLegends=function(a){var b=this;return a&&a.length?a.map(function(a){return b.selectorLegend(a)}):null};var n=i.isValue=function(a){return a||0===a},o=i.isFunction=function(a){return"function"==typeof a},p=i.isString=function(a){return"string"==typeof a},q=i.isUndefined=function(a){return"undefined"==typeof a},r=i.isDefined=function(a){return"undefined"!=typeof a},s=i.ceil10=function(a){return 10*Math.ceil(a/10)},t=i.asHalfPixel=function(a){return Math.ceil(a)+.5},u=i.diffDomain=function(a){return a[1]-a[0]},v=i.isEmpty=function(a){return!a||p(a)&&0===a.length||"object"==typeof a&&0===Object.keys(a).length},w=i.notEmpty=function(a){return Object.keys(a).length>0},x=i.getOption=function(a,b,c){return r(a[b])?a[b]:c},y=i.hasValue=function(a,b){var c=!1;return Object.keys(a).forEach(function(d){a[d]===b&&(c=!0)}),c},z=i.getPathBox=function(a){var b=a.getBoundingClientRect(),c=[a.pathSegList.getItem(0),a.pathSegList.getItem(1)],d=c[0].x,e=Math.min(c[0].y,c[1].y);return{x:d,y:e,width:b.width,height:b.height}};h.focus=function(a){var b,c=this.internal;a=c.mapToTargetIds(a),b=c.svg.selectAll(c.selectorTargets(a.filter(c.isTargetToShow,c))),this.revert(),this.defocus(),b.classed(m.focused,!0).classed(m.defocused,!1),c.hasArcType()&&c.expandArc(a),c.toggleFocusLegend(a,!0),c.focusedTargetIds=a,c.defocusedTargetIds=c.defocusedTargetIds.filter(function(b){return a.indexOf(b)<0})},h.defocus=function(a){var b,c=this.internal;a=c.mapToTargetIds(a),b=c.svg.selectAll(c.selectorTargets(a.filter(c.isTargetToShow,c))),b.classed(m.focused,!1).classed(m.defocused,!0),c.hasArcType()&&c.unexpandArc(a),c.toggleFocusLegend(a,!1),c.focusedTargetIds=c.focusedTargetIds.filter(function(b){return a.indexOf(b)<0}),c.defocusedTargetIds=a},h.revert=function(a){var b,c=this.internal;a=c.mapToTargetIds(a),b=c.svg.selectAll(c.selectorTargets(a)),b.classed(m.focused,!1).classed(m.defocused,!1),c.hasArcType()&&c.unexpandArc(a),c.config.legend_show&&(c.showLegend(a.filter(c.isLegendToShow.bind(c))),c.legend.selectAll(c.selectorLegends(a)).filter(function(){return c.d3.select(this).classed(m.legendItemFocused)}).classed(m.legendItemFocused,!1)),c.focusedTargetIds=[],c.defocusedTargetIds=[]},h.show=function(a,b){var c,d=this.internal;a=d.mapToTargetIds(a),b=b||{},d.removeHiddenTargetIds(a),c=d.svg.selectAll(d.selectorTargets(a)),c.transition().style("opacity",1,"important").call(d.endall,function(){c.style("opacity",null).style("opacity",1)}),b.withLegend&&d.showLegend(a),d.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},h.hide=function(a,b){var c,d=this.internal;a=d.mapToTargetIds(a),b=b||{},d.addHiddenTargetIds(a),c=d.svg.selectAll(d.selectorTargets(a)),c.transition().style("opacity",0,"important").call(d.endall,function(){c.style("opacity",null).style("opacity",0)}),b.withLegend&&d.hideLegend(a),d.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},h.toggle=function(a,b){var c=this,d=this.internal;d.mapToTargetIds(a).forEach(function(a){d.isTargetToShow(a)?c.hide(a,b):c.show(a,b)})},h.zoom=function(a){var b=this.internal;return a&&(b.isTimeSeries()&&(a=a.map(function(a){return b.parseDate(a)})),b.brush.extent(a),b.redraw({withUpdateXDomain:!0,withY:b.config.zoom_rescale}),b.config.zoom_onzoom.call(this,b.x.orgDomain())),b.brush.extent()},h.zoom.enable=function(a){var b=this.internal;b.config.zoom_enabled=a,b.updateAndRedraw()},h.unzoom=function(){var a=this.internal;a.brush.clear().update(),a.redraw({withUpdateXDomain:!0})},h.load=function(a){var b=this.internal,c=b.config;return a.xs&&b.addXs(a.xs),"classes"in a&&Object.keys(a.classes).forEach(function(b){c.data_classes[b]=a.classes[b]}),"categories"in a&&b.isCategorized()&&(c.axis_x_categories=a.categories),"axes"in a&&Object.keys(a.axes).forEach(function(b){c.data_axes[b]=a.axes[b]}),"cacheIds"in a&&b.hasCaches(a.cacheIds)?void b.load(b.getCaches(a.cacheIds),a.done):void("unload"in a?b.unload(b.mapToTargetIds("boolean"==typeof a.unload&&a.unload?null:a.unload),function(){b.loadFromArgs(a)}):b.loadFromArgs(a))},h.unload=function(a){var b=this.internal;a=a||{},a instanceof Array?a={ids:a}:"string"==typeof a&&(a={ids:[a]}),b.unload(b.mapToTargetIds(a.ids),function(){b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),a.done&&a.done()})},h.flow=function(a){var b,c,d,e,f,g,h,i,j=this.internal,k=[],l=j.getMaxDataCount(),m=0,o=0;if(a.json)c=j.convertJsonToData(a.json,a.keys);else if(a.rows)c=j.convertRowsToData(a.rows);else{if(!a.columns)return;c=j.convertColumnsToData(a.columns)}b=j.convertDataToTargets(c,!0),j.data.targets.forEach(function(a){var c,d,e=!1;for(c=0;cd;d++)b[c].values[d].index=o+d,j.isTimeSeries()||(b[c].values[d].x=o+d);a.values=a.values.concat(b[c].values),b.splice(c,1);break}e||k.push(a.id)}),j.data.targets.forEach(function(a){var b,c;for(b=0;bc;c++)a.values.push({id:a.id,index:o+c,x:j.isTimeSeries()?j.getOtherTargetX(o+c):o+c,value:null})}),j.data.targets.length&&b.forEach(function(a){var b,c=[];for(b=j.data.targets[0].values[0].index;o>b;b++)c.push({id:a.id,index:b,x:j.isTimeSeries()?j.getOtherTargetX(b):b,value:null});a.values.forEach(function(a){a.index+=o,j.isTimeSeries()||(a.x+=o)}),a.values=c.concat(a.values)}),j.data.targets=j.data.targets.concat(b),d=j.getMaxDataCount(),f=j.data.targets[0],g=f.values[0],r(a.to)?(m=0,i=j.isTimeSeries()?j.parseDate(a.to):a.to,f.values.forEach(function(a){a.x1?f.values[f.values.length-1].x-g.x:g.x-j.getXDomain(j.data.targets)[0]:1,e=[g.x-h,g.x],j.updateXDomain(null,!0,!0,!1,e)),j.updateTargets(j.data.targets),j.redraw({flow:{index:g.index,length:m,duration:n(a.duration)?a.duration:j.config.transition_duration,done:a.done,orgDataCount:l},withLegend:!0,withTransition:l>1,withTrimXDomain:!1,withUpdateXAxis:!0})},i.generateFlow=function(a){var b=this,c=b.config,d=b.d3;return function(){var e,f,g,h=a.targets,i=a.flow,j=a.drawBar,k=a.drawLine,l=a.drawArea,n=a.cx,o=a.cy,p=a.xv,q=a.xForText,r=a.yForText,s=a.duration,t=1,v=i.index,w=i.length,x=b.getValueOnIndex(b.data.targets[0].values,v),y=b.getValueOnIndex(b.data.targets[0].values,v+w),z=b.x.domain(),A=i.duration||s,B=i.done||function(){},C=b.generateWait(),D=b.xgrid||d.selectAll([]),E=b.xgridLines||d.selectAll([]),F=b.mainRegion||d.selectAll([]),G=b.mainText||d.selectAll([]),H=b.mainBar||d.selectAll([]),I=b.mainLine||d.selectAll([]),J=b.mainArea||d.selectAll([]),K=b.mainCircle||d.selectAll([]);b.flowing=!0,b.data.targets.forEach(function(a){a.values.splice(0,w)}),g=b.updateXDomain(h,!0,!0),b.updateXGrid&&b.updateXGrid(!0),i.orgDataCount?e=1===i.orgDataCount||x.x===y.x?b.x(z[0])-b.x(g[0]):b.isTimeSeries()?b.x(z[0])-b.x(g[0]):b.x(x.x)-b.x(y.x):1!==b.data.targets[0].values.length?e=b.x(z[0])-b.x(g[0]):b.isTimeSeries()?(x=b.getValueOnIndex(b.data.targets[0].values,0),y=b.getValueOnIndex(b.data.targets[0].values,b.data.targets[0].values.length-1),e=b.x(x.x)-b.x(y.x)):e=u(g)/2,t=u(z)/u(g),f="translate("+e+",0) scale("+t+",1)",b.hideXGridFocus(),b.hideTooltip(),d.transition().ease("linear").duration(A).each(function(){C.add(b.axes.x.transition().call(b.xAxis)),C.add(H.transition().attr("transform",f)),C.add(I.transition().attr("transform",f)),C.add(J.transition().attr("transform",f)),C.add(K.transition().attr("transform",f)),C.add(G.transition().attr("transform",f)),C.add(F.filter(b.isRegionOnX).transition().attr("transform",f)),C.add(D.transition().attr("transform",f)),C.add(E.transition().attr("transform",f))
-}).call(C,function(){var a,d=[],e=[],f=[];if(w){for(a=0;w>a;a++)d.push("."+m.shape+"-"+(v+a)),e.push("."+m.text+"-"+(v+a)),f.push("."+m.eventRect+"-"+(v+a));b.svg.selectAll("."+m.shapes).selectAll(d).remove(),b.svg.selectAll("."+m.texts).selectAll(e).remove(),b.svg.selectAll("."+m.eventRects).selectAll(f).remove(),b.svg.select("."+m.xgrid).remove()}D.attr("transform",null).attr(b.xgridAttr),E.attr("transform",null),E.select("line").attr("x1",c.axis_rotated?0:p).attr("x2",c.axis_rotated?b.width:p),E.select("text").attr("x",c.axis_rotated?b.width:0).attr("y",p),H.attr("transform",null).attr("d",j),I.attr("transform",null).attr("d",k),J.attr("transform",null).attr("d",l),K.attr("transform",null).attr("cx",n).attr("cy",o),G.attr("transform",null).attr("x",q).attr("y",r).style("fill-opacity",b.opacityForText.bind(b)),F.attr("transform",null),F.select("rect").filter(b.isRegionOnX).attr("x",b.regionX.bind(b)).attr("width",b.regionWidth.bind(b)),c.interaction_enabled&&b.redrawEventRect(),B(),b.flowing=!1})}},h.selected=function(a){var b=this.internal,c=b.d3;return c.merge(b.main.selectAll("."+m.shapes+b.getTargetSelectorSuffix(a)).selectAll("."+m.shape).filter(function(){return c.select(this).classed(m.SELECTED)}).map(function(a){return a.map(function(a){var b=a.__data__;return b.data?b.data:b})}))},h.select=function(a,b,c){var d=this.internal,e=d.d3,f=d.config;f.data_selection_enabled&&d.main.selectAll("."+m.shapes).selectAll("."+m.shape).each(function(g,h){var i=e.select(this),j=g.data?g.data.id:g.id,k=d.getToggle(this,g).bind(d),l=f.data_selection_grouped||!a||a.indexOf(j)>=0,n=!b||b.indexOf(h)>=0,o=i.classed(m.SELECTED);i.classed(m.line)||i.classed(m.area)||(l&&n?f.data_selection_isselectable(g)&&!o&&k(!0,i.classed(m.SELECTED,!0),g,h):r(c)&&c&&o&&k(!1,i.classed(m.SELECTED,!1),g,h))})},h.unselect=function(a,b){var c=this.internal,d=c.d3,e=c.config;e.data_selection_enabled&&c.main.selectAll("."+m.shapes).selectAll("."+m.shape).each(function(f,g){var h=d.select(this),i=f.data?f.data.id:f.id,j=c.getToggle(this,f).bind(c),k=e.data_selection_grouped||!a||a.indexOf(i)>=0,l=!b||b.indexOf(g)>=0,n=h.classed(m.SELECTED);h.classed(m.line)||h.classed(m.area)||k&&l&&e.data_selection_isselectable(f)&&n&&j(!1,h.classed(m.SELECTED,!1),f,g)})},h.transform=function(a,b){var c=this.internal,d=["pie","donut"].indexOf(a)>=0?{withTransform:!0}:null;c.transformTo(b,a,d)},i.transformTo=function(a,b,c){var d=this,e=!d.hasArcType(),f=c||{withTransitionForAxis:e};f.withTransitionForTransform=!1,d.transiting=!1,d.setTargetType(a,b),d.updateTargets(d.data.targets),d.updateAndRedraw(f)},h.groups=function(a){var b=this.internal,c=b.config;return q(a)?c.data_groups:(c.data_groups=a,b.redraw(),c.data_groups)},h.xgrids=function(a){var b=this.internal,c=b.config;return a?(c.grid_x_lines=a,b.redrawWithoutRescale(),c.grid_x_lines):c.grid_x_lines},h.xgrids.add=function(a){var b=this.internal;return this.xgrids(b.config.grid_x_lines.concat(a?a:[]))},h.xgrids.remove=function(a){var b=this.internal;b.removeGridLines(a,!0)},h.ygrids=function(a){var b=this.internal,c=b.config;return a?(c.grid_y_lines=a,b.redrawWithoutRescale(),c.grid_y_lines):c.grid_y_lines},h.ygrids.add=function(a){var b=this.internal;return this.ygrids(b.config.grid_y_lines.concat(a?a:[]))},h.ygrids.remove=function(a){var b=this.internal;b.removeGridLines(a,!1)},h.regions=function(a){var b=this.internal,c=b.config;return a?(c.regions=a,b.redrawWithoutRescale(),c.regions):c.regions},h.regions.add=function(a){var b=this.internal,c=b.config;return a?(c.regions=c.regions.concat(a),b.redrawWithoutRescale(),c.regions):c.regions},h.regions.remove=function(a){var b,c,d,e=this.internal,f=e.config;return a=a||{},b=e.getOption(a,"duration",f.transition_duration),c=e.getOption(a,"classes",[m.region]),d=e.main.select("."+m.regions).selectAll(c.map(function(a){return"."+a})),(b?d.transition().duration(b):d).style("opacity",0).remove(),f.regions=f.regions.filter(function(a){var b=!1;return a["class"]?(a["class"].split(" ").forEach(function(a){c.indexOf(a)>=0&&(b=!0)}),!b):!0}),f.regions},h.data=function(a){var b=this.internal.data.targets;return"undefined"==typeof a?b:b.filter(function(b){return[].concat(a).indexOf(b.id)>=0})},h.data.shown=function(a){return this.internal.filterTargetsToShow(this.data(a))},h.data.values=function(a){var b,c=null;return a&&(b=this.data(a),c=b[0]?b[0].values.map(function(a){return a.value}):null),c},h.data.names=function(a){return this.internal.clearLegendItemTextBoxCache(),this.internal.updateDataAttributes("names",a)},h.data.colors=function(a){return this.internal.updateDataAttributes("colors",a)},h.data.axes=function(a){return this.internal.updateDataAttributes("axes",a)},h.category=function(a,b){var c=this.internal,d=c.config;return arguments.length>1&&(d.axis_x_categories[a]=b,c.redraw()),d.axis_x_categories[a]},h.categories=function(a){var b=this.internal,c=b.config;return arguments.length?(c.axis_x_categories=a,b.redraw(),c.axis_x_categories):c.axis_x_categories},h.color=function(a){var b=this.internal;return b.color(a)},h.x=function(a){var b=this.internal;return arguments.length&&(b.updateTargetX(b.data.targets,a),b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),b.data.xs},h.xs=function(a){var b=this.internal;return arguments.length&&(b.updateTargetXs(b.data.targets,a),b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),b.data.xs},h.axis=function(){},h.axis.labels=function(a){var b=this.internal;arguments.length&&(Object.keys(a).forEach(function(c){b.axis.setLabelText(c,a[c])}),b.axis.updateLabels())},h.axis.max=function(a){var b=this.internal,c=b.config;return arguments.length?("object"==typeof a?(n(a.x)&&(c.axis_x_max=a.x),n(a.y)&&(c.axis_y_max=a.y),n(a.y2)&&(c.axis_y2_max=a.y2)):c.axis_y_max=c.axis_y2_max=a,void b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})):{x:c.axis_x_max,y:c.axis_y_max,y2:c.axis_y2_max}},h.axis.min=function(a){var b=this.internal,c=b.config;return arguments.length?("object"==typeof a?(n(a.x)&&(c.axis_x_min=a.x),n(a.y)&&(c.axis_y_min=a.y),n(a.y2)&&(c.axis_y2_min=a.y2)):c.axis_y_min=c.axis_y2_min=a,void b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})):{x:c.axis_x_min,y:c.axis_y_min,y2:c.axis_y2_min}},h.axis.range=function(a){return arguments.length?(r(a.max)&&this.axis.max(a.max),void(r(a.min)&&this.axis.min(a.min))):{max:this.axis.max(),min:this.axis.min()}},h.legend=function(){},h.legend.show=function(a){var b=this.internal;b.showLegend(b.mapToTargetIds(a)),b.updateAndRedraw({withLegend:!0})},h.legend.hide=function(a){var b=this.internal;b.hideLegend(b.mapToTargetIds(a)),b.updateAndRedraw({withLegend:!0})},h.resize=function(a){var b=this.internal,c=b.config;c.size_width=a?a.width:null,c.size_height=a?a.height:null,this.flush()},h.flush=function(){var a=this.internal;a.updateAndRedraw({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},h.destroy=function(){var b=this.internal;return a.clearInterval(b.intervalForObserveInserted),a.onresize=null,b.selectChart.classed("c3",!1).html(""),Object.keys(b).forEach(function(a){b[a]=null}),null},h.tooltip=function(){},h.tooltip.show=function(a){var b,c,d=this.internal;a.mouse&&(c=a.mouse),a.data?d.isMultipleX()?(c=[d.x(a.data.x),d.getYScale(a.data.id)(a.data.value)],b=null):b=n(a.data.index)?a.data.index:d.getIndexByX(a.data.x):"undefined"!=typeof a.x?b=d.getIndexByX(a.x):"undefined"!=typeof a.index&&(b=a.index),d.dispatchEvent("mouseover",b,c),d.dispatchEvent("mousemove",b,c)},h.tooltip.hide=function(){this.internal.dispatchEvent("mouseout",0)};var A;Function.prototype.bind=Function.prototype.bind||function(a){var b=this;return function(){return b.apply(a,arguments)}},"function"==typeof define&&define.amd?define("c3",["d3"],k):"undefined"!=typeof exports&&"undefined"!=typeof module?module.exports=k:a.c3=k}(window);
\ No newline at end of file
diff --git a/x2engine/js/ckeditor/config.js b/x2engine/js/ckeditor/config.js
index 69b378f93..0820f8b43 100644
--- a/x2engine/js/ckeditor/config.js
+++ b/x2engine/js/ckeditor/config.js
@@ -19,7 +19,7 @@ CKEDITOR.editorConfig = function(config)
config.resize_enabled = true;
config.removePlugins = 'autogrow,showblocks,elementspath,liststyle,tabletools,contextmenu';
- config.extraPlugins = 'insertattributes,confighelper,mediaSelector';
+ config.extraPlugins = 'insertattributes,confighelper,mediaSelector,sharedspace';
config.disableNativeSpellChecker = false; // allow use of browser's native spellchecker
@@ -68,6 +68,17 @@ CKEDITOR.editorConfig = function(config)
];
-
-
+
+ config.toolbar_MyGrapesToolbar = [
+ {name: 'insertAttributes',items:['Attribute']},
+ {name: 'clipboard',items: ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Undo','Redo']},
+ {name: 'links',items: ['Link','Unlink','Anchor']},
+ {name: 'insert',items: ['Table','HorizontalRule','SpecialChar']},
+ {name: 'colors',items: ['TextColor','BGColor']},
+ '/',
+ {name: 'basicstyles',items: ['Bold','Italic','Underline','Strike','Subscript','Superscript','-','RemoveFormat']},
+ {name: 'styles',items: ['Font','FontSize']},
+ {name: 'paragraph',items: ['NumberedList','BulletedList','-','Outdent','Indent','Blockquote','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock']}
+ ];
+
};
diff --git a/x2engine/js/ckeditor/plugins/insertattributes/plugin.js b/x2engine/js/ckeditor/plugins/insertattributes/plugin.js
index 093033192..0029c3ef6 100644
--- a/x2engine/js/ckeditor/plugins/insertattributes/plugin.js
+++ b/x2engine/js/ckeditor/plugins/insertattributes/plugin.js
@@ -39,8 +39,7 @@
CKEDITOR.plugins.add('insertattributes',{
requires:['richcombo'],
init:function(editor) {
-
- if(editor.config.insertableAttributes.length < 1)
+ if(editor.config.insertableAttributes && editor.config.insertableAttributes.length < 1)
return;
editor.addCommand('insertAttribute',{
diff --git a/x2engine/js/ckeditor/plugins/sharedspace/plugin.js b/x2engine/js/ckeditor/plugins/sharedspace/plugin.js
new file mode 100644
index 000000000..919398caa
--- /dev/null
+++ b/x2engine/js/ckeditor/plugins/sharedspace/plugin.js
@@ -0,0 +1,148 @@
+/**
+ * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
+ */
+
+( function() {
+
+ 'use strict';
+
+ var containerTpl = CKEDITOR.addTemplate( 'sharedcontainer', '' );
+
+ CKEDITOR.plugins.add( 'sharedspace', {
+ init: function( editor ) {
+ // Create toolbars on #loaded (like themed creator), but do that
+ // with higher priority to block the default scenario.
+ editor.on( 'loaded', function() {
+ var spaces = editor.config.sharedSpaces;
+
+ if ( spaces ) {
+ for ( var spaceName in spaces )
+ create( editor, spaceName, spaces[ spaceName ] );
+ }
+ }, null, null, 9 );
+ }
+ } );
+
+ function create( editor, spaceName, target ) {
+ var innerHtml, space;
+
+ if ( typeof target == 'string' ) {
+ target = CKEDITOR.document.getById( target );
+ } else {
+ target = new CKEDITOR.dom.element( target );
+ }
+
+ if ( target ) {
+ // Have other plugins filling the space.
+ innerHtml = editor.fire( 'uiSpace', { space: spaceName, html: '' } ).html;
+
+ if ( innerHtml ) {
+ // Block the uiSpace handling by others (e.g. themed-ui).
+ editor.on( 'uiSpace', function( ev ) {
+ if ( ev.data.space == spaceName )
+ ev.cancel();
+ }, null, null, 1 ); // Hi-priority
+
+ // Inject the space into the target.
+ space = target.append( CKEDITOR.dom.element.createFromHtml( containerTpl.output( {
+ id: editor.id,
+ name: editor.name,
+ langDir: editor.lang.dir,
+ langCode: editor.langCode,
+ space: spaceName,
+ spaceId: editor.ui.spaceId( spaceName ),
+ content: innerHtml
+ } ) ) );
+
+ // Only the first container starts visible. Others get hidden.
+ if ( target.getCustomData( 'cke_hasshared' ) )
+ space.hide();
+ else
+ target.setCustomData( 'cke_hasshared', 1 );
+
+ // There's no need for the space to be selectable.
+ space.unselectable();
+
+ // Prevent clicking on non-buttons area of the space from blurring editor.
+ space.on( 'mousedown', function( evt ) {
+ evt = evt.data;
+ if ( !evt.getTarget().hasAscendant( 'a', 1 ) )
+ evt.preventDefault();
+ } );
+
+ // Register this UI space to the focus manager.
+ editor.focusManager.add( space, 1 );
+
+ // When the editor gets focus, show the space container, hiding others.
+ editor.on( 'focus', function() {
+ for ( var i = 0, sibling, children = target.getChildren(); ( sibling = children.getItem( i ) ); i++ ) {
+ if ( sibling.type == CKEDITOR.NODE_ELEMENT &&
+ !sibling.equals( space ) &&
+ sibling.hasClass( 'cke_shared' ) ) {
+ sibling.hide();
+ }
+ }
+
+ space.show();
+ } );
+
+ editor.on( 'destroy', function() {
+ space.remove();
+ } );
+ }
+ }
+ }
+} )();
+
+/**
+ * Makes it possible to place some of the editor UI blocks, like the toolbar
+ * and the elements path, in any element on the page.
+ *
+ * The elements used to store the UI blocks can be shared among several editor
+ * instances. In that case only the blocks relevant to the active editor instance
+ * will be displayed.
+ *
+ * Read more in the {@glink guide/dev_sharedspace documentation}
+ * and see the {@glink examples/sharedspace example}.
+ *
+ * // Place the toolbar inside the element with an ID of "someElementId" and the
+ * // elements path into the element with an ID of "anotherId".
+ * config.sharedSpaces = {
+ * top: 'someElementId',
+ * bottom: 'anotherId'
+ * };
+ *
+ * // Place the toolbar inside the element with an ID of "someElementId". The
+ * // elements path will remain attached to the editor UI.
+ * config.sharedSpaces = {
+ * top: 'someElementId'
+ * };
+ *
+ * // (Since 4.5)
+ * // Place the toolbar inside a DOM element passed by a reference. The
+ * // elements path will remain attached to the editor UI.
+ * var htmlElement = document.getElementById( 'someElementId' );
+ * config.sharedSpaces = {
+ * top: htmlElement
+ * };
+ *
+ * **Note:** The [Maximize](https://ckeditor.com/cke4/addon/maximize) and [Editor Resize](https://ckeditor.com/cke4/addon/resize)
+ * features are not supported in the shared space environment and should be disabled in this context.
+ *
+ * config.removePlugins = 'maximize,resize';
+ *
+ * @cfg {Object} [sharedSpaces]
+ * @member CKEDITOR.config
+ */
diff --git a/x2engine/js/ckeditor/plugins/sharedspace/samples/sharedspace.html b/x2engine/js/ckeditor/plugins/sharedspace/samples/sharedspace.html
new file mode 100644
index 000000000..a4bd2b5cc
--- /dev/null
+++ b/x2engine/js/ckeditor/plugins/sharedspace/samples/sharedspace.html
@@ -0,0 +1,122 @@
+
+
+
+
+
+ Shared-Space Plugin — CKEditor Sample
+
+
+
+
+
+
+
+
+ CKEditor Samples » Sharing Toolbar and Bottom-bar Spaces
+
+
+
+
+ This sample shows several editor instances that share the very same spaces for both the toolbar and the bottom bar.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Integer condimentum sit amet
+
+
+ Aenean nonummy a, mattis varius. Cras aliquet.
+ Praesent magna non mattis ac, rhoncus nunc , rhoncus eget, cursus pulvinar mollis.
+
Proin id nibh. Sed eu libero posuere sed, lectus. Phasellus dui gravida gravida feugiat mattis ac, felis.
+
Integer condimentum sit amet, tempor elit odio, a dolor non ante at sapien. Sed ac lectus. Nulla ligula quis eleifend mi, id leo velit pede cursus arcu id nulla ac lectus. Phasellus vestibulum. Nunc viverra enim quis diam.
+
+
+
+ Praesent wisi accumsan sit amet nibh
+
+
Donec ullamcorper, risus tortor, pretium porttitor. Morbi quam quis lectus non leo.
+
Integer faucibus scelerisque. Proin faucibus at, aliquet vulputate, odio at eros. Fusce gravida, erat vitae augue . Fusce urna fringilla gravida.
+
In hac habitasse platea dictumst. Praesent wisi accumsan sit amet nibh. Maecenas orci luctus a, lacinia quam sem, posuere commodo, odio condimentum tempor, pede semper risus. Suspendisse pede. In hac habitasse platea dictumst. Nam sed laoreet sit amet erat. Integer.
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/x2engine/js/codeEditor.js b/x2engine/js/codeEditor.js
deleted file mode 100644
index b912eed89..000000000
--- a/x2engine/js/codeEditor.js
+++ /dev/null
@@ -1,201 +0,0 @@
-/***********************************************************************************
- * X2Engine Open Source Edition is a customer relationship management program developed by
- * X2 Engine, Inc. Copyright (C) 2011-2019 X2 Engine Inc.
- *
- * This program is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Affero General Public License version 3 as published by the
- * Free Software Foundation with the addition of the following permission added
- * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
- * IN WHICH THE COPYRIGHT IS OWNED BY X2ENGINE, X2ENGINE DISCLAIMS THE WARRANTY
- * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
- * details.
- *
- * You should have received a copy of the GNU Affero General Public License along with
- * this program; if not, see http://www.gnu.org/licenses or write to the Free
- * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301 USA.
- *
- * You can contact X2Engine, Inc. P.O. Box 610121, Redwood City,
- * California 94061, USA. or at email address contact@x2engine.com.
- *
- * The interactive user interfaces in modified source and object code versions
- * of this program must display Appropriate Legal Notices, as required under
- * Section 5 of the GNU Affero General Public License version 3.
- *
- * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
- * these Appropriate Legal Notices must retain the display of the "Powered by
- * X2 Engine" logo. If the display of the logo is not reasonably feasible for
- * technical reasons, the Appropriate Legal Notices must display the words
- * "Powered by X2 Engine".
- **********************************************************************************/
-
-
-
-
-/**
- * @edition:ent
- */
-
-if (typeof x2 === "undefined")
- x2 = {};
-if (typeof x2.codeEditor === "undefined")
- x2.codeEditor = {};
-
-x2.codeEditor.createFile = function() {
- var filename = prompt(x2.codeEditor.translations["enter filename"]);
- if (filename) {
- var throbber = auxlib.pageLoading();
- $.ajax({
- type: "POST",
- data: {
- operation: "create",
- filename: filename,
- },
- error: function(data) {
- alert(data.responseText);
- throbber.remove();
- },
- success: function(data) {
- // Refresh filetree
- var browser = $('#fileBrowser');
- browser.empty();
- $('', {id: 'filetree', 'class': 'filetree'}).appendTo(browser).treeview({
- url: x2.codeEditor.fileTreeUrl,
- persist: 'cookie',
- id: 'filetree',
- animated: 'fast'
- });
- throbber.remove();
- },
- });
- }
-}
-
-x2.codeEditor.lint = function() {
- if (typeof x2.codeEditor.currentFile !== "undefined") {
- var throbber = auxlib.pageLoading();
- $.ajax({
- type: "POST",
- data: {
- operation: "lint",
- filename: x2.codeEditor.currentFile,
- },
- error: function(data) {
- alert(data.responseText);
- },
- complete: function() {
- throbber.remove();
- }
- });
- } else {
- alert(x2.codeEditor.translations["no source file"]);
- }
-}
-
-x2.codeEditor.saveSource = function() {
- if (typeof x2.codeEditor.currentFile !== "undefined") {
- var throbber = auxlib.pageLoading();
- var contents = window.codeEditor.getData();
- $.ajax({
- type: "POST",
- data: {
- operation: "save",
- filename: x2.codeEditor.currentFile,
- contents: contents
- },
- error: function(data) {
- alert(data.responseText);
- },
- complete: function() {
- throbber.remove();
- }
- });
- } else {
- alert(x2.codeEditor.translations["no source file"]);
- }
-}
-
-x2.codeEditor.instantiateCodeEditor = function(insertableAttributes) {
- var insertableAttributes = typeof insertableAttributes === "undefined" ?
- x2.insertableAttributes : insertableAttributes;
-
- window.codeEditor = createCKEditor("input",{
- // insertableAttributes: insertableAttributes,
- toolbar:"MyCodeEditorToolbar",
- fullPage:true,
- startupMode: "source",
- autoParagraph:false,
- htmlEncodeOutput: false,
- entities: false,
- toolbarCanCollapse: false,
- height:600
- }, x2.codeEditor.finishSetup);
- // Allow PHP tags in CKEditor
- //window.codeEditor.config.protectedSource.push(/<\?php[\s\S]*?\?>/g);
- window.codeEditor.config.protectedSource.push(/<\?php[\s\S]+?(\?>)?/g);
-}
-
-x2.codeEditor.finishSetup = function() {
- var themePreference = $.cookie("x2-codeEditor-keyMap");
- if (themePreference && themePreference === "vim")
- $('.cke_button__togglevimbindings_icon').click();
-
- var themePreference = $.cookie("x2-codeEditor-theme");
- if (themePreference && themePreference === "seti")
- $('.cke_button__toggledarktheme_icon').click();
-
- // Set up autolint
- if($.browser.msie)
- return;
-
- // lint after 1.5 seconds when the user is done typing
- window.codeEditor.document.on("keyup",function(e) {
- clearTimeout(lintingTimer);
- lintingTimer = setTimeout(x2.codeEditor.lint, 1500);
- });
- window.codeEditor.on("saveSnapshot",function(e) {
- clearTimeout(lintingTimer);
- lintingTimer = setTimeout(x2.codeEditor.lint, 1500);
- });
- window.codeEditor.document.on("keydown",function(){ clearTimeout(lintingTimer); });
-}
-
-
-x2.codeEditor.toggleDarkTheme = function() {
- var editor = $('.CodeMirror')[0].CodeMirror;
- if (typeof x2.codeEditor.theme === 'undefined' || x2.codeEditor.theme === 'default') {
- editor.setOption('theme', 'seti');
- x2.codeEditor.theme = 'seti';
- $.cookie('x2-codeEditor-theme', 'seti');
- } else {
- editor.setOption('theme', 'default');
- x2.codeEditor.theme = 'default';
- $.cookie('x2-codeEditor-theme', 'default');
- }
-}
-
-x2.codeEditor.setMode = function(mode) {
- var allowedModes = ['application/x-httpd-php', 'javascript', 'sql', 'css', 'sass'];
- if ($.inArray(mode, allowedModes) !== -1) {
- var editor = $('.CodeMirror')[0].CodeMirror;
- editor.setOption('mode', mode);
- }
-}
-
-x2.codeEditor.toggleVimBindings = function() {
- var editor = $('.CodeMirror')[0].CodeMirror;
- var keyMap = editor.getOption('keyMap');
- if (keyMap === 'vim') {
- editor.setOption('keyMap', 'default');
- $.cookie('x2-codeEditor-keyMap', 'default');
- return 'default';
- } else {
- editor.setOption('keyMap', 'vim');
- $.cookie('x2-codeEditor-keyMap', 'vim');
- return 'vim';
- }
-}
diff --git a/x2engine/js/d3/LICENSE b/x2engine/js/d3/LICENSE
index 83013469b..1d9d875ed 100644
--- a/x2engine/js/d3/LICENSE
+++ b/x2engine/js/d3/LICENSE
@@ -1,8 +1,8 @@
-Copyright (c) 2010-2014, Michael Bostock
+Copyright 2010-2017 Mike Bostock
All rights reserved.
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
@@ -11,16 +11,17 @@ modification, are permitted provided that the following conditions are met:
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
-* The name Michael Bostock may not be used to endorse or promote products
- derived from this software without specific prior written permission.
+* Neither the name of the author nor the names of contributors may be used to
+ endorse or promote products derived from this software without specific prior
+ written permission.
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/x2engine/js/d3/d3.js b/x2engine/js/d3/d3.js
index 0c1c89879..a7ca279e6 100644
--- a/x2engine/js/d3/d3.js
+++ b/x2engine/js/d3/d3.js
@@ -1,9215 +1,18318 @@
-!function() {
- var d3 = {
- version: "3.4.13"
- };
- if (!Date.now) Date.now = function() {
- return +new Date();
- };
- var d3_arraySlice = [].slice, d3_array = function(list) {
- return d3_arraySlice.call(list);
- };
- var d3_document = document, d3_documentElement = d3_document.documentElement, d3_window = window;
- try {
- d3_array(d3_documentElement.childNodes)[0].nodeType;
- } catch (e) {
- d3_array = function(list) {
- var i = list.length, array = new Array(i);
- while (i--) array[i] = list[i];
- return array;
- };
- }
- try {
- d3_document.createElement("div").style.setProperty("opacity", 0, "");
- } catch (error) {
- var d3_element_prototype = d3_window.Element.prototype, d3_element_setAttribute = d3_element_prototype.setAttribute, d3_element_setAttributeNS = d3_element_prototype.setAttributeNS, d3_style_prototype = d3_window.CSSStyleDeclaration.prototype, d3_style_setProperty = d3_style_prototype.setProperty;
- d3_element_prototype.setAttribute = function(name, value) {
- d3_element_setAttribute.call(this, name, value + "");
- };
- d3_element_prototype.setAttributeNS = function(space, local, value) {
- d3_element_setAttributeNS.call(this, space, local, value + "");
- };
- d3_style_prototype.setProperty = function(name, value, priority) {
- d3_style_setProperty.call(this, name, value + "", priority);
- };
- }
- d3.ascending = d3_ascending;
- function d3_ascending(a, b) {
- return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
- }
- d3.descending = function(a, b) {
- return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
- };
- d3.min = function(array, f) {
- var i = -1, n = array.length, a, b;
- if (arguments.length === 1) {
- while (++i < n && !((a = array[i]) != null && a <= a)) a = undefined;
- while (++i < n) if ((b = array[i]) != null && a > b) a = b;
- } else {
- while (++i < n && !((a = f.call(array, array[i], i)) != null && a <= a)) a = undefined;
- while (++i < n) if ((b = f.call(array, array[i], i)) != null && a > b) a = b;
- }
- return a;
- };
- d3.max = function(array, f) {
- var i = -1, n = array.length, a, b;
- if (arguments.length === 1) {
- while (++i < n && !((a = array[i]) != null && a <= a)) a = undefined;
- while (++i < n) if ((b = array[i]) != null && b > a) a = b;
- } else {
- while (++i < n && !((a = f.call(array, array[i], i)) != null && a <= a)) a = undefined;
- while (++i < n) if ((b = f.call(array, array[i], i)) != null && b > a) a = b;
- }
- return a;
- };
- d3.extent = function(array, f) {
- var i = -1, n = array.length, a, b, c;
- if (arguments.length === 1) {
- while (++i < n && !((a = c = array[i]) != null && a <= a)) a = c = undefined;
- while (++i < n) if ((b = array[i]) != null) {
- if (a > b) a = b;
- if (c < b) c = b;
+// https://d3js.org v5.9.7 Copyright 2019 Mike Bostock
+(function (global, factory) {
+typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
+typeof define === 'function' && define.amd ? define(['exports'], factory) :
+(factory((global.d3 = global.d3 || {})));
+}(this, (function (exports) { 'use strict';
+
+var version = "5.9.7";
+
+function ascending(a, b) {
+ return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
+}
+
+function bisector(compare) {
+ if (compare.length === 1) compare = ascendingComparator(compare);
+ return {
+ left: function(a, x, lo, hi) {
+ if (lo == null) lo = 0;
+ if (hi == null) hi = a.length;
+ while (lo < hi) {
+ var mid = lo + hi >>> 1;
+ if (compare(a[mid], x) < 0) lo = mid + 1;
+ else hi = mid;
}
- } else {
- while (++i < n && !((a = c = f.call(array, array[i], i)) != null && a <= a)) a = undefined;
- while (++i < n) if ((b = f.call(array, array[i], i)) != null) {
- if (a > b) a = b;
- if (c < b) c = b;
+ return lo;
+ },
+ right: function(a, x, lo, hi) {
+ if (lo == null) lo = 0;
+ if (hi == null) hi = a.length;
+ while (lo < hi) {
+ var mid = lo + hi >>> 1;
+ if (compare(a[mid], x) > 0) hi = mid;
+ else lo = mid + 1;
}
+ return lo;
}
- return [ a, c ];
- };
- function d3_number(x) {
- return x === null ? NaN : +x;
- }
- function d3_numeric(x) {
- return !isNaN(x);
- }
- d3.sum = function(array, f) {
- var s = 0, n = array.length, a, i = -1;
- if (arguments.length === 1) {
- while (++i < n) if (d3_numeric(a = +array[i])) s += a;
- } else {
- while (++i < n) if (d3_numeric(a = +f.call(array, array[i], i))) s += a;
- }
- return s;
- };
- d3.mean = function(array, f) {
- var s = 0, n = array.length, a, i = -1, j = n;
- if (arguments.length === 1) {
- while (++i < n) if (d3_numeric(a = d3_number(array[i]))) s += a; else --j;
- } else {
- while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) s += a; else --j;
- }
- return j ? s / j : undefined;
};
- d3.quantile = function(values, p) {
- var H = (values.length - 1) * p + 1, h = Math.floor(H), v = +values[h - 1], e = H - h;
- return e ? v + e * (values[h] - v) : v;
+}
+
+function ascendingComparator(f) {
+ return function(d, x) {
+ return ascending(f(d), x);
};
- d3.median = function(array, f) {
- var numbers = [], n = array.length, a, i = -1;
- if (arguments.length === 1) {
- while (++i < n) if (d3_numeric(a = d3_number(array[i]))) numbers.push(a);
- } else {
- while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) numbers.push(a);
+}
+
+var ascendingBisect = bisector(ascending);
+var bisectRight = ascendingBisect.right;
+var bisectLeft = ascendingBisect.left;
+
+function pairs(array, f) {
+ if (f == null) f = pair;
+ var i = 0, n = array.length - 1, p = array[0], pairs = new Array(n < 0 ? 0 : n);
+ while (i < n) pairs[i] = f(p, p = array[++i]);
+ return pairs;
+}
+
+function pair(a, b) {
+ return [a, b];
+}
+
+function cross(values0, values1, reduce) {
+ var n0 = values0.length,
+ n1 = values1.length,
+ values = new Array(n0 * n1),
+ i0,
+ i1,
+ i,
+ value0;
+
+ if (reduce == null) reduce = pair;
+
+ for (i0 = i = 0; i0 < n0; ++i0) {
+ for (value0 = values0[i0], i1 = 0; i1 < n1; ++i1, ++i) {
+ values[i] = reduce(value0, values1[i1]);
}
- return numbers.length ? d3.quantile(numbers.sort(d3_ascending), .5) : undefined;
- };
- function d3_bisector(compare) {
- return {
- left: function(a, x, lo, hi) {
- if (arguments.length < 3) lo = 0;
- if (arguments.length < 4) hi = a.length;
- while (lo < hi) {
- var mid = lo + hi >>> 1;
- if (compare(a[mid], x) < 0) lo = mid + 1; else hi = mid;
- }
- return lo;
- },
- right: function(a, x, lo, hi) {
- if (arguments.length < 3) lo = 0;
- if (arguments.length < 4) hi = a.length;
- while (lo < hi) {
- var mid = lo + hi >>> 1;
- if (compare(a[mid], x) > 0) hi = mid; else lo = mid + 1;
- }
- return lo;
- }
- };
}
- var d3_bisect = d3_bisector(d3_ascending);
- d3.bisectLeft = d3_bisect.left;
- d3.bisect = d3.bisectRight = d3_bisect.right;
- d3.bisector = function(f) {
- return d3_bisector(f.length === 1 ? function(d, x) {
- return d3_ascending(f(d), x);
- } : f);
- };
- d3.shuffle = function(array) {
- var m = array.length, t, i;
- while (m) {
- i = Math.random() * m-- | 0;
- t = array[m], array[m] = array[i], array[i] = t;
- }
- return array;
- };
- d3.permute = function(array, indexes) {
- var i = indexes.length, permutes = new Array(i);
- while (i--) permutes[i] = array[indexes[i]];
- return permutes;
- };
- d3.pairs = function(array) {
- var i = 0, n = array.length - 1, p0, p1 = array[0], pairs = new Array(n < 0 ? 0 : n);
- while (i < n) pairs[i] = [ p0 = p1, p1 = array[++i] ];
- return pairs;
- };
- d3.zip = function() {
- if (!(n = arguments.length)) return [];
- for (var i = -1, m = d3.min(arguments, d3_zipLength), zips = new Array(m); ++i < m; ) {
- for (var j = -1, n, zip = zips[i] = new Array(n); ++j < n; ) {
- zip[j] = arguments[j][i];
+
+ return values;
+}
+
+function descending(a, b) {
+ return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
+}
+
+function number(x) {
+ return x === null ? NaN : +x;
+}
+
+function variance(values, valueof) {
+ var n = values.length,
+ m = 0,
+ i = -1,
+ mean = 0,
+ value,
+ delta,
+ sum = 0;
+
+ if (valueof == null) {
+ while (++i < n) {
+ if (!isNaN(value = number(values[i]))) {
+ delta = value - mean;
+ mean += delta / ++m;
+ sum += delta * (value - mean);
}
}
- return zips;
- };
- function d3_zipLength(d) {
- return d.length;
}
- d3.transpose = function(matrix) {
- return d3.zip.apply(d3, matrix);
- };
- d3.keys = function(map) {
- var keys = [];
- for (var key in map) keys.push(key);
- return keys;
- };
- d3.values = function(map) {
- var values = [];
- for (var key in map) values.push(map[key]);
- return values;
- };
- d3.entries = function(map) {
- var entries = [];
- for (var key in map) entries.push({
- key: key,
- value: map[key]
- });
- return entries;
- };
- d3.merge = function(arrays) {
- var n = arrays.length, m, i = -1, j = 0, merged, array;
- while (++i < n) j += arrays[i].length;
- merged = new Array(j);
- while (--n >= 0) {
- array = arrays[n];
- m = array.length;
- while (--m >= 0) {
- merged[--j] = array[m];
- }
- }
- return merged;
- };
- var abs = Math.abs;
- d3.range = function(start, stop, step) {
- if (arguments.length < 3) {
- step = 1;
- if (arguments.length < 2) {
- stop = start;
- start = 0;
+
+ else {
+ while (++i < n) {
+ if (!isNaN(value = number(valueof(values[i], i, values)))) {
+ delta = value - mean;
+ mean += delta / ++m;
+ sum += delta * (value - mean);
}
}
- if ((stop - start) / step === Infinity) throw new Error("infinite range");
- var range = [], k = d3_range_integerScale(abs(step)), i = -1, j;
- start *= k, stop *= k, step *= k;
- if (step < 0) while ((j = start + step * ++i) > stop) range.push(j / k); else while ((j = start + step * ++i) < stop) range.push(j / k);
- return range;
- };
- function d3_range_integerScale(x) {
- var k = 1;
- while (x * k % 1) k *= 10;
- return k;
- }
- function d3_class(ctor, properties) {
- for (var key in properties) {
- Object.defineProperty(ctor.prototype, key, {
- value: properties[key],
- enumerable: false
- });
- }
- }
- d3.map = function(object) {
- var map = new d3_Map();
- if (object instanceof d3_Map) object.forEach(function(key, value) {
- map.set(key, value);
- }); else for (var key in object) map.set(key, object[key]);
- return map;
- };
- function d3_Map() {
- this._ = Object.create(null);
}
- var d3_map_proto = "__proto__", d3_map_zero = "\x00";
- d3_class(d3_Map, {
- has: d3_map_has,
- get: function(key) {
- return this._[d3_map_escape(key)];
- },
- set: function(key, value) {
- return this._[d3_map_escape(key)] = value;
- },
- remove: d3_map_remove,
- keys: d3_map_keys,
- values: function() {
- var values = [];
- for (var key in this._) values.push(this._[key]);
- return values;
- },
- entries: function() {
- var entries = [];
- for (var key in this._) entries.push({
- key: d3_map_unescape(key),
- value: this._[key]
- });
- return entries;
- },
- size: d3_map_size,
- empty: d3_map_empty,
- forEach: function(f) {
- for (var key in this._) f.call(this, d3_map_unescape(key), this._[key]);
+
+ if (m > 1) return sum / (m - 1);
+}
+
+function deviation(array, f) {
+ var v = variance(array, f);
+ return v ? Math.sqrt(v) : v;
+}
+
+function extent(values, valueof) {
+ var n = values.length,
+ i = -1,
+ value,
+ min,
+ max;
+
+ if (valueof == null) {
+ while (++i < n) { // Find the first comparable value.
+ if ((value = values[i]) != null && value >= value) {
+ min = max = value;
+ while (++i < n) { // Compare the remaining values.
+ if ((value = values[i]) != null) {
+ if (min > value) min = value;
+ if (max < value) max = value;
+ }
+ }
+ }
}
- });
- function d3_map_escape(key) {
- return (key += "") === d3_map_proto || key[0] === d3_map_zero ? d3_map_zero + key : key;
}
- function d3_map_unescape(key) {
- return (key += "")[0] === d3_map_zero ? key.slice(1) : key;
- }
- function d3_map_has(key) {
- return d3_map_escape(key) in this._;
- }
- function d3_map_remove(key) {
- return (key = d3_map_escape(key)) in this._ && delete this._[key];
- }
- function d3_map_keys() {
- var keys = [];
- for (var key in this._) keys.push(d3_map_unescape(key));
- return keys;
- }
- function d3_map_size() {
- var size = 0;
- for (var key in this._) ++size;
- return size;
- }
- function d3_map_empty() {
- for (var key in this._) return false;
- return true;
- }
- d3.nest = function() {
- var nest = {}, keys = [], sortKeys = [], sortValues, rollup;
- function map(mapType, array, depth) {
- if (depth >= keys.length) return rollup ? rollup.call(nest, array) : sortValues ? array.sort(sortValues) : array;
- var i = -1, n = array.length, key = keys[depth++], keyValue, object, setter, valuesByKey = new d3_Map(), values;
- while (++i < n) {
- if (values = valuesByKey.get(keyValue = key(object = array[i]))) {
- values.push(object);
- } else {
- valuesByKey.set(keyValue, [ object ]);
+
+ else {
+ while (++i < n) { // Find the first comparable value.
+ if ((value = valueof(values[i], i, values)) != null && value >= value) {
+ min = max = value;
+ while (++i < n) { // Compare the remaining values.
+ if ((value = valueof(values[i], i, values)) != null) {
+ if (min > value) min = value;
+ if (max < value) max = value;
+ }
}
}
- if (mapType) {
- object = mapType();
- setter = function(keyValue, values) {
- object.set(keyValue, map(mapType, values, depth));
- };
- } else {
- object = {};
- setter = function(keyValue, values) {
- object[keyValue] = map(mapType, values, depth);
- };
- }
- valuesByKey.forEach(setter);
- return object;
- }
- function entries(map, depth) {
- if (depth >= keys.length) return map;
- var array = [], sortKey = sortKeys[depth++];
- map.forEach(function(key, keyMap) {
- array.push({
- key: key,
- values: entries(keyMap, depth)
- });
- });
- return sortKey ? array.sort(function(a, b) {
- return sortKey(a.key, b.key);
- }) : array;
}
- nest.map = function(array, mapType) {
- return map(mapType, array, 0);
- };
- nest.entries = function(array) {
- return entries(map(d3.map, array, 0), 0);
- };
- nest.key = function(d) {
- keys.push(d);
- return nest;
- };
- nest.sortKeys = function(order) {
- sortKeys[keys.length - 1] = order;
- return nest;
- };
- nest.sortValues = function(order) {
- sortValues = order;
- return nest;
- };
- nest.rollup = function(f) {
- rollup = f;
- return nest;
- };
- return nest;
- };
- d3.set = function(array) {
- var set = new d3_Set();
- if (array) for (var i = 0, n = array.length; i < n; ++i) set.add(array[i]);
- return set;
- };
- function d3_Set() {
- this._ = Object.create(null);
}
- d3_class(d3_Set, {
- has: d3_map_has,
- add: function(key) {
- this._[d3_map_escape(key += "")] = true;
- return key;
- },
- remove: d3_map_remove,
- values: d3_map_keys,
- size: d3_map_size,
- empty: d3_map_empty,
- forEach: function(f) {
- for (var key in this._) f.call(this, d3_map_unescape(key));
- }
- });
- d3.behavior = {};
- d3.rebind = function(target, source) {
- var i = 1, n = arguments.length, method;
- while (++i < n) target[method = arguments[i]] = d3_rebind(target, source, source[method]);
- return target;
+
+ return [min, max];
+}
+
+var array = Array.prototype;
+
+var slice = array.slice;
+var map = array.map;
+
+function constant(x) {
+ return function() {
+ return x;
};
- function d3_rebind(target, source, method) {
- return function() {
- var value = method.apply(source, arguments);
- return value === source ? target : value;
- };
+}
+
+function identity(x) {
+ return x;
+}
+
+function sequence(start, stop, step) {
+ start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;
+
+ var i = -1,
+ n = Math.max(0, Math.ceil((stop - start) / step)) | 0,
+ range = new Array(n);
+
+ while (++i < n) {
+ range[i] = start + i * step;
}
- function d3_vendorSymbol(object, name) {
- if (name in object) return name;
- name = name.charAt(0).toUpperCase() + name.slice(1);
- for (var i = 0, n = d3_vendorPrefixes.length; i < n; ++i) {
- var prefixName = d3_vendorPrefixes[i] + name;
- if (prefixName in object) return prefixName;
- }
+
+ return range;
+}
+
+var e10 = Math.sqrt(50),
+ e5 = Math.sqrt(10),
+ e2 = Math.sqrt(2);
+
+function ticks(start, stop, count) {
+ var reverse,
+ i = -1,
+ n,
+ ticks,
+ step;
+
+ stop = +stop, start = +start, count = +count;
+ if (start === stop && count > 0) return [start];
+ if (reverse = stop < start) n = start, start = stop, stop = n;
+ if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) return [];
+
+ if (step > 0) {
+ start = Math.ceil(start / step);
+ stop = Math.floor(stop / step);
+ ticks = new Array(n = Math.ceil(stop - start + 1));
+ while (++i < n) ticks[i] = (start + i) * step;
+ } else {
+ start = Math.floor(start * step);
+ stop = Math.ceil(stop * step);
+ ticks = new Array(n = Math.ceil(start - stop + 1));
+ while (++i < n) ticks[i] = (start - i) / step;
}
- var d3_vendorPrefixes = [ "webkit", "ms", "moz", "Moz", "o", "O" ];
- function d3_noop() {}
- d3.dispatch = function() {
- var dispatch = new d3_dispatch(), i = -1, n = arguments.length;
- while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch);
- return dispatch;
- };
- function d3_dispatch() {}
- d3_dispatch.prototype.on = function(type, listener) {
- var i = type.indexOf("."), name = "";
- if (i >= 0) {
- name = type.slice(i + 1);
- type = type.slice(0, i);
+
+ if (reverse) ticks.reverse();
+
+ return ticks;
+}
+
+function tickIncrement(start, stop, count) {
+ var step = (stop - start) / Math.max(0, count),
+ power = Math.floor(Math.log(step) / Math.LN10),
+ error = step / Math.pow(10, power);
+ return power >= 0
+ ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power)
+ : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1);
+}
+
+function tickStep(start, stop, count) {
+ var step0 = Math.abs(stop - start) / Math.max(0, count),
+ step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)),
+ error = step0 / step1;
+ if (error >= e10) step1 *= 10;
+ else if (error >= e5) step1 *= 5;
+ else if (error >= e2) step1 *= 2;
+ return stop < start ? -step1 : step1;
+}
+
+function thresholdSturges(values) {
+ return Math.ceil(Math.log(values.length) / Math.LN2) + 1;
+}
+
+function histogram() {
+ var value = identity,
+ domain = extent,
+ threshold = thresholdSturges;
+
+ function histogram(data) {
+ var i,
+ n = data.length,
+ x,
+ values = new Array(n);
+
+ for (i = 0; i < n; ++i) {
+ values[i] = value(data[i], i, data);
}
- if (type) return arguments.length < 2 ? this[type].on(name) : this[type].on(name, listener);
- if (arguments.length === 2) {
- if (listener == null) for (type in this) {
- if (this.hasOwnProperty(type)) this[type].on(name, null);
- }
- return this;
+
+ var xz = domain(values),
+ x0 = xz[0],
+ x1 = xz[1],
+ tz = threshold(values, x0, x1);
+
+ // Convert number of thresholds into uniform thresholds.
+ if (!Array.isArray(tz)) {
+ tz = tickStep(x0, x1, tz);
+ tz = sequence(Math.ceil(x0 / tz) * tz, x1, tz); // exclusive
}
- };
- function d3_dispatch_event(dispatch) {
- var listeners = [], listenerByName = new d3_Map();
- function event() {
- var z = listeners, i = -1, n = z.length, l;
- while (++i < n) if (l = z[i].on) l.apply(this, arguments);
- return dispatch;
- }
- event.on = function(name, listener) {
- var l = listenerByName.get(name), i;
- if (arguments.length < 2) return l && l.on;
- if (l) {
- l.on = null;
- listeners = listeners.slice(0, i = listeners.indexOf(l)).concat(listeners.slice(i + 1));
- listenerByName.remove(name);
- }
- if (listener) listeners.push(listenerByName.set(name, {
- on: listener
- }));
- return dispatch;
- };
- return event;
- }
- d3.event = null;
- function d3_eventPreventDefault() {
- d3.event.preventDefault();
- }
- function d3_eventSource() {
- var e = d3.event, s;
- while (s = e.sourceEvent) e = s;
- return e;
- }
- function d3_eventDispatch(target) {
- var dispatch = new d3_dispatch(), i = 0, n = arguments.length;
- while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch);
- dispatch.of = function(thiz, argumentz) {
- return function(e1) {
- try {
- var e0 = e1.sourceEvent = d3.event;
- e1.target = target;
- d3.event = e1;
- dispatch[e1.type].apply(thiz, argumentz);
- } finally {
- d3.event = e0;
- }
- };
- };
- return dispatch;
- }
- d3.requote = function(s) {
- return s.replace(d3_requote_re, "\\$&");
- };
- var d3_requote_re = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;
- var d3_subclass = {}.__proto__ ? function(object, prototype) {
- object.__proto__ = prototype;
- } : function(object, prototype) {
- for (var property in prototype) object[property] = prototype[property];
- };
- function d3_selection(groups) {
- d3_subclass(groups, d3_selectionPrototype);
- return groups;
- }
- var d3_select = function(s, n) {
- return n.querySelector(s);
- }, d3_selectAll = function(s, n) {
- return n.querySelectorAll(s);
- }, d3_selectMatcher = d3_documentElement.matches || d3_documentElement[d3_vendorSymbol(d3_documentElement, "matchesSelector")], d3_selectMatches = function(n, s) {
- return d3_selectMatcher.call(n, s);
- };
- if (typeof Sizzle === "function") {
- d3_select = function(s, n) {
- return Sizzle(s, n)[0] || null;
- };
- d3_selectAll = Sizzle;
- d3_selectMatches = Sizzle.matchesSelector;
- }
- d3.selection = function() {
- return d3_selectionRoot;
- };
- var d3_selectionPrototype = d3.selection.prototype = [];
- d3_selectionPrototype.select = function(selector) {
- var subgroups = [], subgroup, subnode, group, node;
- selector = d3_selection_selector(selector);
- for (var j = -1, m = this.length; ++j < m; ) {
- subgroups.push(subgroup = []);
- subgroup.parentNode = (group = this[j]).parentNode;
- for (var i = -1, n = group.length; ++i < n; ) {
- if (node = group[i]) {
- subgroup.push(subnode = selector.call(node, node.__data__, i, j));
- if (subnode && "__data__" in node) subnode.__data__ = node.__data__;
- } else {
- subgroup.push(null);
- }
- }
+
+ // Remove any thresholds outside the domain.
+ var m = tz.length;
+ while (tz[0] <= x0) tz.shift(), --m;
+ while (tz[m - 1] > x1) tz.pop(), --m;
+
+ var bins = new Array(m + 1),
+ bin;
+
+ // Initialize bins.
+ for (i = 0; i <= m; ++i) {
+ bin = bins[i] = [];
+ bin.x0 = i > 0 ? tz[i - 1] : x0;
+ bin.x1 = i < m ? tz[i] : x1;
}
- return d3_selection(subgroups);
- };
- function d3_selection_selector(selector) {
- return typeof selector === "function" ? selector : function() {
- return d3_select(selector, this);
- };
- }
- d3_selectionPrototype.selectAll = function(selector) {
- var subgroups = [], subgroup, node;
- selector = d3_selection_selectorAll(selector);
- for (var j = -1, m = this.length; ++j < m; ) {
- for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
- if (node = group[i]) {
- subgroups.push(subgroup = d3_array(selector.call(node, node.__data__, i, j)));
- subgroup.parentNode = node;
- }
+
+ // Assign data to bins by value, ignoring any outside the domain.
+ for (i = 0; i < n; ++i) {
+ x = values[i];
+ if (x0 <= x && x <= x1) {
+ bins[bisectRight(tz, x, 0, m)].push(data[i]);
}
}
- return d3_selection(subgroups);
- };
- function d3_selection_selectorAll(selector) {
- return typeof selector === "function" ? selector : function() {
- return d3_selectAll(selector, this);
- };
+
+ return bins;
}
- var d3_nsPrefix = {
- svg: "http://www.w3.org/2000/svg",
- xhtml: "http://www.w3.org/1999/xhtml",
- xlink: "http://www.w3.org/1999/xlink",
- xml: "http://www.w3.org/XML/1998/namespace",
- xmlns: "http://www.w3.org/2000/xmlns/"
+
+ histogram.value = function(_) {
+ return arguments.length ? (value = typeof _ === "function" ? _ : constant(_), histogram) : value;
};
- d3.ns = {
- prefix: d3_nsPrefix,
- qualify: function(name) {
- var i = name.indexOf(":"), prefix = name;
- if (i >= 0) {
- prefix = name.slice(0, i);
- name = name.slice(i + 1);
- }
- return d3_nsPrefix.hasOwnProperty(prefix) ? {
- space: d3_nsPrefix[prefix],
- local: name
- } : name;
- }
+
+ histogram.domain = function(_) {
+ return arguments.length ? (domain = typeof _ === "function" ? _ : constant([_[0], _[1]]), histogram) : domain;
};
- d3_selectionPrototype.attr = function(name, value) {
- if (arguments.length < 2) {
- if (typeof name === "string") {
- var node = this.node();
- name = d3.ns.qualify(name);
- return name.local ? node.getAttributeNS(name.space, name.local) : node.getAttribute(name);
- }
- for (value in name) this.each(d3_selection_attr(value, name[value]));
- return this;
- }
- return this.each(d3_selection_attr(name, value));
+
+ histogram.thresholds = function(_) {
+ return arguments.length ? (threshold = typeof _ === "function" ? _ : Array.isArray(_) ? constant(slice.call(_)) : constant(_), histogram) : threshold;
};
- function d3_selection_attr(name, value) {
- name = d3.ns.qualify(name);
- function attrNull() {
- this.removeAttribute(name);
- }
- function attrNullNS() {
- this.removeAttributeNS(name.space, name.local);
- }
- function attrConstant() {
- this.setAttribute(name, value);
- }
- function attrConstantNS() {
- this.setAttributeNS(name.space, name.local, value);
- }
- function attrFunction() {
- var x = value.apply(this, arguments);
- if (x == null) this.removeAttribute(name); else this.setAttribute(name, x);
- }
- function attrFunctionNS() {
- var x = value.apply(this, arguments);
- if (x == null) this.removeAttributeNS(name.space, name.local); else this.setAttributeNS(name.space, name.local, x);
+
+ return histogram;
+}
+
+function threshold(values, p, valueof) {
+ if (valueof == null) valueof = number;
+ if (!(n = values.length)) return;
+ if ((p = +p) <= 0 || n < 2) return +valueof(values[0], 0, values);
+ if (p >= 1) return +valueof(values[n - 1], n - 1, values);
+ var n,
+ i = (n - 1) * p,
+ i0 = Math.floor(i),
+ value0 = +valueof(values[i0], i0, values),
+ value1 = +valueof(values[i0 + 1], i0 + 1, values);
+ return value0 + (value1 - value0) * (i - i0);
+}
+
+function freedmanDiaconis(values, min, max) {
+ values = map.call(values, number).sort(ascending);
+ return Math.ceil((max - min) / (2 * (threshold(values, 0.75) - threshold(values, 0.25)) * Math.pow(values.length, -1 / 3)));
+}
+
+function scott(values, min, max) {
+ return Math.ceil((max - min) / (3.5 * deviation(values) * Math.pow(values.length, -1 / 3)));
+}
+
+function max(values, valueof) {
+ var n = values.length,
+ i = -1,
+ value,
+ max;
+
+ if (valueof == null) {
+ while (++i < n) { // Find the first comparable value.
+ if ((value = values[i]) != null && value >= value) {
+ max = value;
+ while (++i < n) { // Compare the remaining values.
+ if ((value = values[i]) != null && value > max) {
+ max = value;
+ }
+ }
+ }
}
- return value == null ? name.local ? attrNullNS : attrNull : typeof value === "function" ? name.local ? attrFunctionNS : attrFunction : name.local ? attrConstantNS : attrConstant;
}
- function d3_collapse(s) {
- return s.trim().replace(/\s+/g, " ");
- }
- d3_selectionPrototype.classed = function(name, value) {
- if (arguments.length < 2) {
- if (typeof name === "string") {
- var node = this.node(), n = (name = d3_selection_classes(name)).length, i = -1;
- if (value = node.classList) {
- while (++i < n) if (!value.contains(name[i])) return false;
- } else {
- value = node.getAttribute("class");
- while (++i < n) if (!d3_selection_classedRe(name[i]).test(value)) return false;
+
+ else {
+ while (++i < n) { // Find the first comparable value.
+ if ((value = valueof(values[i], i, values)) != null && value >= value) {
+ max = value;
+ while (++i < n) { // Compare the remaining values.
+ if ((value = valueof(values[i], i, values)) != null && value > max) {
+ max = value;
+ }
}
- return true;
}
- for (value in name) this.each(d3_selection_classed(value, name[value]));
- return this;
}
- return this.each(d3_selection_classed(name, value));
- };
- function d3_selection_classedRe(name) {
- return new RegExp("(?:^|\\s+)" + d3.requote(name) + "(?:\\s+|$)", "g");
}
- function d3_selection_classes(name) {
- return (name + "").trim().split(/^|\s+/);
- }
- function d3_selection_classed(name, value) {
- name = d3_selection_classes(name).map(d3_selection_classedName);
- var n = name.length;
- function classedConstant() {
- var i = -1;
- while (++i < n) name[i](this, value);
+
+ return max;
+}
+
+function mean(values, valueof) {
+ var n = values.length,
+ m = n,
+ i = -1,
+ value,
+ sum = 0;
+
+ if (valueof == null) {
+ while (++i < n) {
+ if (!isNaN(value = number(values[i]))) sum += value;
+ else --m;
}
- function classedFunction() {
- var i = -1, x = value.apply(this, arguments);
- while (++i < n) name[i](this, x);
+ }
+
+ else {
+ while (++i < n) {
+ if (!isNaN(value = number(valueof(values[i], i, values)))) sum += value;
+ else --m;
}
- return typeof value === "function" ? classedFunction : classedConstant;
}
- function d3_selection_classedName(name) {
- var re = d3_selection_classedRe(name);
- return function(node, value) {
- if (c = node.classList) return value ? c.add(name) : c.remove(name);
- var c = node.getAttribute("class") || "";
- if (value) {
- re.lastIndex = 0;
- if (!re.test(c)) node.setAttribute("class", d3_collapse(c + " " + name));
- } else {
- node.setAttribute("class", d3_collapse(c.replace(re, " ")));
+
+ if (m) return sum / m;
+}
+
+function median(values, valueof) {
+ var n = values.length,
+ i = -1,
+ value,
+ numbers = [];
+
+ if (valueof == null) {
+ while (++i < n) {
+ if (!isNaN(value = number(values[i]))) {
+ numbers.push(value);
}
- };
+ }
}
- d3_selectionPrototype.style = function(name, value, priority) {
- var n = arguments.length;
- if (n < 3) {
- if (typeof name !== "string") {
- if (n < 2) value = "";
- for (priority in name) this.each(d3_selection_style(priority, name[priority], value));
- return this;
+
+ else {
+ while (++i < n) {
+ if (!isNaN(value = number(valueof(values[i], i, values)))) {
+ numbers.push(value);
}
- if (n < 2) return d3_window.getComputedStyle(this.node(), null).getPropertyValue(name);
- priority = "";
- }
- return this.each(d3_selection_style(name, value, priority));
- };
- function d3_selection_style(name, value, priority) {
- function styleNull() {
- this.style.removeProperty(name);
- }
- function styleConstant() {
- this.style.setProperty(name, value, priority);
}
- function styleFunction() {
- var x = value.apply(this, arguments);
- if (x == null) this.style.removeProperty(name); else this.style.setProperty(name, x, priority);
- }
- return value == null ? styleNull : typeof value === "function" ? styleFunction : styleConstant;
}
- d3_selectionPrototype.property = function(name, value) {
- if (arguments.length < 2) {
- if (typeof name === "string") return this.node()[name];
- for (value in name) this.each(d3_selection_property(value, name[value]));
- return this;
+
+ return threshold(numbers.sort(ascending), 0.5);
+}
+
+function merge(arrays) {
+ var n = arrays.length,
+ m,
+ i = -1,
+ j = 0,
+ merged,
+ array;
+
+ while (++i < n) j += arrays[i].length;
+ merged = new Array(j);
+
+ while (--n >= 0) {
+ array = arrays[n];
+ m = array.length;
+ while (--m >= 0) {
+ merged[--j] = array[m];
}
- return this.each(d3_selection_property(name, value));
- };
- function d3_selection_property(name, value) {
- function propertyNull() {
- delete this[name];
- }
- function propertyConstant() {
- this[name] = value;
- }
- function propertyFunction() {
- var x = value.apply(this, arguments);
- if (x == null) delete this[name]; else this[name] = x;
- }
- return value == null ? propertyNull : typeof value === "function" ? propertyFunction : propertyConstant;
- }
- d3_selectionPrototype.text = function(value) {
- return arguments.length ? this.each(typeof value === "function" ? function() {
- var v = value.apply(this, arguments);
- this.textContent = v == null ? "" : v;
- } : value == null ? function() {
- this.textContent = "";
- } : function() {
- this.textContent = value;
- }) : this.node().textContent;
- };
- d3_selectionPrototype.html = function(value) {
- return arguments.length ? this.each(typeof value === "function" ? function() {
- var v = value.apply(this, arguments);
- this.innerHTML = v == null ? "" : v;
- } : value == null ? function() {
- this.innerHTML = "";
- } : function() {
- this.innerHTML = value;
- }) : this.node().innerHTML;
- };
- d3_selectionPrototype.append = function(name) {
- name = d3_selection_creator(name);
- return this.select(function() {
- return this.appendChild(name.apply(this, arguments));
- });
- };
- function d3_selection_creator(name) {
- return typeof name === "function" ? name : (name = d3.ns.qualify(name)).local ? function() {
- return this.ownerDocument.createElementNS(name.space, name.local);
- } : function() {
- return this.ownerDocument.createElementNS(this.namespaceURI, name);
- };
}
- d3_selectionPrototype.insert = function(name, before) {
- name = d3_selection_creator(name);
- before = d3_selection_selector(before);
- return this.select(function() {
- return this.insertBefore(name.apply(this, arguments), before.apply(this, arguments) || null);
- });
- };
- d3_selectionPrototype.remove = function() {
- return this.each(function() {
- var parent = this.parentNode;
- if (parent) parent.removeChild(this);
- });
- };
- d3_selectionPrototype.data = function(value, key) {
- var i = -1, n = this.length, group, node;
- if (!arguments.length) {
- value = new Array(n = (group = this[0]).length);
- while (++i < n) {
- if (node = group[i]) {
- value[i] = node.__data__;
+
+ return merged;
+}
+
+function min(values, valueof) {
+ var n = values.length,
+ i = -1,
+ value,
+ min;
+
+ if (valueof == null) {
+ while (++i < n) { // Find the first comparable value.
+ if ((value = values[i]) != null && value >= value) {
+ min = value;
+ while (++i < n) { // Compare the remaining values.
+ if ((value = values[i]) != null && min > value) {
+ min = value;
+ }
}
}
- return value;
}
- function bind(group, groupData) {
- var i, n = group.length, m = groupData.length, n0 = Math.min(n, m), updateNodes = new Array(m), enterNodes = new Array(m), exitNodes = new Array(n), node, nodeData;
- if (key) {
- var nodeByKeyValue = new d3_Map(), keyValues = new Array(n), keyValue;
- for (i = -1; ++i < n; ) {
- if (nodeByKeyValue.has(keyValue = key.call(node = group[i], node.__data__, i))) {
- exitNodes[i] = node;
- } else {
- nodeByKeyValue.set(keyValue, node);
- }
- keyValues[i] = keyValue;
- }
- for (i = -1; ++i < m; ) {
- if (!(node = nodeByKeyValue.get(keyValue = key.call(groupData, nodeData = groupData[i], i)))) {
- enterNodes[i] = d3_selection_dataNode(nodeData);
- } else if (node !== true) {
- updateNodes[i] = node;
- node.__data__ = nodeData;
- }
- nodeByKeyValue.set(keyValue, true);
- }
- for (i = -1; ++i < n; ) {
- if (nodeByKeyValue.get(keyValues[i]) !== true) {
- exitNodes[i] = group[i];
+ }
+
+ else {
+ while (++i < n) { // Find the first comparable value.
+ if ((value = valueof(values[i], i, values)) != null && value >= value) {
+ min = value;
+ while (++i < n) { // Compare the remaining values.
+ if ((value = valueof(values[i], i, values)) != null && min > value) {
+ min = value;
}
}
- } else {
- for (i = -1; ++i < n0; ) {
- node = group[i];
- nodeData = groupData[i];
- if (node) {
- node.__data__ = nodeData;
- updateNodes[i] = node;
- } else {
- enterNodes[i] = d3_selection_dataNode(nodeData);
- }
- }
- for (;i < m; ++i) {
- enterNodes[i] = d3_selection_dataNode(groupData[i]);
- }
- for (;i < n; ++i) {
- exitNodes[i] = group[i];
- }
}
- enterNodes.update = updateNodes;
- enterNodes.parentNode = updateNodes.parentNode = exitNodes.parentNode = group.parentNode;
- enter.push(enterNodes);
- update.push(updateNodes);
- exit.push(exitNodes);
}
- var enter = d3_selection_enter([]), update = d3_selection([]), exit = d3_selection([]);
- if (typeof value === "function") {
- while (++i < n) {
- bind(group = this[i], value.call(group, group.parentNode.__data__, i));
- }
- } else {
- while (++i < n) {
- bind(group = this[i], value);
- }
+ }
+
+ return min;
+}
+
+function permute(array, indexes) {
+ var i = indexes.length, permutes = new Array(i);
+ while (i--) permutes[i] = array[indexes[i]];
+ return permutes;
+}
+
+function scan(values, compare) {
+ if (!(n = values.length)) return;
+ var n,
+ i = 0,
+ j = 0,
+ xi,
+ xj = values[j];
+
+ if (compare == null) compare = ascending;
+
+ while (++i < n) {
+ if (compare(xi = values[i], xj) < 0 || compare(xj, xj) !== 0) {
+ xj = xi, j = i;
}
- update.enter = function() {
- return enter;
- };
- update.exit = function() {
- return exit;
- };
- return update;
- };
- function d3_selection_dataNode(data) {
- return {
- __data__: data
- };
}
- d3_selectionPrototype.datum = function(value) {
- return arguments.length ? this.property("__data__", value) : this.property("__data__");
- };
- d3_selectionPrototype.filter = function(filter) {
- var subgroups = [], subgroup, group, node;
- if (typeof filter !== "function") filter = d3_selection_filter(filter);
- for (var j = 0, m = this.length; j < m; j++) {
- subgroups.push(subgroup = []);
- subgroup.parentNode = (group = this[j]).parentNode;
- for (var i = 0, n = group.length; i < n; i++) {
- if ((node = group[i]) && filter.call(node, node.__data__, i, j)) {
- subgroup.push(node);
- }
- }
+
+ if (compare(xj, xj) === 0) return j;
+}
+
+function shuffle(array, i0, i1) {
+ var m = (i1 == null ? array.length : i1) - (i0 = i0 == null ? 0 : +i0),
+ t,
+ i;
+
+ while (m) {
+ i = Math.random() * m-- | 0;
+ t = array[m + i0];
+ array[m + i0] = array[i + i0];
+ array[i + i0] = t;
+ }
+
+ return array;
+}
+
+function sum(values, valueof) {
+ var n = values.length,
+ i = -1,
+ value,
+ sum = 0;
+
+ if (valueof == null) {
+ while (++i < n) {
+ if (value = +values[i]) sum += value; // Note: zero and null are equivalent.
}
- return d3_selection(subgroups);
- };
- function d3_selection_filter(selector) {
- return function() {
- return d3_selectMatches(this, selector);
- };
}
- d3_selectionPrototype.order = function() {
- for (var j = -1, m = this.length; ++j < m; ) {
- for (var group = this[j], i = group.length - 1, next = group[i], node; --i >= 0; ) {
- if (node = group[i]) {
- if (next && next !== node.nextSibling) next.parentNode.insertBefore(node, next);
- next = node;
- }
- }
+
+ else {
+ while (++i < n) {
+ if (value = +valueof(values[i], i, values)) sum += value;
}
- return this;
+ }
+
+ return sum;
+}
+
+function transpose(matrix) {
+ if (!(n = matrix.length)) return [];
+ for (var i = -1, m = min(matrix, length), transpose = new Array(m); ++i < m;) {
+ for (var j = -1, n, row = transpose[i] = new Array(n); ++j < n;) {
+ row[j] = matrix[j][i];
+ }
+ }
+ return transpose;
+}
+
+function length(d) {
+ return d.length;
+}
+
+function zip() {
+ return transpose(arguments);
+}
+
+var slice$1 = Array.prototype.slice;
+
+function identity$1(x) {
+ return x;
+}
+
+var top = 1,
+ right = 2,
+ bottom = 3,
+ left = 4,
+ epsilon = 1e-6;
+
+function translateX(x) {
+ return "translate(" + (x + 0.5) + ",0)";
+}
+
+function translateY(y) {
+ return "translate(0," + (y + 0.5) + ")";
+}
+
+function number$1(scale) {
+ return function(d) {
+ return +scale(d);
};
- d3_selectionPrototype.sort = function(comparator) {
- comparator = d3_selection_sortComparator.apply(this, arguments);
- for (var j = -1, m = this.length; ++j < m; ) this[j].sort(comparator);
- return this.order();
+}
+
+function center(scale) {
+ var offset = Math.max(0, scale.bandwidth() - 1) / 2; // Adjust for 0.5px offset.
+ if (scale.round()) offset = Math.round(offset);
+ return function(d) {
+ return +scale(d) + offset;
};
- function d3_selection_sortComparator(comparator) {
- if (!arguments.length) comparator = d3_ascending;
- return function(a, b) {
- return a && b ? comparator(a.__data__, b.__data__) : !a - !b;
- };
+}
+
+function entering() {
+ return !this.__axis;
+}
+
+function axis(orient, scale) {
+ var tickArguments = [],
+ tickValues = null,
+ tickFormat = null,
+ tickSizeInner = 6,
+ tickSizeOuter = 6,
+ tickPadding = 3,
+ k = orient === top || orient === left ? -1 : 1,
+ x = orient === left || orient === right ? "x" : "y",
+ transform = orient === top || orient === bottom ? translateX : translateY;
+
+ function axis(context) {
+ var values = tickValues == null ? (scale.ticks ? scale.ticks.apply(scale, tickArguments) : scale.domain()) : tickValues,
+ format = tickFormat == null ? (scale.tickFormat ? scale.tickFormat.apply(scale, tickArguments) : identity$1) : tickFormat,
+ spacing = Math.max(tickSizeInner, 0) + tickPadding,
+ range = scale.range(),
+ range0 = +range[0] + 0.5,
+ range1 = +range[range.length - 1] + 0.5,
+ position = (scale.bandwidth ? center : number$1)(scale.copy()),
+ selection = context.selection ? context.selection() : context,
+ path = selection.selectAll(".domain").data([null]),
+ tick = selection.selectAll(".tick").data(values, scale).order(),
+ tickExit = tick.exit(),
+ tickEnter = tick.enter().append("g").attr("class", "tick"),
+ line = tick.select("line"),
+ text = tick.select("text");
+
+ path = path.merge(path.enter().insert("path", ".tick")
+ .attr("class", "domain")
+ .attr("stroke", "currentColor"));
+
+ tick = tick.merge(tickEnter);
+
+ line = line.merge(tickEnter.append("line")
+ .attr("stroke", "currentColor")
+ .attr(x + "2", k * tickSizeInner));
+
+ text = text.merge(tickEnter.append("text")
+ .attr("fill", "currentColor")
+ .attr(x, k * spacing)
+ .attr("dy", orient === top ? "0em" : orient === bottom ? "0.71em" : "0.32em"));
+
+ if (context !== selection) {
+ path = path.transition(context);
+ tick = tick.transition(context);
+ line = line.transition(context);
+ text = text.transition(context);
+
+ tickExit = tickExit.transition(context)
+ .attr("opacity", epsilon)
+ .attr("transform", function(d) { return isFinite(d = position(d)) ? transform(d) : this.getAttribute("transform"); });
+
+ tickEnter
+ .attr("opacity", epsilon)
+ .attr("transform", function(d) { var p = this.parentNode.__axis; return transform(p && isFinite(p = p(d)) ? p : position(d)); });
+ }
+
+ tickExit.remove();
+
+ path
+ .attr("d", orient === left || orient == right
+ ? (tickSizeOuter ? "M" + k * tickSizeOuter + "," + range0 + "H0.5V" + range1 + "H" + k * tickSizeOuter : "M0.5," + range0 + "V" + range1)
+ : (tickSizeOuter ? "M" + range0 + "," + k * tickSizeOuter + "V0.5H" + range1 + "V" + k * tickSizeOuter : "M" + range0 + ",0.5H" + range1));
+
+ tick
+ .attr("opacity", 1)
+ .attr("transform", function(d) { return transform(position(d)); });
+
+ line
+ .attr(x + "2", k * tickSizeInner);
+
+ text
+ .attr(x, k * spacing)
+ .text(format);
+
+ selection.filter(entering)
+ .attr("fill", "none")
+ .attr("font-size", 10)
+ .attr("font-family", "sans-serif")
+ .attr("text-anchor", orient === right ? "start" : orient === left ? "end" : "middle");
+
+ selection
+ .each(function() { this.__axis = position; });
}
- d3_selectionPrototype.each = function(callback) {
- return d3_selection_each(this, function(node, i, j) {
- callback.call(node, node.__data__, i, j);
- });
+
+ axis.scale = function(_) {
+ return arguments.length ? (scale = _, axis) : scale;
};
- function d3_selection_each(groups, callback) {
- for (var j = 0, m = groups.length; j < m; j++) {
- for (var group = groups[j], i = 0, n = group.length, node; i < n; i++) {
- if (node = group[i]) callback(node, i, j);
- }
- }
- return groups;
+
+ axis.ticks = function() {
+ return tickArguments = slice$1.call(arguments), axis;
+ };
+
+ axis.tickArguments = function(_) {
+ return arguments.length ? (tickArguments = _ == null ? [] : slice$1.call(_), axis) : tickArguments.slice();
+ };
+
+ axis.tickValues = function(_) {
+ return arguments.length ? (tickValues = _ == null ? null : slice$1.call(_), axis) : tickValues && tickValues.slice();
+ };
+
+ axis.tickFormat = function(_) {
+ return arguments.length ? (tickFormat = _, axis) : tickFormat;
+ };
+
+ axis.tickSize = function(_) {
+ return arguments.length ? (tickSizeInner = tickSizeOuter = +_, axis) : tickSizeInner;
+ };
+
+ axis.tickSizeInner = function(_) {
+ return arguments.length ? (tickSizeInner = +_, axis) : tickSizeInner;
+ };
+
+ axis.tickSizeOuter = function(_) {
+ return arguments.length ? (tickSizeOuter = +_, axis) : tickSizeOuter;
+ };
+
+ axis.tickPadding = function(_) {
+ return arguments.length ? (tickPadding = +_, axis) : tickPadding;
+ };
+
+ return axis;
+}
+
+function axisTop(scale) {
+ return axis(top, scale);
+}
+
+function axisRight(scale) {
+ return axis(right, scale);
+}
+
+function axisBottom(scale) {
+ return axis(bottom, scale);
+}
+
+function axisLeft(scale) {
+ return axis(left, scale);
+}
+
+var noop = {value: function() {}};
+
+function dispatch() {
+ for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {
+ if (!(t = arguments[i] + "") || (t in _)) throw new Error("illegal type: " + t);
+ _[t] = [];
}
- d3_selectionPrototype.call = function(callback) {
- var args = d3_array(arguments);
- callback.apply(args[0] = this, args);
+ return new Dispatch(_);
+}
+
+function Dispatch(_) {
+ this._ = _;
+}
+
+function parseTypenames(typenames, types) {
+ return typenames.trim().split(/^|\s+/).map(function(t) {
+ var name = "", i = t.indexOf(".");
+ if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);
+ if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t);
+ return {type: t, name: name};
+ });
+}
+
+Dispatch.prototype = dispatch.prototype = {
+ constructor: Dispatch,
+ on: function(typename, callback) {
+ var _ = this._,
+ T = parseTypenames(typename + "", _),
+ t,
+ i = -1,
+ n = T.length;
+
+ // If no callback was specified, return the callback of the given type and name.
+ if (arguments.length < 2) {
+ while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;
+ return;
+ }
+
+ // If a type was specified, set the callback for the given type and name.
+ // Otherwise, if a null callback was specified, remove callbacks of the given name.
+ if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback);
+ while (++i < n) {
+ if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);
+ else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);
+ }
+
return this;
+ },
+ copy: function() {
+ var copy = {}, _ = this._;
+ for (var t in _) copy[t] = _[t].slice();
+ return new Dispatch(copy);
+ },
+ call: function(type, that) {
+ if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];
+ if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);
+ for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);
+ },
+ apply: function(type, that, args) {
+ if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type);
+ for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);
+ }
+};
+
+function get(type, name) {
+ for (var i = 0, n = type.length, c; i < n; ++i) {
+ if ((c = type[i]).name === name) {
+ return c.value;
+ }
+ }
+}
+
+function set(type, name, callback) {
+ for (var i = 0, n = type.length; i < n; ++i) {
+ if (type[i].name === name) {
+ type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));
+ break;
+ }
+ }
+ if (callback != null) type.push({name: name, value: callback});
+ return type;
+}
+
+var xhtml = "http://www.w3.org/1999/xhtml";
+
+var namespaces = {
+ svg: "http://www.w3.org/2000/svg",
+ xhtml: xhtml,
+ xlink: "http://www.w3.org/1999/xlink",
+ xml: "http://www.w3.org/XML/1998/namespace",
+ xmlns: "http://www.w3.org/2000/xmlns/"
+};
+
+function namespace(name) {
+ var prefix = name += "", i = prefix.indexOf(":");
+ if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1);
+ return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name;
+}
+
+function creatorInherit(name) {
+ return function() {
+ var document = this.ownerDocument,
+ uri = this.namespaceURI;
+ return uri === xhtml && document.documentElement.namespaceURI === xhtml
+ ? document.createElement(name)
+ : document.createElementNS(uri, name);
+ };
+}
+
+function creatorFixed(fullname) {
+ return function() {
+ return this.ownerDocument.createElementNS(fullname.space, fullname.local);
};
- d3_selectionPrototype.empty = function() {
- return !this.node();
+}
+
+function creator(name) {
+ var fullname = namespace(name);
+ return (fullname.local
+ ? creatorFixed
+ : creatorInherit)(fullname);
+}
+
+function none() {}
+
+function selector(selector) {
+ return selector == null ? none : function() {
+ return this.querySelector(selector);
};
- d3_selectionPrototype.node = function() {
- for (var j = 0, m = this.length; j < m; j++) {
- for (var group = this[j], i = 0, n = group.length; i < n; i++) {
- var node = group[i];
- if (node) return node;
+}
+
+function selection_select(select) {
+ if (typeof select !== "function") select = selector(select);
+
+ for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
+ for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {
+ if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {
+ if ("__data__" in node) subnode.__data__ = node.__data__;
+ subgroup[i] = subnode;
}
}
- return null;
+ }
+
+ return new Selection(subgroups, this._parents);
+}
+
+function empty() {
+ return [];
+}
+
+function selectorAll(selector) {
+ return selector == null ? empty : function() {
+ return this.querySelectorAll(selector);
};
- d3_selectionPrototype.size = function() {
- var n = 0;
- d3_selection_each(this, function() {
- ++n;
- });
- return n;
- };
- function d3_selection_enter(selection) {
- d3_subclass(selection, d3_selection_enterPrototype);
- return selection;
- }
- var d3_selection_enterPrototype = [];
- d3.selection.enter = d3_selection_enter;
- d3.selection.enter.prototype = d3_selection_enterPrototype;
- d3_selection_enterPrototype.append = d3_selectionPrototype.append;
- d3_selection_enterPrototype.empty = d3_selectionPrototype.empty;
- d3_selection_enterPrototype.node = d3_selectionPrototype.node;
- d3_selection_enterPrototype.call = d3_selectionPrototype.call;
- d3_selection_enterPrototype.size = d3_selectionPrototype.size;
- d3_selection_enterPrototype.select = function(selector) {
- var subgroups = [], subgroup, subnode, upgroup, group, node;
- for (var j = -1, m = this.length; ++j < m; ) {
- upgroup = (group = this[j]).update;
- subgroups.push(subgroup = []);
- subgroup.parentNode = group.parentNode;
- for (var i = -1, n = group.length; ++i < n; ) {
- if (node = group[i]) {
- subgroup.push(upgroup[i] = subnode = selector.call(group.parentNode, node.__data__, i, j));
- subnode.__data__ = node.__data__;
- } else {
- subgroup.push(null);
- }
+}
+
+function selection_selectAll(select) {
+ if (typeof select !== "function") select = selectorAll(select);
+
+ for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {
+ for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
+ if (node = group[i]) {
+ subgroups.push(select.call(node, node.__data__, i, group));
+ parents.push(node);
}
}
- return d3_selection(subgroups);
- };
- d3_selection_enterPrototype.insert = function(name, before) {
- if (arguments.length < 2) before = d3_selection_enterInsertBefore(this);
- return d3_selectionPrototype.insert.call(this, name, before);
- };
- function d3_selection_enterInsertBefore(enter) {
- var i0, j0;
- return function(d, i, j) {
- var group = enter[j].update, n = group.length, node;
- if (j != j0) j0 = j, i0 = 0;
- if (i >= i0) i0 = i + 1;
- while (!(node = group[i0]) && ++i0 < n) ;
- return node;
- };
}
- d3_selectionPrototype.transition = function() {
- var id = d3_transitionInheritId || ++d3_transitionId, subgroups = [], subgroup, node, transition = d3_transitionInherit || {
- time: Date.now(),
- ease: d3_ease_cubicInOut,
- delay: 0,
- duration: 250
- };
- for (var j = -1, m = this.length; ++j < m; ) {
- subgroups.push(subgroup = []);
- for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
- if (node = group[i]) d3_transitionNode(node, i, id, transition);
+
+ return new Selection(subgroups, parents);
+}
+
+function matcher(selector) {
+ return function() {
+ return this.matches(selector);
+ };
+}
+
+function selection_filter(match) {
+ if (typeof match !== "function") match = matcher(match);
+
+ for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
+ for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {
+ if ((node = group[i]) && match.call(node, node.__data__, i, group)) {
subgroup.push(node);
}
}
- return d3_transition(subgroups, id);
- };
- d3_selectionPrototype.interrupt = function() {
- return this.each(d3_selection_interrupt);
- };
- function d3_selection_interrupt() {
- var lock = this.__transition__;
- if (lock) ++lock.active;
- }
- d3.select = function(node) {
- var group = [ typeof node === "string" ? d3_select(node, d3_document) : node ];
- group.parentNode = d3_documentElement;
- return d3_selection([ group ]);
- };
- d3.selectAll = function(nodes) {
- var group = d3_array(typeof nodes === "string" ? d3_selectAll(nodes, d3_document) : nodes);
- group.parentNode = d3_documentElement;
- return d3_selection([ group ]);
- };
- var d3_selectionRoot = d3.select(d3_documentElement);
- d3_selectionPrototype.on = function(type, listener, capture) {
- var n = arguments.length;
- if (n < 3) {
- if (typeof type !== "string") {
- if (n < 2) listener = false;
- for (capture in type) this.each(d3_selection_on(capture, type[capture], listener));
- return this;
- }
- if (n < 2) return (n = this.node()["__on" + type]) && n._;
- capture = false;
- }
- return this.each(d3_selection_on(type, listener, capture));
- };
- function d3_selection_on(type, listener, capture) {
- var name = "__on" + type, i = type.indexOf("."), wrap = d3_selection_onListener;
- if (i > 0) type = type.slice(0, i);
- var filter = d3_selection_onFilters.get(type);
- if (filter) type = filter, wrap = d3_selection_onFilter;
- function onRemove() {
- var l = this[name];
- if (l) {
- this.removeEventListener(type, l, l.$);
- delete this[name];
- }
- }
- function onAdd() {
- var l = wrap(listener, d3_array(arguments));
- onRemove.call(this);
- this.addEventListener(type, this[name] = l, l.$ = capture);
- l._ = listener;
- }
- function removeAll() {
- var re = new RegExp("^__on([^.]+)" + d3.requote(type) + "$"), match;
- for (var name in this) {
- if (match = name.match(re)) {
- var l = this[name];
- this.removeEventListener(match[1], l, l.$);
- delete this[name];
- }
- }
- }
- return i ? listener ? onAdd : onRemove : listener ? d3_noop : removeAll;
}
- var d3_selection_onFilters = d3.map({
- mouseenter: "mouseover",
- mouseleave: "mouseout"
- });
- d3_selection_onFilters.forEach(function(k) {
- if ("on" + k in d3_document) d3_selection_onFilters.remove(k);
- });
- function d3_selection_onListener(listener, argumentz) {
- return function(e) {
- var o = d3.event;
- d3.event = e;
- argumentz[0] = this.__data__;
- try {
- listener.apply(this, argumentz);
- } finally {
- d3.event = o;
- }
- };
+
+ return new Selection(subgroups, this._parents);
+}
+
+function sparse(update) {
+ return new Array(update.length);
+}
+
+function selection_enter() {
+ return new Selection(this._enter || this._groups.map(sparse), this._parents);
+}
+
+function EnterNode(parent, datum) {
+ this.ownerDocument = parent.ownerDocument;
+ this.namespaceURI = parent.namespaceURI;
+ this._next = null;
+ this._parent = parent;
+ this.__data__ = datum;
+}
+
+EnterNode.prototype = {
+ constructor: EnterNode,
+ appendChild: function(child) { return this._parent.insertBefore(child, this._next); },
+ insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },
+ querySelector: function(selector) { return this._parent.querySelector(selector); },
+ querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }
+};
+
+function constant$1(x) {
+ return function() {
+ return x;
+ };
+}
+
+var keyPrefix = "$"; // Protect against keys like “__proto__â€.
+
+function bindIndex(parent, group, enter, update, exit, data) {
+ var i = 0,
+ node,
+ groupLength = group.length,
+ dataLength = data.length;
+
+ // Put any non-null nodes that fit into update.
+ // Put any null nodes into enter.
+ // Put any remaining data into enter.
+ for (; i < dataLength; ++i) {
+ if (node = group[i]) {
+ node.__data__ = data[i];
+ update[i] = node;
+ } else {
+ enter[i] = new EnterNode(parent, data[i]);
+ }
}
- function d3_selection_onFilter(listener, argumentz) {
- var l = d3_selection_onListener(listener, argumentz);
- return function(e) {
- var target = this, related = e.relatedTarget;
- if (!related || related !== target && !(related.compareDocumentPosition(target) & 8)) {
- l.call(target, e);
- }
- };
+
+ // Put any non-null nodes that don’t fit into exit.
+ for (; i < groupLength; ++i) {
+ if (node = group[i]) {
+ exit[i] = node;
+ }
}
- var d3_event_dragSelect = "onselectstart" in d3_document ? null : d3_vendorSymbol(d3_documentElement.style, "userSelect"), d3_event_dragId = 0;
- function d3_event_dragSuppress() {
- var name = ".dragsuppress-" + ++d3_event_dragId, click = "click" + name, w = d3.select(d3_window).on("touchmove" + name, d3_eventPreventDefault).on("dragstart" + name, d3_eventPreventDefault).on("selectstart" + name, d3_eventPreventDefault);
- if (d3_event_dragSelect) {
- var style = d3_documentElement.style, select = style[d3_event_dragSelect];
- style[d3_event_dragSelect] = "none";
- }
- return function(suppressClick) {
- w.on(name, null);
- if (d3_event_dragSelect) style[d3_event_dragSelect] = select;
- if (suppressClick) {
- function off() {
- w.on(click, null);
- }
- w.on(click, function() {
- d3_eventPreventDefault();
- off();
- }, true);
- setTimeout(off, 0);
+}
+
+function bindKey(parent, group, enter, update, exit, data, key) {
+ var i,
+ node,
+ nodeByKeyValue = {},
+ groupLength = group.length,
+ dataLength = data.length,
+ keyValues = new Array(groupLength),
+ keyValue;
+
+ // Compute the key for each node.
+ // If multiple nodes have the same key, the duplicates are added to exit.
+ for (i = 0; i < groupLength; ++i) {
+ if (node = group[i]) {
+ keyValues[i] = keyValue = keyPrefix + key.call(node, node.__data__, i, group);
+ if (keyValue in nodeByKeyValue) {
+ exit[i] = node;
+ } else {
+ nodeByKeyValue[keyValue] = node;
}
- };
- }
- d3.mouse = function(container) {
- return d3_mousePoint(container, d3_eventSource());
- };
- var d3_mouse_bug44083 = /WebKit/.test(d3_window.navigator.userAgent) ? -1 : 0;
- function d3_mousePoint(container, e) {
- if (e.changedTouches) e = e.changedTouches[0];
- var svg = container.ownerSVGElement || container;
- if (svg.createSVGPoint) {
- var point = svg.createSVGPoint();
- if (d3_mouse_bug44083 < 0 && (d3_window.scrollX || d3_window.scrollY)) {
- svg = d3.select("body").append("svg").style({
- position: "absolute",
- top: 0,
- left: 0,
- margin: 0,
- padding: 0,
- border: "none"
- }, "important");
- var ctm = svg[0][0].getScreenCTM();
- d3_mouse_bug44083 = !(ctm.f || ctm.e);
- svg.remove();
- }
- if (d3_mouse_bug44083) point.x = e.pageX, point.y = e.pageY; else point.x = e.clientX,
- point.y = e.clientY;
- point = point.matrixTransform(container.getScreenCTM().inverse());
- return [ point.x, point.y ];
- }
- var rect = container.getBoundingClientRect();
- return [ e.clientX - rect.left - container.clientLeft, e.clientY - rect.top - container.clientTop ];
- }
- d3.touch = function(container, touches, identifier) {
- if (arguments.length < 3) identifier = touches, touches = d3_eventSource().changedTouches;
- if (touches) for (var i = 0, n = touches.length, touch; i < n; ++i) {
- if ((touch = touches[i]).identifier === identifier) {
- return d3_mousePoint(container, touch);
- }
- }
- };
- d3.behavior.drag = function() {
- var event = d3_eventDispatch(drag, "drag", "dragstart", "dragend"), origin = null, mousedown = dragstart(d3_noop, d3.mouse, d3_behavior_dragMouseSubject, "mousemove", "mouseup"), touchstart = dragstart(d3_behavior_dragTouchId, d3.touch, d3_behavior_dragTouchSubject, "touchmove", "touchend");
- function drag() {
- this.on("mousedown.drag", mousedown).on("touchstart.drag", touchstart);
- }
- function dragstart(id, position, subject, move, end) {
- return function() {
- var that = this, target = d3.event.target, parent = that.parentNode, dispatch = event.of(that, arguments), dragged = 0, dragId = id(), dragName = ".drag" + (dragId == null ? "" : "-" + dragId), dragOffset, dragSubject = d3.select(subject()).on(move + dragName, moved).on(end + dragName, ended), dragRestore = d3_event_dragSuppress(), position0 = position(parent, dragId);
- if (origin) {
- dragOffset = origin.apply(that, arguments);
- dragOffset = [ dragOffset.x - position0[0], dragOffset.y - position0[1] ];
- } else {
- dragOffset = [ 0, 0 ];
- }
- dispatch({
- type: "dragstart"
- });
- function moved() {
- var position1 = position(parent, dragId), dx, dy;
- if (!position1) return;
- dx = position1[0] - position0[0];
- dy = position1[1] - position0[1];
- dragged |= dx | dy;
- position0 = position1;
- dispatch({
- type: "drag",
- x: position1[0] + dragOffset[0],
- y: position1[1] + dragOffset[1],
- dx: dx,
- dy: dy
- });
- }
- function ended() {
- if (!position(parent, dragId)) return;
- dragSubject.on(move + dragName, null).on(end + dragName, null);
- dragRestore(dragged && d3.event.target === target);
- dispatch({
- type: "dragend"
- });
- }
- };
- }
- drag.origin = function(x) {
- if (!arguments.length) return origin;
- origin = x;
- return drag;
- };
- return d3.rebind(drag, event, "on");
- };
- function d3_behavior_dragTouchId() {
- return d3.event.changedTouches[0].identifier;
- }
- function d3_behavior_dragTouchSubject() {
- return d3.event.target;
- }
- function d3_behavior_dragMouseSubject() {
- return d3_window;
- }
- d3.touches = function(container, touches) {
- if (arguments.length < 2) touches = d3_eventSource().touches;
- return touches ? d3_array(touches).map(function(touch) {
- var point = d3_mousePoint(container, touch);
- point.identifier = touch.identifier;
- return point;
- }) : [];
- };
- var π = Math.PI, τ = 2 * π, halfπ = π / 2, ε = 1e-6, ε2 = ε * ε, d3_radians = π / 180, d3_degrees = 180 / π;
- function d3_sgn(x) {
- return x > 0 ? 1 : x < 0 ? -1 : 0;
- }
- function d3_cross2d(a, b, c) {
- return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]);
- }
- function d3_acos(x) {
- return x > 1 ? 0 : x < -1 ? π : Math.acos(x);
- }
- function d3_asin(x) {
- return x > 1 ? halfπ : x < -1 ? -halfπ : Math.asin(x);
- }
- function d3_sinh(x) {
- return ((x = Math.exp(x)) - 1 / x) / 2;
- }
- function d3_cosh(x) {
- return ((x = Math.exp(x)) + 1 / x) / 2;
- }
- function d3_tanh(x) {
- return ((x = Math.exp(2 * x)) - 1) / (x + 1);
- }
- function d3_haversin(x) {
- return (x = Math.sin(x / 2)) * x;
- }
- var Ï = Math.SQRT2, Ï2 = 2, Ï4 = 4;
- d3.interpolateZoom = function(p0, p1) {
- var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], ux1 = p1[0], uy1 = p1[1], w1 = p1[2];
- var dx = ux1 - ux0, dy = uy1 - uy0, d2 = dx * dx + dy * dy, d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + Ï4 * d2) / (2 * w0 * Ï2 * d1), b1 = (w1 * w1 - w0 * w0 - Ï4 * d2) / (2 * w1 * Ï2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1), dr = r1 - r0, S = (dr || Math.log(w1 / w0)) / Ï;
- function interpolate(t) {
- var s = t * S;
- if (dr) {
- var coshr0 = d3_cosh(r0), u = w0 / (Ï2 * d1) * (coshr0 * d3_tanh(Ï * s + r0) - d3_sinh(r0));
- return [ ux0 + u * dx, uy0 + u * dy, w0 * coshr0 / d3_cosh(Ï * s + r0) ];
- }
- return [ ux0 + t * dx, uy0 + t * dy, w0 * Math.exp(Ï * s) ];
- }
- interpolate.duration = S * 1e3;
- return interpolate;
- };
- d3.behavior.zoom = function() {
- var view = {
- x: 0,
- y: 0,
- k: 1
- }, translate0, center0, center, size = [ 960, 500 ], scaleExtent = d3_behavior_zoomInfinity, mousedown = "mousedown.zoom", mousemove = "mousemove.zoom", mouseup = "mouseup.zoom", mousewheelTimer, touchstart = "touchstart.zoom", touchtime, event = d3_eventDispatch(zoom, "zoomstart", "zoom", "zoomend"), x0, x1, y0, y1;
- function zoom(g) {
- g.on(mousedown, mousedowned).on(d3_behavior_zoomWheel + ".zoom", mousewheeled).on("dblclick.zoom", dblclicked).on(touchstart, touchstarted);
- }
- zoom.event = function(g) {
- g.each(function() {
- var dispatch = event.of(this, arguments), view1 = view;
- if (d3_transitionInheritId) {
- d3.select(this).transition().each("start.zoom", function() {
- view = this.__chart__ || {
- x: 0,
- y: 0,
- k: 1
- };
- zoomstarted(dispatch);
- }).tween("zoom:zoom", function() {
- var dx = size[0], dy = size[1], cx = dx / 2, cy = dy / 2, i = d3.interpolateZoom([ (cx - view.x) / view.k, (cy - view.y) / view.k, dx / view.k ], [ (cx - view1.x) / view1.k, (cy - view1.y) / view1.k, dx / view1.k ]);
- return function(t) {
- var l = i(t), k = dx / l[2];
- this.__chart__ = view = {
- x: cx - l[0] * k,
- y: cy - l[1] * k,
- k: k
- };
- zoomed(dispatch);
- };
- }).each("end.zoom", function() {
- zoomended(dispatch);
- });
- } else {
- this.__chart__ = view;
- zoomstarted(dispatch);
- zoomed(dispatch);
- zoomended(dispatch);
- }
- });
- };
- zoom.translate = function(_) {
- if (!arguments.length) return [ view.x, view.y ];
- view = {
- x: +_[0],
- y: +_[1],
- k: view.k
- };
- rescale();
- return zoom;
- };
- zoom.scale = function(_) {
- if (!arguments.length) return view.k;
- view = {
- x: view.x,
- y: view.y,
- k: +_
- };
- rescale();
- return zoom;
- };
- zoom.scaleExtent = function(_) {
- if (!arguments.length) return scaleExtent;
- scaleExtent = _ == null ? d3_behavior_zoomInfinity : [ +_[0], +_[1] ];
- return zoom;
- };
- zoom.center = function(_) {
- if (!arguments.length) return center;
- center = _ && [ +_[0], +_[1] ];
- return zoom;
- };
- zoom.size = function(_) {
- if (!arguments.length) return size;
- size = _ && [ +_[0], +_[1] ];
- return zoom;
- };
- zoom.x = function(z) {
- if (!arguments.length) return x1;
- x1 = z;
- x0 = z.copy();
- view = {
- x: 0,
- y: 0,
- k: 1
- };
- return zoom;
- };
- zoom.y = function(z) {
- if (!arguments.length) return y1;
- y1 = z;
- y0 = z.copy();
- view = {
- x: 0,
- y: 0,
- k: 1
- };
- return zoom;
- };
- function location(p) {
- return [ (p[0] - view.x) / view.k, (p[1] - view.y) / view.k ];
- }
- function point(l) {
- return [ l[0] * view.k + view.x, l[1] * view.k + view.y ];
- }
- function scaleTo(s) {
- view.k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], s));
- }
- function translateTo(p, l) {
- l = point(l);
- view.x += p[0] - l[0];
- view.y += p[1] - l[1];
- }
- function rescale() {
- if (x1) x1.domain(x0.range().map(function(x) {
- return (x - view.x) / view.k;
- }).map(x0.invert));
- if (y1) y1.domain(y0.range().map(function(y) {
- return (y - view.y) / view.k;
- }).map(y0.invert));
- }
- function zoomstarted(dispatch) {
- dispatch({
- type: "zoomstart"
- });
}
- function zoomed(dispatch) {
- rescale();
- dispatch({
- type: "zoom",
- scale: view.k,
- translate: [ view.x, view.y ]
- });
+ }
+
+ // Compute the key for each datum.
+ // If there a node associated with this key, join and add it to update.
+ // If there is not (or the key is a duplicate), add it to enter.
+ for (i = 0; i < dataLength; ++i) {
+ keyValue = keyPrefix + key.call(parent, data[i], i, data);
+ if (node = nodeByKeyValue[keyValue]) {
+ update[i] = node;
+ node.__data__ = data[i];
+ nodeByKeyValue[keyValue] = null;
+ } else {
+ enter[i] = new EnterNode(parent, data[i]);
}
- function zoomended(dispatch) {
- dispatch({
- type: "zoomend"
- });
+ }
+
+ // Add any remaining nodes that were not bound to data to exit.
+ for (i = 0; i < groupLength; ++i) {
+ if ((node = group[i]) && (nodeByKeyValue[keyValues[i]] === node)) {
+ exit[i] = node;
}
- function mousedowned() {
- var that = this, target = d3.event.target, dispatch = event.of(that, arguments), dragged = 0, subject = d3.select(d3_window).on(mousemove, moved).on(mouseup, ended), location0 = location(d3.mouse(that)), dragRestore = d3_event_dragSuppress();
- d3_selection_interrupt.call(that);
- zoomstarted(dispatch);
- function moved() {
- dragged = 1;
- translateTo(d3.mouse(that), location0);
- zoomed(dispatch);
- }
- function ended() {
- subject.on(mousemove, null).on(mouseup, null);
- dragRestore(dragged && d3.event.target === target);
- zoomended(dispatch);
- }
- }
- function touchstarted() {
- var that = this, dispatch = event.of(that, arguments), locations0 = {}, distance0 = 0, scale0, zoomName = ".zoom-" + d3.event.changedTouches[0].identifier, touchmove = "touchmove" + zoomName, touchend = "touchend" + zoomName, targets = [], subject = d3.select(that), dragRestore = d3_event_dragSuppress();
- d3_selection_interrupt.call(that);
- started();
- zoomstarted(dispatch);
- subject.on(mousedown, null).on(touchstart, started);
- function relocate() {
- var touches = d3.touches(that);
- scale0 = view.k;
- touches.forEach(function(t) {
- if (t.identifier in locations0) locations0[t.identifier] = location(t);
- });
- return touches;
- }
- function started() {
- var target = d3.event.target;
- d3.select(target).on(touchmove, moved).on(touchend, ended);
- targets.push(target);
- var changed = d3.event.changedTouches;
- for (var i = 0, n = changed.length; i < n; ++i) {
- locations0[changed[i].identifier] = null;
- }
- var touches = relocate(), now = Date.now();
- if (touches.length === 1) {
- if (now - touchtime < 500) {
- var p = touches[0], l = locations0[p.identifier];
- scaleTo(view.k * 2);
- translateTo(p, l);
- d3_eventPreventDefault();
- zoomed(dispatch);
- }
- touchtime = now;
- } else if (touches.length > 1) {
- var p = touches[0], q = touches[1], dx = p[0] - q[0], dy = p[1] - q[1];
- distance0 = dx * dx + dy * dy;
- }
- }
- function moved() {
- var touches = d3.touches(that), p0, l0, p1, l1;
- for (var i = 0, n = touches.length; i < n; ++i, l1 = null) {
- p1 = touches[i];
- if (l1 = locations0[p1.identifier]) {
- if (l0) break;
- p0 = p1, l0 = l1;
- }
- }
- if (l1) {
- var distance1 = (distance1 = p1[0] - p0[0]) * distance1 + (distance1 = p1[1] - p0[1]) * distance1, scale1 = distance0 && Math.sqrt(distance1 / distance0);
- p0 = [ (p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2 ];
- l0 = [ (l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2 ];
- scaleTo(scale1 * scale0);
- }
- touchtime = null;
- translateTo(p0, l0);
- zoomed(dispatch);
- }
- function ended() {
- if (d3.event.touches.length) {
- var changed = d3.event.changedTouches;
- for (var i = 0, n = changed.length; i < n; ++i) {
- delete locations0[changed[i].identifier];
- }
- for (var identifier in locations0) {
- return void relocate();
- }
- }
- d3.selectAll(targets).on(zoomName, null);
- subject.on(mousedown, mousedowned).on(touchstart, touchstarted);
- dragRestore();
- zoomended(dispatch);
- }
- }
- function mousewheeled() {
- var dispatch = event.of(this, arguments);
- if (mousewheelTimer) clearTimeout(mousewheelTimer); else translate0 = location(center0 = center || d3.mouse(this)),
- d3_selection_interrupt.call(this), zoomstarted(dispatch);
- mousewheelTimer = setTimeout(function() {
- mousewheelTimer = null;
- zoomended(dispatch);
- }, 50);
- d3_eventPreventDefault();
- scaleTo(Math.pow(2, d3_behavior_zoomDelta() * .002) * view.k);
- translateTo(center0, translate0);
- zoomed(dispatch);
- }
- function dblclicked() {
- var dispatch = event.of(this, arguments), p = d3.mouse(this), l = location(p), k = Math.log(view.k) / Math.LN2;
- zoomstarted(dispatch);
- scaleTo(Math.pow(2, d3.event.shiftKey ? Math.ceil(k) - 1 : Math.floor(k) + 1));
- translateTo(p, l);
- zoomed(dispatch);
- zoomended(dispatch);
- }
- return d3.rebind(zoom, event, "on");
- };
- var d3_behavior_zoomInfinity = [ 0, Infinity ];
- var d3_behavior_zoomDelta, d3_behavior_zoomWheel = "onwheel" in d3_document ? (d3_behavior_zoomDelta = function() {
- return -d3.event.deltaY * (d3.event.deltaMode ? 120 : 1);
- }, "wheel") : "onmousewheel" in d3_document ? (d3_behavior_zoomDelta = function() {
- return d3.event.wheelDelta;
- }, "mousewheel") : (d3_behavior_zoomDelta = function() {
- return -d3.event.detail;
- }, "MozMousePixelScroll");
- d3.color = d3_color;
- function d3_color() {}
- d3_color.prototype.toString = function() {
- return this.rgb() + "";
- };
- d3.hsl = d3_hsl;
- function d3_hsl(h, s, l) {
- return this instanceof d3_hsl ? void (this.h = +h, this.s = +s, this.l = +l) : arguments.length < 2 ? h instanceof d3_hsl ? new d3_hsl(h.h, h.s, h.l) : d3_rgb_parse("" + h, d3_rgb_hsl, d3_hsl) : new d3_hsl(h, s, l);
- }
- var d3_hslPrototype = d3_hsl.prototype = new d3_color();
- d3_hslPrototype.brighter = function(k) {
- k = Math.pow(.7, arguments.length ? k : 1);
- return new d3_hsl(this.h, this.s, this.l / k);
- };
- d3_hslPrototype.darker = function(k) {
- k = Math.pow(.7, arguments.length ? k : 1);
- return new d3_hsl(this.h, this.s, k * this.l);
- };
- d3_hslPrototype.rgb = function() {
- return d3_hsl_rgb(this.h, this.s, this.l);
- };
- function d3_hsl_rgb(h, s, l) {
- var m1, m2;
- h = isNaN(h) ? 0 : (h %= 360) < 0 ? h + 360 : h;
- s = isNaN(s) ? 0 : s < 0 ? 0 : s > 1 ? 1 : s;
- l = l < 0 ? 0 : l > 1 ? 1 : l;
- m2 = l <= .5 ? l * (1 + s) : l + s - l * s;
- m1 = 2 * l - m2;
- function v(h) {
- if (h > 360) h -= 360; else if (h < 0) h += 360;
- if (h < 60) return m1 + (m2 - m1) * h / 60;
- if (h < 180) return m2;
- if (h < 240) return m1 + (m2 - m1) * (240 - h) / 60;
- return m1;
- }
- function vv(h) {
- return Math.round(v(h) * 255);
- }
- return new d3_rgb(vv(h + 120), vv(h), vv(h - 120));
- }
- d3.hcl = d3_hcl;
- function d3_hcl(h, c, l) {
- return this instanceof d3_hcl ? void (this.h = +h, this.c = +c, this.l = +l) : arguments.length < 2 ? h instanceof d3_hcl ? new d3_hcl(h.h, h.c, h.l) : h instanceof d3_lab ? d3_lab_hcl(h.l, h.a, h.b) : d3_lab_hcl((h = d3_rgb_lab((h = d3.rgb(h)).r, h.g, h.b)).l, h.a, h.b) : new d3_hcl(h, c, l);
- }
- var d3_hclPrototype = d3_hcl.prototype = new d3_color();
- d3_hclPrototype.brighter = function(k) {
- return new d3_hcl(this.h, this.c, Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)));
- };
- d3_hclPrototype.darker = function(k) {
- return new d3_hcl(this.h, this.c, Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)));
- };
- d3_hclPrototype.rgb = function() {
- return d3_hcl_lab(this.h, this.c, this.l).rgb();
- };
- function d3_hcl_lab(h, c, l) {
- if (isNaN(h)) h = 0;
- if (isNaN(c)) c = 0;
- return new d3_lab(l, Math.cos(h *= d3_radians) * c, Math.sin(h) * c);
- }
- d3.lab = d3_lab;
- function d3_lab(l, a, b) {
- return this instanceof d3_lab ? void (this.l = +l, this.a = +a, this.b = +b) : arguments.length < 2 ? l instanceof d3_lab ? new d3_lab(l.l, l.a, l.b) : l instanceof d3_hcl ? d3_hcl_lab(l.h, l.c, l.l) : d3_rgb_lab((l = d3_rgb(l)).r, l.g, l.b) : new d3_lab(l, a, b);
- }
- var d3_lab_K = 18;
- var d3_lab_X = .95047, d3_lab_Y = 1, d3_lab_Z = 1.08883;
- var d3_labPrototype = d3_lab.prototype = new d3_color();
- d3_labPrototype.brighter = function(k) {
- return new d3_lab(Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)), this.a, this.b);
- };
- d3_labPrototype.darker = function(k) {
- return new d3_lab(Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)), this.a, this.b);
- };
- d3_labPrototype.rgb = function() {
- return d3_lab_rgb(this.l, this.a, this.b);
- };
- function d3_lab_rgb(l, a, b) {
- var y = (l + 16) / 116, x = y + a / 500, z = y - b / 200;
- x = d3_lab_xyz(x) * d3_lab_X;
- y = d3_lab_xyz(y) * d3_lab_Y;
- z = d3_lab_xyz(z) * d3_lab_Z;
- return new d3_rgb(d3_xyz_rgb(3.2404542 * x - 1.5371385 * y - .4985314 * z), d3_xyz_rgb(-.969266 * x + 1.8760108 * y + .041556 * z), d3_xyz_rgb(.0556434 * x - .2040259 * y + 1.0572252 * z));
- }
- function d3_lab_hcl(l, a, b) {
- return l > 0 ? new d3_hcl(Math.atan2(b, a) * d3_degrees, Math.sqrt(a * a + b * b), l) : new d3_hcl(NaN, NaN, l);
- }
- function d3_lab_xyz(x) {
- return x > .206893034 ? x * x * x : (x - 4 / 29) / 7.787037;
- }
- function d3_xyz_lab(x) {
- return x > .008856 ? Math.pow(x, 1 / 3) : 7.787037 * x + 4 / 29;
- }
- function d3_xyz_rgb(r) {
- return Math.round(255 * (r <= .00304 ? 12.92 * r : 1.055 * Math.pow(r, 1 / 2.4) - .055));
- }
- d3.rgb = d3_rgb;
- function d3_rgb(r, g, b) {
- return this instanceof d3_rgb ? void (this.r = ~~r, this.g = ~~g, this.b = ~~b) : arguments.length < 2 ? r instanceof d3_rgb ? new d3_rgb(r.r, r.g, r.b) : d3_rgb_parse("" + r, d3_rgb, d3_hsl_rgb) : new d3_rgb(r, g, b);
- }
- function d3_rgbNumber(value) {
- return new d3_rgb(value >> 16, value >> 8 & 255, value & 255);
- }
- function d3_rgbString(value) {
- return d3_rgbNumber(value) + "";
- }
- var d3_rgbPrototype = d3_rgb.prototype = new d3_color();
- d3_rgbPrototype.brighter = function(k) {
- k = Math.pow(.7, arguments.length ? k : 1);
- var r = this.r, g = this.g, b = this.b, i = 30;
- if (!r && !g && !b) return new d3_rgb(i, i, i);
- if (r && r < i) r = i;
- if (g && g < i) g = i;
- if (b && b < i) b = i;
- return new d3_rgb(Math.min(255, r / k), Math.min(255, g / k), Math.min(255, b / k));
- };
- d3_rgbPrototype.darker = function(k) {
- k = Math.pow(.7, arguments.length ? k : 1);
- return new d3_rgb(k * this.r, k * this.g, k * this.b);
- };
- d3_rgbPrototype.hsl = function() {
- return d3_rgb_hsl(this.r, this.g, this.b);
- };
- d3_rgbPrototype.toString = function() {
- return "#" + d3_rgb_hex(this.r) + d3_rgb_hex(this.g) + d3_rgb_hex(this.b);
- };
- function d3_rgb_hex(v) {
- return v < 16 ? "0" + Math.max(0, v).toString(16) : Math.min(255, v).toString(16);
- }
- function d3_rgb_parse(format, rgb, hsl) {
- var r = 0, g = 0, b = 0, m1, m2, color;
- m1 = /([a-z]+)\((.*)\)/i.exec(format);
- if (m1) {
- m2 = m1[2].split(",");
- switch (m1[1]) {
- case "hsl":
- {
- return hsl(parseFloat(m2[0]), parseFloat(m2[1]) / 100, parseFloat(m2[2]) / 100);
- }
+ }
+}
- case "rgb":
- {
- return rgb(d3_rgb_parseNumber(m2[0]), d3_rgb_parseNumber(m2[1]), d3_rgb_parseNumber(m2[2]));
- }
+function selection_data(value, key) {
+ if (!value) {
+ data = new Array(this.size()), j = -1;
+ this.each(function(d) { data[++j] = d; });
+ return data;
+ }
+
+ var bind = key ? bindKey : bindIndex,
+ parents = this._parents,
+ groups = this._groups;
+
+ if (typeof value !== "function") value = constant$1(value);
+
+ for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {
+ var parent = parents[j],
+ group = groups[j],
+ groupLength = group.length,
+ data = value.call(parent, parent && parent.__data__, j, parents),
+ dataLength = data.length,
+ enterGroup = enter[j] = new Array(dataLength),
+ updateGroup = update[j] = new Array(dataLength),
+ exitGroup = exit[j] = new Array(groupLength);
+
+ bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);
+
+ // Now connect the enter nodes to their following update node, such that
+ // appendChild can insert the materialized enter node before this node,
+ // rather than at the end of the parent node.
+ for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {
+ if (previous = enterGroup[i0]) {
+ if (i0 >= i1) i1 = i0 + 1;
+ while (!(next = updateGroup[i1]) && ++i1 < dataLength);
+ previous._next = next || null;
}
}
- if (color = d3_rgb_names.get(format)) return rgb(color.r, color.g, color.b);
- if (format != null && format.charAt(0) === "#" && !isNaN(color = parseInt(format.slice(1), 16))) {
- if (format.length === 4) {
- r = (color & 3840) >> 4;
- r = r >> 4 | r;
- g = color & 240;
- g = g >> 4 | g;
- b = color & 15;
- b = b << 4 | b;
- } else if (format.length === 7) {
- r = (color & 16711680) >> 16;
- g = (color & 65280) >> 8;
- b = color & 255;
- }
- }
- return rgb(r, g, b);
- }
- function d3_rgb_hsl(r, g, b) {
- var min = Math.min(r /= 255, g /= 255, b /= 255), max = Math.max(r, g, b), d = max - min, h, s, l = (max + min) / 2;
- if (d) {
- s = l < .5 ? d / (max + min) : d / (2 - max - min);
- if (r == max) h = (g - b) / d + (g < b ? 6 : 0); else if (g == max) h = (b - r) / d + 2; else h = (r - g) / d + 4;
- h *= 60;
- } else {
- h = NaN;
- s = l > 0 && l < 1 ? 0 : h;
- }
- return new d3_hsl(h, s, l);
- }
- function d3_rgb_lab(r, g, b) {
- r = d3_rgb_xyz(r);
- g = d3_rgb_xyz(g);
- b = d3_rgb_xyz(b);
- var x = d3_xyz_lab((.4124564 * r + .3575761 * g + .1804375 * b) / d3_lab_X), y = d3_xyz_lab((.2126729 * r + .7151522 * g + .072175 * b) / d3_lab_Y), z = d3_xyz_lab((.0193339 * r + .119192 * g + .9503041 * b) / d3_lab_Z);
- return d3_lab(116 * y - 16, 500 * (x - y), 200 * (y - z));
- }
- function d3_rgb_xyz(r) {
- return (r /= 255) <= .04045 ? r / 12.92 : Math.pow((r + .055) / 1.055, 2.4);
- }
- function d3_rgb_parseNumber(c) {
- var f = parseFloat(c);
- return c.charAt(c.length - 1) === "%" ? Math.round(f * 2.55) : f;
- }
- var d3_rgb_names = d3.map({
- aliceblue: 15792383,
- antiquewhite: 16444375,
- aqua: 65535,
- aquamarine: 8388564,
- azure: 15794175,
- beige: 16119260,
- bisque: 16770244,
- black: 0,
- blanchedalmond: 16772045,
- blue: 255,
- blueviolet: 9055202,
- brown: 10824234,
- burlywood: 14596231,
- cadetblue: 6266528,
- chartreuse: 8388352,
- chocolate: 13789470,
- coral: 16744272,
- cornflowerblue: 6591981,
- cornsilk: 16775388,
- crimson: 14423100,
- cyan: 65535,
- darkblue: 139,
- darkcyan: 35723,
- darkgoldenrod: 12092939,
- darkgray: 11119017,
- darkgreen: 25600,
- darkgrey: 11119017,
- darkkhaki: 12433259,
- darkmagenta: 9109643,
- darkolivegreen: 5597999,
- darkorange: 16747520,
- darkorchid: 10040012,
- darkred: 9109504,
- darksalmon: 15308410,
- darkseagreen: 9419919,
- darkslateblue: 4734347,
- darkslategray: 3100495,
- darkslategrey: 3100495,
- darkturquoise: 52945,
- darkviolet: 9699539,
- deeppink: 16716947,
- deepskyblue: 49151,
- dimgray: 6908265,
- dimgrey: 6908265,
- dodgerblue: 2003199,
- firebrick: 11674146,
- floralwhite: 16775920,
- forestgreen: 2263842,
- fuchsia: 16711935,
- gainsboro: 14474460,
- ghostwhite: 16316671,
- gold: 16766720,
- goldenrod: 14329120,
- gray: 8421504,
- green: 32768,
- greenyellow: 11403055,
- grey: 8421504,
- honeydew: 15794160,
- hotpink: 16738740,
- indianred: 13458524,
- indigo: 4915330,
- ivory: 16777200,
- khaki: 15787660,
- lavender: 15132410,
- lavenderblush: 16773365,
- lawngreen: 8190976,
- lemonchiffon: 16775885,
- lightblue: 11393254,
- lightcoral: 15761536,
- lightcyan: 14745599,
- lightgoldenrodyellow: 16448210,
- lightgray: 13882323,
- lightgreen: 9498256,
- lightgrey: 13882323,
- lightpink: 16758465,
- lightsalmon: 16752762,
- lightseagreen: 2142890,
- lightskyblue: 8900346,
- lightslategray: 7833753,
- lightslategrey: 7833753,
- lightsteelblue: 11584734,
- lightyellow: 16777184,
- lime: 65280,
- limegreen: 3329330,
- linen: 16445670,
- magenta: 16711935,
- maroon: 8388608,
- mediumaquamarine: 6737322,
- mediumblue: 205,
- mediumorchid: 12211667,
- mediumpurple: 9662683,
- mediumseagreen: 3978097,
- mediumslateblue: 8087790,
- mediumspringgreen: 64154,
- mediumturquoise: 4772300,
- mediumvioletred: 13047173,
- midnightblue: 1644912,
- mintcream: 16121850,
- mistyrose: 16770273,
- moccasin: 16770229,
- navajowhite: 16768685,
- navy: 128,
- oldlace: 16643558,
- olive: 8421376,
- olivedrab: 7048739,
- orange: 16753920,
- orangered: 16729344,
- orchid: 14315734,
- palegoldenrod: 15657130,
- palegreen: 10025880,
- paleturquoise: 11529966,
- palevioletred: 14381203,
- papayawhip: 16773077,
- peachpuff: 16767673,
- peru: 13468991,
- pink: 16761035,
- plum: 14524637,
- powderblue: 11591910,
- purple: 8388736,
- red: 16711680,
- rosybrown: 12357519,
- royalblue: 4286945,
- saddlebrown: 9127187,
- salmon: 16416882,
- sandybrown: 16032864,
- seagreen: 3050327,
- seashell: 16774638,
- sienna: 10506797,
- silver: 12632256,
- skyblue: 8900331,
- slateblue: 6970061,
- slategray: 7372944,
- slategrey: 7372944,
- snow: 16775930,
- springgreen: 65407,
- steelblue: 4620980,
- tan: 13808780,
- teal: 32896,
- thistle: 14204888,
- tomato: 16737095,
- turquoise: 4251856,
- violet: 15631086,
- wheat: 16113331,
- white: 16777215,
- whitesmoke: 16119285,
- yellow: 16776960,
- yellowgreen: 10145074
- });
- d3_rgb_names.forEach(function(key, value) {
- d3_rgb_names.set(key, d3_rgbNumber(value));
- });
- function d3_functor(v) {
- return typeof v === "function" ? v : function() {
- return v;
- };
}
- d3.functor = d3_functor;
- function d3_identity(d) {
- return d;
+
+ update = new Selection(update, parents);
+ update._enter = enter;
+ update._exit = exit;
+ return update;
+}
+
+function selection_exit() {
+ return new Selection(this._exit || this._groups.map(sparse), this._parents);
+}
+
+function selection_join(onenter, onupdate, onexit) {
+ var enter = this.enter(), update = this, exit = this.exit();
+ enter = typeof onenter === "function" ? onenter(enter) : enter.append(onenter + "");
+ if (onupdate != null) update = onupdate(update);
+ if (onexit == null) exit.remove(); else onexit(exit);
+ return enter && update ? enter.merge(update).order() : update;
+}
+
+function selection_merge(selection$$1) {
+
+ for (var groups0 = this._groups, groups1 = selection$$1._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {
+ for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {
+ if (node = group0[i] || group1[i]) {
+ merge[i] = node;
+ }
+ }
}
- d3.xhr = d3_xhrType(d3_identity);
- function d3_xhrType(response) {
- return function(url, mimeType, callback) {
- if (arguments.length === 2 && typeof mimeType === "function") callback = mimeType,
- mimeType = null;
- return d3_xhr(url, mimeType, response, callback);
- };
+
+ for (; j < m0; ++j) {
+ merges[j] = groups0[j];
}
- function d3_xhr(url, mimeType, response, callback) {
- var xhr = {}, dispatch = d3.dispatch("beforesend", "progress", "load", "error"), headers = {}, request = new XMLHttpRequest(), responseType = null;
- if (d3_window.XDomainRequest && !("withCredentials" in request) && /^(http(s)?:)?\/\//.test(url)) request = new XDomainRequest();
- "onload" in request ? request.onload = request.onerror = respond : request.onreadystatechange = function() {
- request.readyState > 3 && respond();
- };
- function respond() {
- var status = request.status, result;
- if (!status && d3_xhrHasResponse(request) || status >= 200 && status < 300 || status === 304) {
- try {
- result = response.call(xhr, request);
- } catch (e) {
- dispatch.error.call(xhr, e);
- return;
- }
- dispatch.load.call(xhr, result);
- } else {
- dispatch.error.call(xhr, request);
+
+ return new Selection(merges, this._parents);
+}
+
+function selection_order() {
+
+ for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {
+ for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {
+ if (node = group[i]) {
+ if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);
+ next = node;
}
}
- request.onprogress = function(event) {
- var o = d3.event;
- d3.event = event;
- try {
- dispatch.progress.call(xhr, request);
- } finally {
- d3.event = o;
- }
- };
- xhr.header = function(name, value) {
- name = (name + "").toLowerCase();
- if (arguments.length < 2) return headers[name];
- if (value == null) delete headers[name]; else headers[name] = value + "";
- return xhr;
- };
- xhr.mimeType = function(value) {
- if (!arguments.length) return mimeType;
- mimeType = value == null ? null : value + "";
- return xhr;
- };
- xhr.responseType = function(value) {
- if (!arguments.length) return responseType;
- responseType = value;
- return xhr;
- };
- xhr.response = function(value) {
- response = value;
- return xhr;
- };
- [ "get", "post" ].forEach(function(method) {
- xhr[method] = function() {
- return xhr.send.apply(xhr, [ method ].concat(d3_array(arguments)));
- };
- });
- xhr.send = function(method, data, callback) {
- if (arguments.length === 2 && typeof data === "function") callback = data, data = null;
- request.open(method, url, true);
- if (mimeType != null && !("accept" in headers)) headers["accept"] = mimeType + ",*/*";
- if (request.setRequestHeader) for (var name in headers) request.setRequestHeader(name, headers[name]);
- if (mimeType != null && request.overrideMimeType) request.overrideMimeType(mimeType);
- if (responseType != null) request.responseType = responseType;
- if (callback != null) xhr.on("error", callback).on("load", function(request) {
- callback(null, request);
- });
- dispatch.beforesend.call(xhr, request);
- request.send(data == null ? null : data);
- return xhr;
- };
- xhr.abort = function() {
- request.abort();
- return xhr;
- };
- d3.rebind(xhr, dispatch, "on");
- return callback == null ? xhr : xhr.get(d3_xhr_fixCallback(callback));
- }
- function d3_xhr_fixCallback(callback) {
- return callback.length === 1 ? function(error, request) {
- callback(error == null ? request : null);
- } : callback;
- }
- function d3_xhrHasResponse(request) {
- var type = request.responseType;
- return type && type !== "text" ? request.response : request.responseText;
- }
- d3.dsv = function(delimiter, mimeType) {
- var reFormat = new RegExp('["' + delimiter + "\n]"), delimiterCode = delimiter.charCodeAt(0);
- function dsv(url, row, callback) {
- if (arguments.length < 3) callback = row, row = null;
- var xhr = d3_xhr(url, mimeType, row == null ? response : typedResponse(row), callback);
- xhr.row = function(_) {
- return arguments.length ? xhr.response((row = _) == null ? response : typedResponse(_)) : row;
- };
- return xhr;
- }
- function response(request) {
- return dsv.parse(request.responseText);
- }
- function typedResponse(f) {
- return function(request) {
- return dsv.parse(request.responseText, f);
- };
- }
- dsv.parse = function(text, f) {
- var o;
- return dsv.parseRows(text, function(row, i) {
- if (o) return o(row, i - 1);
- var a = new Function("d", "return {" + row.map(function(name, i) {
- return JSON.stringify(name) + ": d[" + i + "]";
- }).join(",") + "}");
- o = f ? function(row, i) {
- return f(a(row), i);
- } : a;
- });
- };
- dsv.parseRows = function(text, f) {
- var EOL = {}, EOF = {}, rows = [], N = text.length, I = 0, n = 0, t, eol;
- function token() {
- if (I >= N) return EOF;
- if (eol) return eol = false, EOL;
- var j = I;
- if (text.charCodeAt(j) === 34) {
- var i = j;
- while (i++ < N) {
- if (text.charCodeAt(i) === 34) {
- if (text.charCodeAt(i + 1) !== 34) break;
- ++i;
- }
- }
- I = i + 2;
- var c = text.charCodeAt(i + 1);
- if (c === 13) {
- eol = true;
- if (text.charCodeAt(i + 2) === 10) ++I;
- } else if (c === 10) {
- eol = true;
- }
- return text.slice(j + 1, i).replace(/""/g, '"');
- }
- while (I < N) {
- var c = text.charCodeAt(I++), k = 1;
- if (c === 10) eol = true; else if (c === 13) {
- eol = true;
- if (text.charCodeAt(I) === 10) ++I, ++k;
- } else if (c !== delimiterCode) continue;
- return text.slice(j, I - k);
- }
- return text.slice(j);
- }
- while ((t = token()) !== EOF) {
- var a = [];
- while (t !== EOL && t !== EOF) {
- a.push(t);
- t = token();
- }
- if (f && (a = f(a, n++)) == null) continue;
- rows.push(a);
+ }
+
+ return this;
+}
+
+function selection_sort(compare) {
+ if (!compare) compare = ascending$1;
+
+ function compareNode(a, b) {
+ return a && b ? compare(a.__data__, b.__data__) : !a - !b;
+ }
+
+ for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {
+ for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {
+ if (node = group[i]) {
+ sortgroup[i] = node;
}
- return rows;
- };
- dsv.format = function(rows) {
- if (Array.isArray(rows[0])) return dsv.formatRows(rows);
- var fieldSet = new d3_Set(), fields = [];
- rows.forEach(function(row) {
- for (var field in row) {
- if (!fieldSet.has(field)) {
- fields.push(fieldSet.add(field));
- }
- }
- });
- return [ fields.map(formatValue).join(delimiter) ].concat(rows.map(function(row) {
- return fields.map(function(field) {
- return formatValue(row[field]);
- }).join(delimiter);
- })).join("\n");
- };
- dsv.formatRows = function(rows) {
- return rows.map(formatRow).join("\n");
- };
- function formatRow(row) {
- return row.map(formatValue).join(delimiter);
- }
- function formatValue(text) {
- return reFormat.test(text) ? '"' + text.replace(/\"/g, '""') + '"' : text;
- }
- return dsv;
- };
- d3.csv = d3.dsv(",", "text/csv");
- d3.tsv = d3.dsv(" ", "text/tab-separated-values");
- var d3_timer_queueHead, d3_timer_queueTail, d3_timer_interval, d3_timer_timeout, d3_timer_active, d3_timer_frame = d3_window[d3_vendorSymbol(d3_window, "requestAnimationFrame")] || function(callback) {
- setTimeout(callback, 17);
- };
- d3.timer = function(callback, delay, then) {
- var n = arguments.length;
- if (n < 2) delay = 0;
- if (n < 3) then = Date.now();
- var time = then + delay, timer = {
- c: callback,
- t: time,
- f: false,
- n: null
- };
- if (d3_timer_queueTail) d3_timer_queueTail.n = timer; else d3_timer_queueHead = timer;
- d3_timer_queueTail = timer;
- if (!d3_timer_interval) {
- d3_timer_timeout = clearTimeout(d3_timer_timeout);
- d3_timer_interval = 1;
- d3_timer_frame(d3_timer_step);
- }
- };
- function d3_timer_step() {
- var now = d3_timer_mark(), delay = d3_timer_sweep() - now;
- if (delay > 24) {
- if (isFinite(delay)) {
- clearTimeout(d3_timer_timeout);
- d3_timer_timeout = setTimeout(d3_timer_step, delay);
- }
- d3_timer_interval = 0;
- } else {
- d3_timer_interval = 1;
- d3_timer_frame(d3_timer_step);
}
+ sortgroup.sort(compareNode);
}
- d3.timer.flush = function() {
- d3_timer_mark();
- d3_timer_sweep();
- };
- function d3_timer_mark() {
- var now = Date.now();
- d3_timer_active = d3_timer_queueHead;
- while (d3_timer_active) {
- if (now >= d3_timer_active.t) d3_timer_active.f = d3_timer_active.c(now - d3_timer_active.t);
- d3_timer_active = d3_timer_active.n;
+
+ return new Selection(sortgroups, this._parents).order();
+}
+
+function ascending$1(a, b) {
+ return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
+}
+
+function selection_call() {
+ var callback = arguments[0];
+ arguments[0] = this;
+ callback.apply(null, arguments);
+ return this;
+}
+
+function selection_nodes() {
+ var nodes = new Array(this.size()), i = -1;
+ this.each(function() { nodes[++i] = this; });
+ return nodes;
+}
+
+function selection_node() {
+
+ for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
+ for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {
+ var node = group[i];
+ if (node) return node;
}
- return now;
}
- function d3_timer_sweep() {
- var t0, t1 = d3_timer_queueHead, time = Infinity;
- while (t1) {
- if (t1.f) {
- t1 = t0 ? t0.n = t1.n : d3_timer_queueHead = t1.n;
- } else {
- if (t1.t < time) time = t1.t;
- t1 = (t0 = t1).n;
- }
+
+ return null;
+}
+
+function selection_size() {
+ var size = 0;
+ this.each(function() { ++size; });
+ return size;
+}
+
+function selection_empty() {
+ return !this.node();
+}
+
+function selection_each(callback) {
+
+ for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {
+ for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {
+ if (node = group[i]) callback.call(node, node.__data__, i, group);
}
- d3_timer_queueTail = t0;
- return time;
}
- function d3_format_precision(x, p) {
- return p - (x ? Math.ceil(Math.log(x) / Math.LN10) : 1);
- }
- d3.round = function(x, n) {
- return n ? Math.round(x * (n = Math.pow(10, n))) / n : Math.round(x);
+
+ return this;
+}
+
+function attrRemove(name) {
+ return function() {
+ this.removeAttribute(name);
};
- var d3_formatPrefixes = [ "y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y" ].map(d3_formatPrefix);
- d3.formatPrefix = function(value, precision) {
- var i = 0;
- if (value) {
- if (value < 0) value *= -1;
- if (precision) value = d3.round(value, d3_format_precision(value, precision));
- i = 1 + Math.floor(1e-12 + Math.log(value) / Math.LN10);
- i = Math.max(-24, Math.min(24, Math.floor((i - 1) / 3) * 3));
- }
- return d3_formatPrefixes[8 + i / 3];
+}
+
+function attrRemoveNS(fullname) {
+ return function() {
+ this.removeAttributeNS(fullname.space, fullname.local);
};
- function d3_formatPrefix(d, i) {
- var k = Math.pow(10, abs(8 - i) * 3);
- return {
- scale: i > 8 ? function(d) {
- return d / k;
- } : function(d) {
- return d * k;
- },
- symbol: d
- };
- }
- function d3_locale_numberFormat(locale) {
- var locale_decimal = locale.decimal, locale_thousands = locale.thousands, locale_grouping = locale.grouping, locale_currency = locale.currency, formatGroup = locale_grouping && locale_thousands ? function(value, width) {
- var i = value.length, t = [], j = 0, g = locale_grouping[0], length = 0;
- while (i > 0 && g > 0) {
- if (length + g + 1 > width) g = Math.max(1, width - length);
- t.push(value.substring(i -= g, i + g));
- if ((length += g + 1) > width) break;
- g = locale_grouping[j = (j + 1) % locale_grouping.length];
- }
- return t.reverse().join(locale_thousands);
- } : d3_identity;
- return function(specifier) {
- var match = d3_format_re.exec(specifier), fill = match[1] || " ", align = match[2] || ">", sign = match[3] || "-", symbol = match[4] || "", zfill = match[5], width = +match[6], comma = match[7], precision = match[8], type = match[9], scale = 1, prefix = "", suffix = "", integer = false, exponent = true;
- if (precision) precision = +precision.substring(1);
- if (zfill || fill === "0" && align === "=") {
- zfill = fill = "0";
- align = "=";
- }
- switch (type) {
- case "n":
- comma = true;
- type = "g";
- break;
+}
- case "%":
- scale = 100;
- suffix = "%";
- type = "f";
- break;
+function attrConstant(name, value) {
+ return function() {
+ this.setAttribute(name, value);
+ };
+}
- case "p":
- scale = 100;
- suffix = "%";
- type = "r";
- break;
+function attrConstantNS(fullname, value) {
+ return function() {
+ this.setAttributeNS(fullname.space, fullname.local, value);
+ };
+}
- case "b":
- case "o":
- case "x":
- case "X":
- if (symbol === "#") prefix = "0" + type.toLowerCase();
+function attrFunction(name, value) {
+ return function() {
+ var v = value.apply(this, arguments);
+ if (v == null) this.removeAttribute(name);
+ else this.setAttribute(name, v);
+ };
+}
- case "c":
- exponent = false;
+function attrFunctionNS(fullname, value) {
+ return function() {
+ var v = value.apply(this, arguments);
+ if (v == null) this.removeAttributeNS(fullname.space, fullname.local);
+ else this.setAttributeNS(fullname.space, fullname.local, v);
+ };
+}
- case "d":
- integer = true;
- precision = 0;
- break;
+function selection_attr(name, value) {
+ var fullname = namespace(name);
- case "s":
- scale = -1;
- type = "r";
- break;
- }
- if (symbol === "$") prefix = locale_currency[0], suffix = locale_currency[1];
- if (type == "r" && !precision) type = "g";
- if (precision != null) {
- if (type == "g") precision = Math.max(1, Math.min(21, precision)); else if (type == "e" || type == "f") precision = Math.max(0, Math.min(20, precision));
- }
- type = d3_format_types.get(type) || d3_format_typeDefault;
- var zcomma = zfill && comma;
- return function(value) {
- var fullSuffix = suffix;
- if (integer && value % 1) return "";
- var negative = value < 0 || value === 0 && 1 / value < 0 ? (value = -value, "-") : sign === "-" ? "" : sign;
- if (scale < 0) {
- var unit = d3.formatPrefix(value, precision);
- value = unit.scale(value);
- fullSuffix = unit.symbol + suffix;
- } else {
- value *= scale;
- }
- value = type(value, precision);
- var i = value.lastIndexOf("."), before, after;
- if (i < 0) {
- var j = exponent ? value.lastIndexOf("e") : -1;
- if (j < 0) before = value, after = ""; else before = value.substring(0, j), after = value.substring(j);
- } else {
- before = value.substring(0, i);
- after = locale_decimal + value.substring(i + 1);
- }
- if (!zfill && comma) before = formatGroup(before, Infinity);
- var length = prefix.length + before.length + after.length + (zcomma ? 0 : negative.length), padding = length < width ? new Array(length = width - length + 1).join(fill) : "";
- if (zcomma) before = formatGroup(padding + before, padding.length ? width - after.length : Infinity);
- negative += prefix;
- value = before + after;
- return (align === "<" ? negative + value + padding : align === ">" ? padding + negative + value : align === "^" ? padding.substring(0, length >>= 1) + negative + value + padding.substring(length) : negative + (zcomma ? value : padding + value)) + fullSuffix;
- };
- };
+ if (arguments.length < 2) {
+ var node = this.node();
+ return fullname.local
+ ? node.getAttributeNS(fullname.space, fullname.local)
+ : node.getAttribute(fullname);
}
- var d3_format_re = /(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i;
- var d3_format_types = d3.map({
- b: function(x) {
- return x.toString(2);
- },
- c: function(x) {
- return String.fromCharCode(x);
- },
- o: function(x) {
- return x.toString(8);
- },
- x: function(x) {
- return x.toString(16);
- },
- X: function(x) {
- return x.toString(16).toUpperCase();
- },
- g: function(x, p) {
- return x.toPrecision(p);
- },
- e: function(x, p) {
- return x.toExponential(p);
- },
- f: function(x, p) {
- return x.toFixed(p);
- },
- r: function(x, p) {
- return (x = d3.round(x, d3_format_precision(x, p))).toFixed(Math.max(0, Math.min(20, d3_format_precision(x * (1 + 1e-15), p))));
+
+ return this.each((value == null
+ ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === "function"
+ ? (fullname.local ? attrFunctionNS : attrFunction)
+ : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));
+}
+
+function defaultView(node) {
+ return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node
+ || (node.document && node) // node is a Window
+ || node.defaultView; // node is a Document
+}
+
+function styleRemove(name) {
+ return function() {
+ this.style.removeProperty(name);
+ };
+}
+
+function styleConstant(name, value, priority) {
+ return function() {
+ this.style.setProperty(name, value, priority);
+ };
+}
+
+function styleFunction(name, value, priority) {
+ return function() {
+ var v = value.apply(this, arguments);
+ if (v == null) this.style.removeProperty(name);
+ else this.style.setProperty(name, v, priority);
+ };
+}
+
+function selection_style(name, value, priority) {
+ return arguments.length > 1
+ ? this.each((value == null
+ ? styleRemove : typeof value === "function"
+ ? styleFunction
+ : styleConstant)(name, value, priority == null ? "" : priority))
+ : styleValue(this.node(), name);
+}
+
+function styleValue(node, name) {
+ return node.style.getPropertyValue(name)
+ || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);
+}
+
+function propertyRemove(name) {
+ return function() {
+ delete this[name];
+ };
+}
+
+function propertyConstant(name, value) {
+ return function() {
+ this[name] = value;
+ };
+}
+
+function propertyFunction(name, value) {
+ return function() {
+ var v = value.apply(this, arguments);
+ if (v == null) delete this[name];
+ else this[name] = v;
+ };
+}
+
+function selection_property(name, value) {
+ return arguments.length > 1
+ ? this.each((value == null
+ ? propertyRemove : typeof value === "function"
+ ? propertyFunction
+ : propertyConstant)(name, value))
+ : this.node()[name];
+}
+
+function classArray(string) {
+ return string.trim().split(/^|\s+/);
+}
+
+function classList(node) {
+ return node.classList || new ClassList(node);
+}
+
+function ClassList(node) {
+ this._node = node;
+ this._names = classArray(node.getAttribute("class") || "");
+}
+
+ClassList.prototype = {
+ add: function(name) {
+ var i = this._names.indexOf(name);
+ if (i < 0) {
+ this._names.push(name);
+ this._node.setAttribute("class", this._names.join(" "));
+ }
+ },
+ remove: function(name) {
+ var i = this._names.indexOf(name);
+ if (i >= 0) {
+ this._names.splice(i, 1);
+ this._node.setAttribute("class", this._names.join(" "));
}
- });
- function d3_format_typeDefault(x) {
- return x + "";
+ },
+ contains: function(name) {
+ return this._names.indexOf(name) >= 0;
}
- var d3_time = d3.time = {}, d3_date = Date;
- function d3_date_utc() {
- this._ = new Date(arguments.length > 1 ? Date.UTC.apply(this, arguments) : arguments[0]);
- }
- d3_date_utc.prototype = {
- getDate: function() {
- return this._.getUTCDate();
- },
- getDay: function() {
- return this._.getUTCDay();
- },
- getFullYear: function() {
- return this._.getUTCFullYear();
- },
- getHours: function() {
- return this._.getUTCHours();
- },
- getMilliseconds: function() {
- return this._.getUTCMilliseconds();
- },
- getMinutes: function() {
- return this._.getUTCMinutes();
- },
- getMonth: function() {
- return this._.getUTCMonth();
- },
- getSeconds: function() {
- return this._.getUTCSeconds();
- },
- getTime: function() {
- return this._.getTime();
- },
- getTimezoneOffset: function() {
- return 0;
- },
- valueOf: function() {
- return this._.valueOf();
- },
- setDate: function() {
- d3_time_prototype.setUTCDate.apply(this._, arguments);
- },
- setDay: function() {
- d3_time_prototype.setUTCDay.apply(this._, arguments);
- },
- setFullYear: function() {
- d3_time_prototype.setUTCFullYear.apply(this._, arguments);
- },
- setHours: function() {
- d3_time_prototype.setUTCHours.apply(this._, arguments);
- },
- setMilliseconds: function() {
- d3_time_prototype.setUTCMilliseconds.apply(this._, arguments);
- },
- setMinutes: function() {
- d3_time_prototype.setUTCMinutes.apply(this._, arguments);
- },
- setMonth: function() {
- d3_time_prototype.setUTCMonth.apply(this._, arguments);
- },
- setSeconds: function() {
- d3_time_prototype.setUTCSeconds.apply(this._, arguments);
- },
- setTime: function() {
- d3_time_prototype.setTime.apply(this._, arguments);
- }
- };
- var d3_time_prototype = Date.prototype;
- function d3_time_interval(local, step, number) {
- function round(date) {
- var d0 = local(date), d1 = offset(d0, 1);
- return date - d0 < d1 - date ? d0 : d1;
- }
- function ceil(date) {
- step(date = local(new d3_date(date - 1)), 1);
- return date;
- }
- function offset(date, k) {
- step(date = new d3_date(+date), k);
- return date;
- }
- function range(t0, t1, dt) {
- var time = ceil(t0), times = [];
- if (dt > 1) {
- while (time < t1) {
- if (!(number(time) % dt)) times.push(new Date(+time));
- step(time, 1);
- }
- } else {
- while (time < t1) times.push(new Date(+time)), step(time, 1);
- }
- return times;
- }
- function range_utc(t0, t1, dt) {
- try {
- d3_date = d3_date_utc;
- var utc = new d3_date_utc();
- utc._ = t0;
- return range(utc, t1, dt);
- } finally {
- d3_date = Date;
- }
- }
- local.floor = local;
- local.round = round;
- local.ceil = ceil;
- local.offset = offset;
- local.range = range;
- var utc = local.utc = d3_time_interval_utc(local);
- utc.floor = utc;
- utc.round = d3_time_interval_utc(round);
- utc.ceil = d3_time_interval_utc(ceil);
- utc.offset = d3_time_interval_utc(offset);
- utc.range = range_utc;
- return local;
- }
- function d3_time_interval_utc(method) {
- return function(date, k) {
- try {
- d3_date = d3_date_utc;
- var utc = new d3_date_utc();
- utc._ = date;
- return method(utc, k)._;
- } finally {
- d3_date = Date;
- }
- };
+};
+
+function classedAdd(node, names) {
+ var list = classList(node), i = -1, n = names.length;
+ while (++i < n) list.add(names[i]);
+}
+
+function classedRemove(node, names) {
+ var list = classList(node), i = -1, n = names.length;
+ while (++i < n) list.remove(names[i]);
+}
+
+function classedTrue(names) {
+ return function() {
+ classedAdd(this, names);
+ };
+}
+
+function classedFalse(names) {
+ return function() {
+ classedRemove(this, names);
+ };
+}
+
+function classedFunction(names, value) {
+ return function() {
+ (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);
+ };
+}
+
+function selection_classed(name, value) {
+ var names = classArray(name + "");
+
+ if (arguments.length < 2) {
+ var list = classList(this.node()), i = -1, n = names.length;
+ while (++i < n) if (!list.contains(names[i])) return false;
+ return true;
}
- d3_time.year = d3_time_interval(function(date) {
- date = d3_time.day(date);
- date.setMonth(0, 1);
- return date;
- }, function(date, offset) {
- date.setFullYear(date.getFullYear() + offset);
- }, function(date) {
- return date.getFullYear();
- });
- d3_time.years = d3_time.year.range;
- d3_time.years.utc = d3_time.year.utc.range;
- d3_time.day = d3_time_interval(function(date) {
- var day = new d3_date(2e3, 0);
- day.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());
- return day;
- }, function(date, offset) {
- date.setDate(date.getDate() + offset);
- }, function(date) {
- return date.getDate() - 1;
+
+ return this.each((typeof value === "function"
+ ? classedFunction : value
+ ? classedTrue
+ : classedFalse)(names, value));
+}
+
+function textRemove() {
+ this.textContent = "";
+}
+
+function textConstant(value) {
+ return function() {
+ this.textContent = value;
+ };
+}
+
+function textFunction(value) {
+ return function() {
+ var v = value.apply(this, arguments);
+ this.textContent = v == null ? "" : v;
+ };
+}
+
+function selection_text(value) {
+ return arguments.length
+ ? this.each(value == null
+ ? textRemove : (typeof value === "function"
+ ? textFunction
+ : textConstant)(value))
+ : this.node().textContent;
+}
+
+function htmlRemove() {
+ this.innerHTML = "";
+}
+
+function htmlConstant(value) {
+ return function() {
+ this.innerHTML = value;
+ };
+}
+
+function htmlFunction(value) {
+ return function() {
+ var v = value.apply(this, arguments);
+ this.innerHTML = v == null ? "" : v;
+ };
+}
+
+function selection_html(value) {
+ return arguments.length
+ ? this.each(value == null
+ ? htmlRemove : (typeof value === "function"
+ ? htmlFunction
+ : htmlConstant)(value))
+ : this.node().innerHTML;
+}
+
+function raise() {
+ if (this.nextSibling) this.parentNode.appendChild(this);
+}
+
+function selection_raise() {
+ return this.each(raise);
+}
+
+function lower() {
+ if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);
+}
+
+function selection_lower() {
+ return this.each(lower);
+}
+
+function selection_append(name) {
+ var create = typeof name === "function" ? name : creator(name);
+ return this.select(function() {
+ return this.appendChild(create.apply(this, arguments));
});
- d3_time.days = d3_time.day.range;
- d3_time.days.utc = d3_time.day.utc.range;
- d3_time.dayOfYear = function(date) {
- var year = d3_time.year(date);
- return Math.floor((date - year - (date.getTimezoneOffset() - year.getTimezoneOffset()) * 6e4) / 864e5);
- };
- [ "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday" ].forEach(function(day, i) {
- i = 7 - i;
- var interval = d3_time[day] = d3_time_interval(function(date) {
- (date = d3_time.day(date)).setDate(date.getDate() - (date.getDay() + i) % 7);
- return date;
- }, function(date, offset) {
- date.setDate(date.getDate() + Math.floor(offset) * 7);
- }, function(date) {
- var day = d3_time.year(date).getDay();
- return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7) - (day !== i);
- });
- d3_time[day + "s"] = interval.range;
- d3_time[day + "s"].utc = interval.utc.range;
- d3_time[day + "OfYear"] = function(date) {
- var day = d3_time.year(date).getDay();
- return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7);
- };
+}
+
+function constantNull() {
+ return null;
+}
+
+function selection_insert(name, before) {
+ var create = typeof name === "function" ? name : creator(name),
+ select = before == null ? constantNull : typeof before === "function" ? before : selector(before);
+ return this.select(function() {
+ return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);
});
- d3_time.week = d3_time.sunday;
- d3_time.weeks = d3_time.sunday.range;
- d3_time.weeks.utc = d3_time.sunday.utc.range;
- d3_time.weekOfYear = d3_time.sundayOfYear;
- function d3_locale_timeFormat(locale) {
- var locale_dateTime = locale.dateTime, locale_date = locale.date, locale_time = locale.time, locale_periods = locale.periods, locale_days = locale.days, locale_shortDays = locale.shortDays, locale_months = locale.months, locale_shortMonths = locale.shortMonths;
- function d3_time_format(template) {
- var n = template.length;
- function format(date) {
- var string = [], i = -1, j = 0, c, p, f;
- while (++i < n) {
- if (template.charCodeAt(i) === 37) {
- string.push(template.slice(j, i));
- if ((p = d3_time_formatPads[c = template.charAt(++i)]) != null) c = template.charAt(++i);
- if (f = d3_time_formats[c]) c = f(date, p == null ? c === "e" ? " " : "0" : p);
- string.push(c);
- j = i + 1;
- }
- }
- string.push(template.slice(j, i));
- return string.join("");
- }
- format.parse = function(string) {
- var d = {
- y: 1900,
- m: 0,
- d: 1,
- H: 0,
- M: 0,
- S: 0,
- L: 0,
- Z: null
- }, i = d3_time_parse(d, template, string, 0);
- if (i != string.length) return null;
- if ("p" in d) d.H = d.H % 12 + d.p * 12;
- var localZ = d.Z != null && d3_date !== d3_date_utc, date = new (localZ ? d3_date_utc : d3_date)();
- if ("j" in d) date.setFullYear(d.y, 0, d.j); else if ("w" in d && ("W" in d || "U" in d)) {
- date.setFullYear(d.y, 0, 1);
- date.setFullYear(d.y, 0, "W" in d ? (d.w + 6) % 7 + d.W * 7 - (date.getDay() + 5) % 7 : d.w + d.U * 7 - (date.getDay() + 6) % 7);
- } else date.setFullYear(d.y, d.m, d.d);
- date.setHours(d.H + (d.Z / 100 | 0), d.M + d.Z % 100, d.S, d.L);
- return localZ ? date._ : date;
- };
- format.toString = function() {
- return template;
- };
- return format;
- }
- function d3_time_parse(date, template, string, j) {
- var c, p, t, i = 0, n = template.length, m = string.length;
- while (i < n) {
- if (j >= m) return -1;
- c = template.charCodeAt(i++);
- if (c === 37) {
- t = template.charAt(i++);
- p = d3_time_parsers[t in d3_time_formatPads ? template.charAt(i++) : t];
- if (!p || (j = p(date, string, j)) < 0) return -1;
- } else if (c != string.charCodeAt(j++)) {
- return -1;
- }
- }
- return j;
- }
- d3_time_format.utc = function(template) {
- var local = d3_time_format(template);
- function format(date) {
- try {
- d3_date = d3_date_utc;
- var utc = new d3_date();
- utc._ = date;
- return local(utc);
- } finally {
- d3_date = Date;
- }
- }
- format.parse = function(string) {
- try {
- d3_date = d3_date_utc;
- var date = local.parse(string);
- return date && date._;
- } finally {
- d3_date = Date;
- }
- };
- format.toString = local.toString;
- return format;
- };
- d3_time_format.multi = d3_time_format.utc.multi = d3_time_formatMulti;
- var d3_time_periodLookup = d3.map(), d3_time_dayRe = d3_time_formatRe(locale_days), d3_time_dayLookup = d3_time_formatLookup(locale_days), d3_time_dayAbbrevRe = d3_time_formatRe(locale_shortDays), d3_time_dayAbbrevLookup = d3_time_formatLookup(locale_shortDays), d3_time_monthRe = d3_time_formatRe(locale_months), d3_time_monthLookup = d3_time_formatLookup(locale_months), d3_time_monthAbbrevRe = d3_time_formatRe(locale_shortMonths), d3_time_monthAbbrevLookup = d3_time_formatLookup(locale_shortMonths);
- locale_periods.forEach(function(p, i) {
- d3_time_periodLookup.set(p.toLowerCase(), i);
- });
- var d3_time_formats = {
- a: function(d) {
- return locale_shortDays[d.getDay()];
- },
- A: function(d) {
- return locale_days[d.getDay()];
- },
- b: function(d) {
- return locale_shortMonths[d.getMonth()];
- },
- B: function(d) {
- return locale_months[d.getMonth()];
- },
- c: d3_time_format(locale_dateTime),
- d: function(d, p) {
- return d3_time_formatPad(d.getDate(), p, 2);
- },
- e: function(d, p) {
- return d3_time_formatPad(d.getDate(), p, 2);
- },
- H: function(d, p) {
- return d3_time_formatPad(d.getHours(), p, 2);
- },
- I: function(d, p) {
- return d3_time_formatPad(d.getHours() % 12 || 12, p, 2);
- },
- j: function(d, p) {
- return d3_time_formatPad(1 + d3_time.dayOfYear(d), p, 3);
- },
- L: function(d, p) {
- return d3_time_formatPad(d.getMilliseconds(), p, 3);
- },
- m: function(d, p) {
- return d3_time_formatPad(d.getMonth() + 1, p, 2);
- },
- M: function(d, p) {
- return d3_time_formatPad(d.getMinutes(), p, 2);
- },
- p: function(d) {
- return locale_periods[+(d.getHours() >= 12)];
- },
- S: function(d, p) {
- return d3_time_formatPad(d.getSeconds(), p, 2);
- },
- U: function(d, p) {
- return d3_time_formatPad(d3_time.sundayOfYear(d), p, 2);
- },
- w: function(d) {
- return d.getDay();
- },
- W: function(d, p) {
- return d3_time_formatPad(d3_time.mondayOfYear(d), p, 2);
- },
- x: d3_time_format(locale_date),
- X: d3_time_format(locale_time),
- y: function(d, p) {
- return d3_time_formatPad(d.getFullYear() % 100, p, 2);
- },
- Y: function(d, p) {
- return d3_time_formatPad(d.getFullYear() % 1e4, p, 4);
- },
- Z: d3_time_zone,
- "%": function() {
- return "%";
- }
- };
- var d3_time_parsers = {
- a: d3_time_parseWeekdayAbbrev,
- A: d3_time_parseWeekday,
- b: d3_time_parseMonthAbbrev,
- B: d3_time_parseMonth,
- c: d3_time_parseLocaleFull,
- d: d3_time_parseDay,
- e: d3_time_parseDay,
- H: d3_time_parseHour24,
- I: d3_time_parseHour24,
- j: d3_time_parseDayOfYear,
- L: d3_time_parseMilliseconds,
- m: d3_time_parseMonthNumber,
- M: d3_time_parseMinutes,
- p: d3_time_parseAmPm,
- S: d3_time_parseSeconds,
- U: d3_time_parseWeekNumberSunday,
- w: d3_time_parseWeekdayNumber,
- W: d3_time_parseWeekNumberMonday,
- x: d3_time_parseLocaleDate,
- X: d3_time_parseLocaleTime,
- y: d3_time_parseYear,
- Y: d3_time_parseFullYear,
- Z: d3_time_parseZone,
- "%": d3_time_parseLiteralPercent
- };
- function d3_time_parseWeekdayAbbrev(date, string, i) {
- d3_time_dayAbbrevRe.lastIndex = 0;
- var n = d3_time_dayAbbrevRe.exec(string.slice(i));
- return n ? (date.w = d3_time_dayAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
- }
- function d3_time_parseWeekday(date, string, i) {
- d3_time_dayRe.lastIndex = 0;
- var n = d3_time_dayRe.exec(string.slice(i));
- return n ? (date.w = d3_time_dayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
- }
- function d3_time_parseMonthAbbrev(date, string, i) {
- d3_time_monthAbbrevRe.lastIndex = 0;
- var n = d3_time_monthAbbrevRe.exec(string.slice(i));
- return n ? (date.m = d3_time_monthAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
- }
- function d3_time_parseMonth(date, string, i) {
- d3_time_monthRe.lastIndex = 0;
- var n = d3_time_monthRe.exec(string.slice(i));
- return n ? (date.m = d3_time_monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
- }
- function d3_time_parseLocaleFull(date, string, i) {
- return d3_time_parse(date, d3_time_formats.c.toString(), string, i);
- }
- function d3_time_parseLocaleDate(date, string, i) {
- return d3_time_parse(date, d3_time_formats.x.toString(), string, i);
- }
- function d3_time_parseLocaleTime(date, string, i) {
- return d3_time_parse(date, d3_time_formats.X.toString(), string, i);
- }
- function d3_time_parseAmPm(date, string, i) {
- var n = d3_time_periodLookup.get(string.slice(i, i += 2).toLowerCase());
- return n == null ? -1 : (date.p = n, i);
- }
- return d3_time_format;
- }
- var d3_time_formatPads = {
- "-": "",
- _: " ",
- "0": "0"
- }, d3_time_numberRe = /^\s*\d+/, d3_time_percentRe = /^%/;
- function d3_time_formatPad(value, fill, width) {
- var sign = value < 0 ? "-" : "", string = (sign ? -value : value) + "", length = string.length;
- return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);
- }
- function d3_time_formatRe(names) {
- return new RegExp("^(?:" + names.map(d3.requote).join("|") + ")", "i");
- }
- function d3_time_formatLookup(names) {
- var map = new d3_Map(), i = -1, n = names.length;
- while (++i < n) map.set(names[i].toLowerCase(), i);
- return map;
- }
- function d3_time_parseWeekdayNumber(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 1));
- return n ? (date.w = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseWeekNumberSunday(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i));
- return n ? (date.U = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseWeekNumberMonday(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i));
- return n ? (date.W = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseFullYear(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 4));
- return n ? (date.y = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseYear(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 2));
- return n ? (date.y = d3_time_expandYear(+n[0]), i + n[0].length) : -1;
- }
- function d3_time_parseZone(date, string, i) {
- return /^[+-]\d{4}$/.test(string = string.slice(i, i + 5)) ? (date.Z = -string,
- i + 5) : -1;
- }
- function d3_time_expandYear(d) {
- return d + (d > 68 ? 1900 : 2e3);
- }
- function d3_time_parseMonthNumber(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 2));
- return n ? (date.m = n[0] - 1, i + n[0].length) : -1;
- }
- function d3_time_parseDay(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 2));
- return n ? (date.d = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseDayOfYear(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 3));
- return n ? (date.j = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseHour24(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 2));
- return n ? (date.H = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseMinutes(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 2));
- return n ? (date.M = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseSeconds(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 2));
- return n ? (date.S = +n[0], i + n[0].length) : -1;
- }
- function d3_time_parseMilliseconds(date, string, i) {
- d3_time_numberRe.lastIndex = 0;
- var n = d3_time_numberRe.exec(string.slice(i, i + 3));
- return n ? (date.L = +n[0], i + n[0].length) : -1;
- }
- function d3_time_zone(d) {
- var z = d.getTimezoneOffset(), zs = z > 0 ? "-" : "+", zh = abs(z) / 60 | 0, zm = abs(z) % 60;
- return zs + d3_time_formatPad(zh, "0", 2) + d3_time_formatPad(zm, "0", 2);
- }
- function d3_time_parseLiteralPercent(date, string, i) {
- d3_time_percentRe.lastIndex = 0;
- var n = d3_time_percentRe.exec(string.slice(i, i + 1));
- return n ? i + n[0].length : -1;
- }
- function d3_time_formatMulti(formats) {
- var n = formats.length, i = -1;
- while (++i < n) formats[i][0] = this(formats[i][0]);
- return function(date) {
- var i = 0, f = formats[i];
- while (!f[1](date)) f = formats[++i];
- return f[0](date);
- };
+}
+
+function remove() {
+ var parent = this.parentNode;
+ if (parent) parent.removeChild(this);
+}
+
+function selection_remove() {
+ return this.each(remove);
+}
+
+function selection_cloneShallow() {
+ return this.parentNode.insertBefore(this.cloneNode(false), this.nextSibling);
+}
+
+function selection_cloneDeep() {
+ return this.parentNode.insertBefore(this.cloneNode(true), this.nextSibling);
+}
+
+function selection_clone(deep) {
+ return this.select(deep ? selection_cloneDeep : selection_cloneShallow);
+}
+
+function selection_datum(value) {
+ return arguments.length
+ ? this.property("__data__", value)
+ : this.node().__data__;
+}
+
+var filterEvents = {};
+
+exports.event = null;
+
+if (typeof document !== "undefined") {
+ var element = document.documentElement;
+ if (!("onmouseenter" in element)) {
+ filterEvents = {mouseenter: "mouseover", mouseleave: "mouseout"};
}
- d3.locale = function(locale) {
- return {
- numberFormat: d3_locale_numberFormat(locale),
- timeFormat: d3_locale_timeFormat(locale)
- };
- };
- var d3_locale_enUS = d3.locale({
- decimal: ".",
- thousands: ",",
- grouping: [ 3 ],
- currency: [ "$", "" ],
- dateTime: "%a %b %e %X %Y",
- date: "%m/%d/%Y",
- time: "%H:%M:%S",
- periods: [ "AM", "PM" ],
- days: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ],
- shortDays: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ],
- months: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ],
- shortMonths: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]
- });
- d3.format = d3_locale_enUS.numberFormat;
- d3.geo = {};
- function d3_adder() {}
- d3_adder.prototype = {
- s: 0,
- t: 0,
- add: function(y) {
- d3_adderSum(y, this.t, d3_adderTemp);
- d3_adderSum(d3_adderTemp.s, this.s, this);
- if (this.s) this.t += d3_adderTemp.t; else this.s = d3_adderTemp.t;
- },
- reset: function() {
- this.s = this.t = 0;
- },
- valueOf: function() {
- return this.s;
+}
+
+function filterContextListener(listener, index, group) {
+ listener = contextListener(listener, index, group);
+ return function(event) {
+ var related = event.relatedTarget;
+ if (!related || (related !== this && !(related.compareDocumentPosition(this) & 8))) {
+ listener.call(this, event);
}
};
- var d3_adderTemp = new d3_adder();
- function d3_adderSum(a, b, o) {
- var x = o.s = a + b, bv = x - a, av = x - bv;
- o.t = a - av + (b - bv);
- }
- d3.geo.stream = function(object, listener) {
- if (object && d3_geo_streamObjectType.hasOwnProperty(object.type)) {
- d3_geo_streamObjectType[object.type](object, listener);
- } else {
- d3_geo_streamGeometry(object, listener);
+}
+
+function contextListener(listener, index, group) {
+ return function(event1) {
+ var event0 = exports.event; // Events can be reentrant (e.g., focus).
+ exports.event = event1;
+ try {
+ listener.call(this, this.__data__, index, group);
+ } finally {
+ exports.event = event0;
}
};
- function d3_geo_streamGeometry(geometry, listener) {
- if (geometry && d3_geo_streamGeometryType.hasOwnProperty(geometry.type)) {
- d3_geo_streamGeometryType[geometry.type](geometry, listener);
+}
+
+function parseTypenames$1(typenames) {
+ return typenames.trim().split(/^|\s+/).map(function(t) {
+ var name = "", i = t.indexOf(".");
+ if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);
+ return {type: t, name: name};
+ });
+}
+
+function onRemove(typename) {
+ return function() {
+ var on = this.__on;
+ if (!on) return;
+ for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {
+ if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {
+ this.removeEventListener(o.type, o.listener, o.capture);
+ } else {
+ on[++i] = o;
+ }
}
- }
- var d3_geo_streamObjectType = {
- Feature: function(feature, listener) {
- d3_geo_streamGeometry(feature.geometry, listener);
- },
- FeatureCollection: function(object, listener) {
- var features = object.features, i = -1, n = features.length;
- while (++i < n) d3_geo_streamGeometry(features[i].geometry, listener);
+ if (++i) on.length = i;
+ else delete this.__on;
+ };
+}
+
+function onAdd(typename, value, capture) {
+ var wrap = filterEvents.hasOwnProperty(typename.type) ? filterContextListener : contextListener;
+ return function(d, i, group) {
+ var on = this.__on, o, listener = wrap(value, i, group);
+ if (on) for (var j = 0, m = on.length; j < m; ++j) {
+ if ((o = on[j]).type === typename.type && o.name === typename.name) {
+ this.removeEventListener(o.type, o.listener, o.capture);
+ this.addEventListener(o.type, o.listener = listener, o.capture = capture);
+ o.value = value;
+ return;
+ }
}
+ this.addEventListener(typename.type, listener, capture);
+ o = {type: typename.type, name: typename.name, value: value, listener: listener, capture: capture};
+ if (!on) this.__on = [o];
+ else on.push(o);
};
- var d3_geo_streamGeometryType = {
- Sphere: function(object, listener) {
- listener.sphere();
- },
- Point: function(object, listener) {
- object = object.coordinates;
- listener.point(object[0], object[1], object[2]);
- },
- MultiPoint: function(object, listener) {
- var coordinates = object.coordinates, i = -1, n = coordinates.length;
- while (++i < n) object = coordinates[i], listener.point(object[0], object[1], object[2]);
- },
- LineString: function(object, listener) {
- d3_geo_streamLine(object.coordinates, listener, 0);
- },
- MultiLineString: function(object, listener) {
- var coordinates = object.coordinates, i = -1, n = coordinates.length;
- while (++i < n) d3_geo_streamLine(coordinates[i], listener, 0);
- },
- Polygon: function(object, listener) {
- d3_geo_streamPolygon(object.coordinates, listener);
- },
- MultiPolygon: function(object, listener) {
- var coordinates = object.coordinates, i = -1, n = coordinates.length;
- while (++i < n) d3_geo_streamPolygon(coordinates[i], listener);
- },
- GeometryCollection: function(object, listener) {
- var geometries = object.geometries, i = -1, n = geometries.length;
- while (++i < n) d3_geo_streamGeometry(geometries[i], listener);
- }
- };
- function d3_geo_streamLine(coordinates, listener, closed) {
- var i = -1, n = coordinates.length - closed, coordinate;
- listener.lineStart();
- while (++i < n) coordinate = coordinates[i], listener.point(coordinate[0], coordinate[1], coordinate[2]);
- listener.lineEnd();
- }
- function d3_geo_streamPolygon(coordinates, listener) {
- var i = -1, n = coordinates.length;
- listener.polygonStart();
- while (++i < n) d3_geo_streamLine(coordinates[i], listener, 1);
- listener.polygonEnd();
- }
- d3.geo.area = function(object) {
- d3_geo_areaSum = 0;
- d3.geo.stream(object, d3_geo_area);
- return d3_geo_areaSum;
- };
- var d3_geo_areaSum, d3_geo_areaRingSum = new d3_adder();
- var d3_geo_area = {
- sphere: function() {
- d3_geo_areaSum += 4 * π;
- },
- point: d3_noop,
- lineStart: d3_noop,
- lineEnd: d3_noop,
- polygonStart: function() {
- d3_geo_areaRingSum.reset();
- d3_geo_area.lineStart = d3_geo_areaRingStart;
- },
- polygonEnd: function() {
- var area = 2 * d3_geo_areaRingSum;
- d3_geo_areaSum += area < 0 ? 4 * π + area : area;
- d3_geo_area.lineStart = d3_geo_area.lineEnd = d3_geo_area.point = d3_noop;
- }
- };
- function d3_geo_areaRingStart() {
- var λ00, φ00, λ0, cosφ0, sinφ0;
- d3_geo_area.point = function(λ, φ) {
- d3_geo_area.point = nextPoint;
- λ0 = (λ00 = λ) * d3_radians, cosφ0 = Math.cos(φ = (φ00 = φ) * d3_radians / 2 + π / 4),
- sinφ0 = Math.sin(φ);
- };
- function nextPoint(λ, φ) {
- λ *= d3_radians;
- φ = φ * d3_radians / 2 + π / 4;
- var dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, cosφ = Math.cos(φ), sinφ = Math.sin(φ), k = sinφ0 * sinφ, u = cosφ0 * cosφ + k * Math.cos(adλ), v = k * sdλ * Math.sin(adλ);
- d3_geo_areaRingSum.add(Math.atan2(v, u));
- λ0 = λ, cosφ0 = cosφ, sinφ0 = sinφ;
- }
- d3_geo_area.lineEnd = function() {
- nextPoint(λ00, φ00);
- };
- }
- function d3_geo_cartesian(spherical) {
- var λ = spherical[0], φ = spherical[1], cosφ = Math.cos(φ);
- return [ cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ) ];
+}
+
+function selection_on(typename, value, capture) {
+ var typenames = parseTypenames$1(typename + ""), i, n = typenames.length, t;
+
+ if (arguments.length < 2) {
+ var on = this.node().__on;
+ if (on) for (var j = 0, m = on.length, o; j < m; ++j) {
+ for (i = 0, o = on[j]; i < n; ++i) {
+ if ((t = typenames[i]).type === o.type && t.name === o.name) {
+ return o.value;
+ }
+ }
+ }
+ return;
}
- function d3_geo_cartesianDot(a, b) {
- return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
+
+ on = value ? onAdd : onRemove;
+ if (capture == null) capture = false;
+ for (i = 0; i < n; ++i) this.each(on(typenames[i], value, capture));
+ return this;
+}
+
+function customEvent(event1, listener, that, args) {
+ var event0 = exports.event;
+ event1.sourceEvent = exports.event;
+ exports.event = event1;
+ try {
+ return listener.apply(that, args);
+ } finally {
+ exports.event = event0;
}
- function d3_geo_cartesianCross(a, b) {
- return [ a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0] ];
+}
+
+function dispatchEvent(node, type, params) {
+ var window = defaultView(node),
+ event = window.CustomEvent;
+
+ if (typeof event === "function") {
+ event = new event(type, params);
+ } else {
+ event = window.document.createEvent("Event");
+ if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;
+ else event.initEvent(type, false, false);
}
- function d3_geo_cartesianAdd(a, b) {
- a[0] += b[0];
- a[1] += b[1];
- a[2] += b[2];
+
+ node.dispatchEvent(event);
+}
+
+function dispatchConstant(type, params) {
+ return function() {
+ return dispatchEvent(this, type, params);
+ };
+}
+
+function dispatchFunction(type, params) {
+ return function() {
+ return dispatchEvent(this, type, params.apply(this, arguments));
+ };
+}
+
+function selection_dispatch(type, params) {
+ return this.each((typeof params === "function"
+ ? dispatchFunction
+ : dispatchConstant)(type, params));
+}
+
+var root = [null];
+
+function Selection(groups, parents) {
+ this._groups = groups;
+ this._parents = parents;
+}
+
+function selection() {
+ return new Selection([[document.documentElement]], root);
+}
+
+Selection.prototype = selection.prototype = {
+ constructor: Selection,
+ select: selection_select,
+ selectAll: selection_selectAll,
+ filter: selection_filter,
+ data: selection_data,
+ enter: selection_enter,
+ exit: selection_exit,
+ join: selection_join,
+ merge: selection_merge,
+ order: selection_order,
+ sort: selection_sort,
+ call: selection_call,
+ nodes: selection_nodes,
+ node: selection_node,
+ size: selection_size,
+ empty: selection_empty,
+ each: selection_each,
+ attr: selection_attr,
+ style: selection_style,
+ property: selection_property,
+ classed: selection_classed,
+ text: selection_text,
+ html: selection_html,
+ raise: selection_raise,
+ lower: selection_lower,
+ append: selection_append,
+ insert: selection_insert,
+ remove: selection_remove,
+ clone: selection_clone,
+ datum: selection_datum,
+ on: selection_on,
+ dispatch: selection_dispatch
+};
+
+function select(selector) {
+ return typeof selector === "string"
+ ? new Selection([[document.querySelector(selector)]], [document.documentElement])
+ : new Selection([[selector]], root);
+}
+
+function create(name) {
+ return select(creator(name).call(document.documentElement));
+}
+
+var nextId = 0;
+
+function local() {
+ return new Local;
+}
+
+function Local() {
+ this._ = "@" + (++nextId).toString(36);
+}
+
+Local.prototype = local.prototype = {
+ constructor: Local,
+ get: function(node) {
+ var id = this._;
+ while (!(id in node)) if (!(node = node.parentNode)) return;
+ return node[id];
+ },
+ set: function(node, value) {
+ return node[this._] = value;
+ },
+ remove: function(node) {
+ return this._ in node && delete node[this._];
+ },
+ toString: function() {
+ return this._;
+ }
+};
+
+function sourceEvent() {
+ var current = exports.event, source;
+ while (source = current.sourceEvent) current = source;
+ return current;
+}
+
+function point(node, event) {
+ var svg = node.ownerSVGElement || node;
+
+ if (svg.createSVGPoint) {
+ var point = svg.createSVGPoint();
+ point.x = event.clientX, point.y = event.clientY;
+ point = point.matrixTransform(node.getScreenCTM().inverse());
+ return [point.x, point.y];
}
- function d3_geo_cartesianScale(vector, k) {
- return [ vector[0] * k, vector[1] * k, vector[2] * k ];
+
+ var rect = node.getBoundingClientRect();
+ return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];
+}
+
+function mouse(node) {
+ var event = sourceEvent();
+ if (event.changedTouches) event = event.changedTouches[0];
+ return point(node, event);
+}
+
+function selectAll(selector) {
+ return typeof selector === "string"
+ ? new Selection([document.querySelectorAll(selector)], [document.documentElement])
+ : new Selection([selector == null ? [] : selector], root);
+}
+
+function touch(node, touches, identifier) {
+ if (arguments.length < 3) identifier = touches, touches = sourceEvent().changedTouches;
+
+ for (var i = 0, n = touches ? touches.length : 0, touch; i < n; ++i) {
+ if ((touch = touches[i]).identifier === identifier) {
+ return point(node, touch);
+ }
}
- function d3_geo_cartesianNormalize(d) {
- var l = Math.sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);
- d[0] /= l;
- d[1] /= l;
- d[2] /= l;
+
+ return null;
+}
+
+function touches(node, touches) {
+ if (touches == null) touches = sourceEvent().touches;
+
+ for (var i = 0, n = touches ? touches.length : 0, points = new Array(n); i < n; ++i) {
+ points[i] = point(node, touches[i]);
}
- function d3_geo_spherical(cartesian) {
- return [ Math.atan2(cartesian[1], cartesian[0]), d3_asin(cartesian[2]) ];
+
+ return points;
+}
+
+function nopropagation() {
+ exports.event.stopImmediatePropagation();
+}
+
+function noevent() {
+ exports.event.preventDefault();
+ exports.event.stopImmediatePropagation();
+}
+
+function dragDisable(view) {
+ var root = view.document.documentElement,
+ selection$$1 = select(view).on("dragstart.drag", noevent, true);
+ if ("onselectstart" in root) {
+ selection$$1.on("selectstart.drag", noevent, true);
+ } else {
+ root.__noselect = root.style.MozUserSelect;
+ root.style.MozUserSelect = "none";
+ }
+}
+
+function yesdrag(view, noclick) {
+ var root = view.document.documentElement,
+ selection$$1 = select(view).on("dragstart.drag", null);
+ if (noclick) {
+ selection$$1.on("click.drag", noevent, true);
+ setTimeout(function() { selection$$1.on("click.drag", null); }, 0);
+ }
+ if ("onselectstart" in root) {
+ selection$$1.on("selectstart.drag", null);
+ } else {
+ root.style.MozUserSelect = root.__noselect;
+ delete root.__noselect;
+ }
+}
+
+function constant$2(x) {
+ return function() {
+ return x;
+ };
+}
+
+function DragEvent(target, type, subject, id, active, x, y, dx, dy, dispatch) {
+ this.target = target;
+ this.type = type;
+ this.subject = subject;
+ this.identifier = id;
+ this.active = active;
+ this.x = x;
+ this.y = y;
+ this.dx = dx;
+ this.dy = dy;
+ this._ = dispatch;
+}
+
+DragEvent.prototype.on = function() {
+ var value = this._.on.apply(this._, arguments);
+ return value === this._ ? this : value;
+};
+
+// Ignore right-click, since that should open the context menu.
+function defaultFilter() {
+ return !exports.event.button;
+}
+
+function defaultContainer() {
+ return this.parentNode;
+}
+
+function defaultSubject(d) {
+ return d == null ? {x: exports.event.x, y: exports.event.y} : d;
+}
+
+function defaultTouchable() {
+ return "ontouchstart" in this;
+}
+
+function drag() {
+ var filter = defaultFilter,
+ container = defaultContainer,
+ subject = defaultSubject,
+ touchable = defaultTouchable,
+ gestures = {},
+ listeners = dispatch("start", "drag", "end"),
+ active = 0,
+ mousedownx,
+ mousedowny,
+ mousemoving,
+ touchending,
+ clickDistance2 = 0;
+
+ function drag(selection$$1) {
+ selection$$1
+ .on("mousedown.drag", mousedowned)
+ .filter(touchable)
+ .on("touchstart.drag", touchstarted)
+ .on("touchmove.drag", touchmoved)
+ .on("touchend.drag touchcancel.drag", touchended)
+ .style("touch-action", "none")
+ .style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
}
- function d3_geo_sphericalEqual(a, b) {
- return abs(a[0] - b[0]) < ε && abs(a[1] - b[1]) < ε;
+
+ function mousedowned() {
+ if (touchending || !filter.apply(this, arguments)) return;
+ var gesture = beforestart("mouse", container.apply(this, arguments), mouse, this, arguments);
+ if (!gesture) return;
+ select(exports.event.view).on("mousemove.drag", mousemoved, true).on("mouseup.drag", mouseupped, true);
+ dragDisable(exports.event.view);
+ nopropagation();
+ mousemoving = false;
+ mousedownx = exports.event.clientX;
+ mousedowny = exports.event.clientY;
+ gesture("start");
}
- d3.geo.bounds = function() {
- var λ0, φ0, λ1, φ1, λ_, λ__, φ__, p0, dλSum, ranges, range;
- var bound = {
- point: point,
- lineStart: lineStart,
- lineEnd: lineEnd,
- polygonStart: function() {
- bound.point = ringPoint;
- bound.lineStart = ringStart;
- bound.lineEnd = ringEnd;
- dλSum = 0;
- d3_geo_area.polygonStart();
- },
- polygonEnd: function() {
- d3_geo_area.polygonEnd();
- bound.point = point;
- bound.lineStart = lineStart;
- bound.lineEnd = lineEnd;
- if (d3_geo_areaRingSum < 0) λ0 = -(λ1 = 180), φ0 = -(φ1 = 90); else if (dλSum > ε) φ1 = 90; else if (dλSum < -ε) φ0 = -90;
- range[0] = λ0, range[1] = λ1;
- }
- };
- function point(λ, φ) {
- ranges.push(range = [ λ0 = λ, λ1 = λ ]);
- if (φ < φ0) φ0 = φ;
- if (φ > φ1) φ1 = φ;
- }
- function linePoint(λ, φ) {
- var p = d3_geo_cartesian([ λ * d3_radians, φ * d3_radians ]);
- if (p0) {
- var normal = d3_geo_cartesianCross(p0, p), equatorial = [ normal[1], -normal[0], 0 ], inflection = d3_geo_cartesianCross(equatorial, normal);
- d3_geo_cartesianNormalize(inflection);
- inflection = d3_geo_spherical(inflection);
- var dλ = λ - λ_, s = dλ > 0 ? 1 : -1, λi = inflection[0] * d3_degrees * s, antimeridian = abs(dλ) > 180;
- if (antimeridian ^ (s * λ_ < λi && λi < s * λ)) {
- var φi = inflection[1] * d3_degrees;
- if (φi > φ1) φ1 = φi;
- } else if (λi = (λi + 360) % 360 - 180, antimeridian ^ (s * λ_ < λi && λi < s * λ)) {
- var φi = -inflection[1] * d3_degrees;
- if (φi < φ0) φ0 = φi;
- } else {
- if (φ < φ0) φ0 = φ;
- if (φ > φ1) φ1 = φ;
- }
- if (antimeridian) {
- if (λ < λ_) {
- if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ;
- } else {
- if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ;
- }
- } else {
- if (λ1 >= λ0) {
- if (λ < λ0) λ0 = λ;
- if (λ > λ1) λ1 = λ;
- } else {
- if (λ > λ_) {
- if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ;
- } else {
- if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ;
- }
- }
- }
- } else {
- point(λ, φ);
- }
- p0 = p, λ_ = λ;
- }
- function lineStart() {
- bound.point = linePoint;
- }
- function lineEnd() {
- range[0] = λ0, range[1] = λ1;
- bound.point = point;
- p0 = null;
- }
- function ringPoint(λ, φ) {
- if (p0) {
- var dλ = λ - λ_;
- dλSum += abs(dλ) > 180 ? dλ + (dλ > 0 ? 360 : -360) : dλ;
- } else λ__ = λ, φ__ = φ;
- d3_geo_area.point(λ, φ);
- linePoint(λ, φ);
- }
- function ringStart() {
- d3_geo_area.lineStart();
+
+ function mousemoved() {
+ noevent();
+ if (!mousemoving) {
+ var dx = exports.event.clientX - mousedownx, dy = exports.event.clientY - mousedowny;
+ mousemoving = dx * dx + dy * dy > clickDistance2;
}
- function ringEnd() {
- ringPoint(λ__, φ__);
- d3_geo_area.lineEnd();
- if (abs(dλSum) > ε) λ0 = -(λ1 = 180);
- range[0] = λ0, range[1] = λ1;
- p0 = null;
- }
- function angle(λ0, λ1) {
- return (λ1 -= λ0) < 0 ? λ1 + 360 : λ1;
- }
- function compareRanges(a, b) {
- return a[0] - b[0];
- }
- function withinRange(x, range) {
- return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;
- }
- return function(feature) {
- φ1 = λ1 = -(λ0 = φ0 = Infinity);
- ranges = [];
- d3.geo.stream(feature, bound);
- var n = ranges.length;
- if (n) {
- ranges.sort(compareRanges);
- for (var i = 1, a = ranges[0], b, merged = [ a ]; i < n; ++i) {
- b = ranges[i];
- if (withinRange(b[0], a) || withinRange(b[1], a)) {
- if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1];
- if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0];
- } else {
- merged.push(a = b);
- }
- }
- var best = -Infinity, dλ;
- for (var n = merged.length - 1, i = 0, a = merged[n], b; i <= n; a = b, ++i) {
- b = merged[i];
- if ((dλ = angle(a[1], b[0])) > best) best = dλ, λ0 = b[0], λ1 = a[1];
- }
- }
- ranges = range = null;
- return λ0 === Infinity || φ0 === Infinity ? [ [ NaN, NaN ], [ NaN, NaN ] ] : [ [ λ0, φ0 ], [ λ1, φ1 ] ];
- };
- }();
- d3.geo.centroid = function(object) {
- d3_geo_centroidW0 = d3_geo_centroidW1 = d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0;
- d3.geo.stream(object, d3_geo_centroid);
- var x = d3_geo_centroidX2, y = d3_geo_centroidY2, z = d3_geo_centroidZ2, m = x * x + y * y + z * z;
- if (m < ε2) {
- x = d3_geo_centroidX1, y = d3_geo_centroidY1, z = d3_geo_centroidZ1;
- if (d3_geo_centroidW1 < ε) x = d3_geo_centroidX0, y = d3_geo_centroidY0, z = d3_geo_centroidZ0;
- m = x * x + y * y + z * z;
- if (m < ε2) return [ NaN, NaN ];
- }
- return [ Math.atan2(y, x) * d3_degrees, d3_asin(z / Math.sqrt(m)) * d3_degrees ];
- };
- var d3_geo_centroidW0, d3_geo_centroidW1, d3_geo_centroidX0, d3_geo_centroidY0, d3_geo_centroidZ0, d3_geo_centroidX1, d3_geo_centroidY1, d3_geo_centroidZ1, d3_geo_centroidX2, d3_geo_centroidY2, d3_geo_centroidZ2;
- var d3_geo_centroid = {
- sphere: d3_noop,
- point: d3_geo_centroidPoint,
- lineStart: d3_geo_centroidLineStart,
- lineEnd: d3_geo_centroidLineEnd,
- polygonStart: function() {
- d3_geo_centroid.lineStart = d3_geo_centroidRingStart;
- },
- polygonEnd: function() {
- d3_geo_centroid.lineStart = d3_geo_centroidLineStart;
- }
- };
- function d3_geo_centroidPoint(λ, φ) {
- λ *= d3_radians;
- var cosφ = Math.cos(φ *= d3_radians);
- d3_geo_centroidPointXYZ(cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ));
- }
- function d3_geo_centroidPointXYZ(x, y, z) {
- ++d3_geo_centroidW0;
- d3_geo_centroidX0 += (x - d3_geo_centroidX0) / d3_geo_centroidW0;
- d3_geo_centroidY0 += (y - d3_geo_centroidY0) / d3_geo_centroidW0;
- d3_geo_centroidZ0 += (z - d3_geo_centroidZ0) / d3_geo_centroidW0;
- }
- function d3_geo_centroidLineStart() {
- var x0, y0, z0;
- d3_geo_centroid.point = function(λ, φ) {
- λ *= d3_radians;
- var cosφ = Math.cos(φ *= d3_radians);
- x0 = cosφ * Math.cos(λ);
- y0 = cosφ * Math.sin(λ);
- z0 = Math.sin(φ);
- d3_geo_centroid.point = nextPoint;
- d3_geo_centroidPointXYZ(x0, y0, z0);
- };
- function nextPoint(λ, φ) {
- λ *= d3_radians;
- var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), w = Math.atan2(Math.sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z);
- d3_geo_centroidW1 += w;
- d3_geo_centroidX1 += w * (x0 + (x0 = x));
- d3_geo_centroidY1 += w * (y0 + (y0 = y));
- d3_geo_centroidZ1 += w * (z0 + (z0 = z));
- d3_geo_centroidPointXYZ(x0, y0, z0);
- }
- }
- function d3_geo_centroidLineEnd() {
- d3_geo_centroid.point = d3_geo_centroidPoint;
- }
- function d3_geo_centroidRingStart() {
- var λ00, φ00, x0, y0, z0;
- d3_geo_centroid.point = function(λ, φ) {
- λ00 = λ, φ00 = φ;
- d3_geo_centroid.point = nextPoint;
- λ *= d3_radians;
- var cosφ = Math.cos(φ *= d3_radians);
- x0 = cosφ * Math.cos(λ);
- y0 = cosφ * Math.sin(λ);
- z0 = Math.sin(φ);
- d3_geo_centroidPointXYZ(x0, y0, z0);
- };
- d3_geo_centroid.lineEnd = function() {
- nextPoint(λ00, φ00);
- d3_geo_centroid.lineEnd = d3_geo_centroidLineEnd;
- d3_geo_centroid.point = d3_geo_centroidPoint;
- };
- function nextPoint(λ, φ) {
- λ *= d3_radians;
- var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), cx = y0 * z - z0 * y, cy = z0 * x - x0 * z, cz = x0 * y - y0 * x, m = Math.sqrt(cx * cx + cy * cy + cz * cz), u = x0 * x + y0 * y + z0 * z, v = m && -d3_acos(u) / m, w = Math.atan2(m, u);
- d3_geo_centroidX2 += v * cx;
- d3_geo_centroidY2 += v * cy;
- d3_geo_centroidZ2 += v * cz;
- d3_geo_centroidW1 += w;
- d3_geo_centroidX1 += w * (x0 + (x0 = x));
- d3_geo_centroidY1 += w * (y0 + (y0 = y));
- d3_geo_centroidZ1 += w * (z0 + (z0 = z));
- d3_geo_centroidPointXYZ(x0, y0, z0);
- }
- }
- function d3_true() {
- return true;
+ gestures.mouse("drag");
}
- function d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener) {
- var subject = [], clip = [];
- segments.forEach(function(segment) {
- if ((n = segment.length - 1) <= 0) return;
- var n, p0 = segment[0], p1 = segment[n];
- if (d3_geo_sphericalEqual(p0, p1)) {
- listener.lineStart();
- for (var i = 0; i < n; ++i) listener.point((p0 = segment[i])[0], p0[1]);
- listener.lineEnd();
- return;
+
+ function mouseupped() {
+ select(exports.event.view).on("mousemove.drag mouseup.drag", null);
+ yesdrag(exports.event.view, mousemoving);
+ noevent();
+ gestures.mouse("end");
+ }
+
+ function touchstarted() {
+ if (!filter.apply(this, arguments)) return;
+ var touches$$1 = exports.event.changedTouches,
+ c = container.apply(this, arguments),
+ n = touches$$1.length, i, gesture;
+
+ for (i = 0; i < n; ++i) {
+ if (gesture = beforestart(touches$$1[i].identifier, c, touch, this, arguments)) {
+ nopropagation();
+ gesture("start");
}
- var a = new d3_geo_clipPolygonIntersection(p0, segment, null, true), b = new d3_geo_clipPolygonIntersection(p0, null, a, false);
- a.o = b;
- subject.push(a);
- clip.push(b);
- a = new d3_geo_clipPolygonIntersection(p1, segment, null, false);
- b = new d3_geo_clipPolygonIntersection(p1, null, a, true);
- a.o = b;
- subject.push(a);
- clip.push(b);
- });
- clip.sort(compare);
- d3_geo_clipPolygonLinkCircular(subject);
- d3_geo_clipPolygonLinkCircular(clip);
- if (!subject.length) return;
- for (var i = 0, entry = clipStartInside, n = clip.length; i < n; ++i) {
- clip[i].e = entry = !entry;
- }
- var start = subject[0], points, point;
- while (1) {
- var current = start, isSubject = true;
- while (current.v) if ((current = current.n) === start) return;
- points = current.z;
- listener.lineStart();
- do {
- current.v = current.o.v = true;
- if (current.e) {
- if (isSubject) {
- for (var i = 0, n = points.length; i < n; ++i) listener.point((point = points[i])[0], point[1]);
- } else {
- interpolate(current.x, current.n.x, 1, listener);
- }
- current = current.n;
- } else {
- if (isSubject) {
- points = current.p.z;
- for (var i = points.length - 1; i >= 0; --i) listener.point((point = points[i])[0], point[1]);
- } else {
- interpolate(current.x, current.p.x, -1, listener);
- }
- current = current.p;
- }
- current = current.o;
- points = current.z;
- isSubject = !isSubject;
- } while (!current.v);
- listener.lineEnd();
}
}
- function d3_geo_clipPolygonLinkCircular(array) {
- if (!(n = array.length)) return;
- var n, i = 0, a = array[0], b;
- while (++i < n) {
- a.n = b = array[i];
- b.p = a;
- a = b;
+
+ function touchmoved() {
+ var touches$$1 = exports.event.changedTouches,
+ n = touches$$1.length, i, gesture;
+
+ for (i = 0; i < n; ++i) {
+ if (gesture = gestures[touches$$1[i].identifier]) {
+ noevent();
+ gesture("drag");
+ }
}
- a.n = b = array[0];
- b.p = a;
}
- function d3_geo_clipPolygonIntersection(point, points, other, entry) {
- this.x = point;
- this.z = points;
- this.o = other;
- this.e = entry;
- this.v = false;
- this.n = this.p = null;
- }
- function d3_geo_clip(pointVisible, clipLine, interpolate, clipStart) {
- return function(rotate, listener) {
- var line = clipLine(listener), rotatedClipStart = rotate.invert(clipStart[0], clipStart[1]);
- var clip = {
- point: point,
- lineStart: lineStart,
- lineEnd: lineEnd,
- polygonStart: function() {
- clip.point = pointRing;
- clip.lineStart = ringStart;
- clip.lineEnd = ringEnd;
- segments = [];
- polygon = [];
- },
- polygonEnd: function() {
- clip.point = point;
- clip.lineStart = lineStart;
- clip.lineEnd = lineEnd;
- segments = d3.merge(segments);
- var clipStartInside = d3_geo_pointInPolygon(rotatedClipStart, polygon);
- if (segments.length) {
- if (!polygonStarted) listener.polygonStart(), polygonStarted = true;
- d3_geo_clipPolygon(segments, d3_geo_clipSort, clipStartInside, interpolate, listener);
- } else if (clipStartInside) {
- if (!polygonStarted) listener.polygonStart(), polygonStarted = true;
- listener.lineStart();
- interpolate(null, null, 1, listener);
- listener.lineEnd();
- }
- if (polygonStarted) listener.polygonEnd(), polygonStarted = false;
- segments = polygon = null;
- },
- sphere: function() {
- listener.polygonStart();
- listener.lineStart();
- interpolate(null, null, 1, listener);
- listener.lineEnd();
- listener.polygonEnd();
- }
- };
- function point(λ, φ) {
- var point = rotate(λ, φ);
- if (pointVisible(λ = point[0], φ = point[1])) listener.point(λ, φ);
- }
- function pointLine(λ, φ) {
- var point = rotate(λ, φ);
- line.point(point[0], point[1]);
- }
- function lineStart() {
- clip.point = pointLine;
- line.lineStart();
- }
- function lineEnd() {
- clip.point = point;
- line.lineEnd();
- }
- var segments;
- var buffer = d3_geo_clipBufferListener(), ringListener = clipLine(buffer), polygonStarted = false, polygon, ring;
- function pointRing(λ, φ) {
- ring.push([ λ, φ ]);
- var point = rotate(λ, φ);
- ringListener.point(point[0], point[1]);
- }
- function ringStart() {
- ringListener.lineStart();
- ring = [];
- }
- function ringEnd() {
- pointRing(ring[0][0], ring[0][1]);
- ringListener.lineEnd();
- var clean = ringListener.clean(), ringSegments = buffer.buffer(), segment, n = ringSegments.length;
- ring.pop();
- polygon.push(ring);
- ring = null;
- if (!n) return;
- if (clean & 1) {
- segment = ringSegments[0];
- var n = segment.length - 1, i = -1, point;
- if (n > 0) {
- if (!polygonStarted) listener.polygonStart(), polygonStarted = true;
- listener.lineStart();
- while (++i < n) listener.point((point = segment[i])[0], point[1]);
- listener.lineEnd();
- }
- return;
- }
- if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));
- segments.push(ringSegments.filter(d3_geo_clipSegmentLength1));
+
+ function touchended() {
+ var touches$$1 = exports.event.changedTouches,
+ n = touches$$1.length, i, gesture;
+
+ if (touchending) clearTimeout(touchending);
+ touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed!
+ for (i = 0; i < n; ++i) {
+ if (gesture = gestures[touches$$1[i].identifier]) {
+ nopropagation();
+ gesture("end");
}
- return clip;
- };
- }
- function d3_geo_clipSegmentLength1(segment) {
- return segment.length > 1;
+ }
}
- function d3_geo_clipBufferListener() {
- var lines = [], line;
- return {
- lineStart: function() {
- lines.push(line = []);
- },
- point: function(λ, φ) {
- line.push([ λ, φ ]);
- },
- lineEnd: d3_noop,
- buffer: function() {
- var buffer = lines;
- lines = [];
- line = null;
- return buffer;
- },
- rejoin: function() {
- if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));
+
+ function beforestart(id, container, point$$1, that, args) {
+ var p = point$$1(container, id), s, dx, dy,
+ sublisteners = listeners.copy();
+
+ if (!customEvent(new DragEvent(drag, "beforestart", s, id, active, p[0], p[1], 0, 0, sublisteners), function() {
+ if ((exports.event.subject = s = subject.apply(that, args)) == null) return false;
+ dx = s.x - p[0] || 0;
+ dy = s.y - p[1] || 0;
+ return true;
+ })) return;
+
+ return function gesture(type) {
+ var p0 = p, n;
+ switch (type) {
+ case "start": gestures[id] = gesture, n = active++; break;
+ case "end": delete gestures[id], --active; // nobreak
+ case "drag": p = point$$1(container, id), n = active; break;
}
+ customEvent(new DragEvent(drag, type, s, id, n, p[0] + dx, p[1] + dy, p[0] - p0[0], p[1] - p0[1], sublisteners), sublisteners.apply, sublisteners, [type, that, args]);
};
}
- function d3_geo_clipSort(a, b) {
- return ((a = a.x)[0] < 0 ? a[1] - halfπ - ε : halfπ - a[1]) - ((b = b.x)[0] < 0 ? b[1] - halfπ - ε : halfπ - b[1]);
+
+ drag.filter = function(_) {
+ return arguments.length ? (filter = typeof _ === "function" ? _ : constant$2(!!_), drag) : filter;
+ };
+
+ drag.container = function(_) {
+ return arguments.length ? (container = typeof _ === "function" ? _ : constant$2(_), drag) : container;
+ };
+
+ drag.subject = function(_) {
+ return arguments.length ? (subject = typeof _ === "function" ? _ : constant$2(_), drag) : subject;
+ };
+
+ drag.touchable = function(_) {
+ return arguments.length ? (touchable = typeof _ === "function" ? _ : constant$2(!!_), drag) : touchable;
+ };
+
+ drag.on = function() {
+ var value = listeners.on.apply(listeners, arguments);
+ return value === listeners ? drag : value;
+ };
+
+ drag.clickDistance = function(_) {
+ return arguments.length ? (clickDistance2 = (_ = +_) * _, drag) : Math.sqrt(clickDistance2);
+ };
+
+ return drag;
+}
+
+function define(constructor, factory, prototype) {
+ constructor.prototype = factory.prototype = prototype;
+ prototype.constructor = constructor;
+}
+
+function extend(parent, definition) {
+ var prototype = Object.create(parent.prototype);
+ for (var key in definition) prototype[key] = definition[key];
+ return prototype;
+}
+
+function Color() {}
+
+var darker = 0.7;
+var brighter = 1 / darker;
+
+var reI = "\\s*([+-]?\\d+)\\s*",
+ reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",
+ reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",
+ reHex3 = /^#([0-9a-f]{3})$/,
+ reHex6 = /^#([0-9a-f]{6})$/,
+ reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$"),
+ reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$"),
+ reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$"),
+ reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$"),
+ reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$"),
+ reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$");
+
+var named = {
+ aliceblue: 0xf0f8ff,
+ antiquewhite: 0xfaebd7,
+ aqua: 0x00ffff,
+ aquamarine: 0x7fffd4,
+ azure: 0xf0ffff,
+ beige: 0xf5f5dc,
+ bisque: 0xffe4c4,
+ black: 0x000000,
+ blanchedalmond: 0xffebcd,
+ blue: 0x0000ff,
+ blueviolet: 0x8a2be2,
+ brown: 0xa52a2a,
+ burlywood: 0xdeb887,
+ cadetblue: 0x5f9ea0,
+ chartreuse: 0x7fff00,
+ chocolate: 0xd2691e,
+ coral: 0xff7f50,
+ cornflowerblue: 0x6495ed,
+ cornsilk: 0xfff8dc,
+ crimson: 0xdc143c,
+ cyan: 0x00ffff,
+ darkblue: 0x00008b,
+ darkcyan: 0x008b8b,
+ darkgoldenrod: 0xb8860b,
+ darkgray: 0xa9a9a9,
+ darkgreen: 0x006400,
+ darkgrey: 0xa9a9a9,
+ darkkhaki: 0xbdb76b,
+ darkmagenta: 0x8b008b,
+ darkolivegreen: 0x556b2f,
+ darkorange: 0xff8c00,
+ darkorchid: 0x9932cc,
+ darkred: 0x8b0000,
+ darksalmon: 0xe9967a,
+ darkseagreen: 0x8fbc8f,
+ darkslateblue: 0x483d8b,
+ darkslategray: 0x2f4f4f,
+ darkslategrey: 0x2f4f4f,
+ darkturquoise: 0x00ced1,
+ darkviolet: 0x9400d3,
+ deeppink: 0xff1493,
+ deepskyblue: 0x00bfff,
+ dimgray: 0x696969,
+ dimgrey: 0x696969,
+ dodgerblue: 0x1e90ff,
+ firebrick: 0xb22222,
+ floralwhite: 0xfffaf0,
+ forestgreen: 0x228b22,
+ fuchsia: 0xff00ff,
+ gainsboro: 0xdcdcdc,
+ ghostwhite: 0xf8f8ff,
+ gold: 0xffd700,
+ goldenrod: 0xdaa520,
+ gray: 0x808080,
+ green: 0x008000,
+ greenyellow: 0xadff2f,
+ grey: 0x808080,
+ honeydew: 0xf0fff0,
+ hotpink: 0xff69b4,
+ indianred: 0xcd5c5c,
+ indigo: 0x4b0082,
+ ivory: 0xfffff0,
+ khaki: 0xf0e68c,
+ lavender: 0xe6e6fa,
+ lavenderblush: 0xfff0f5,
+ lawngreen: 0x7cfc00,
+ lemonchiffon: 0xfffacd,
+ lightblue: 0xadd8e6,
+ lightcoral: 0xf08080,
+ lightcyan: 0xe0ffff,
+ lightgoldenrodyellow: 0xfafad2,
+ lightgray: 0xd3d3d3,
+ lightgreen: 0x90ee90,
+ lightgrey: 0xd3d3d3,
+ lightpink: 0xffb6c1,
+ lightsalmon: 0xffa07a,
+ lightseagreen: 0x20b2aa,
+ lightskyblue: 0x87cefa,
+ lightslategray: 0x778899,
+ lightslategrey: 0x778899,
+ lightsteelblue: 0xb0c4de,
+ lightyellow: 0xffffe0,
+ lime: 0x00ff00,
+ limegreen: 0x32cd32,
+ linen: 0xfaf0e6,
+ magenta: 0xff00ff,
+ maroon: 0x800000,
+ mediumaquamarine: 0x66cdaa,
+ mediumblue: 0x0000cd,
+ mediumorchid: 0xba55d3,
+ mediumpurple: 0x9370db,
+ mediumseagreen: 0x3cb371,
+ mediumslateblue: 0x7b68ee,
+ mediumspringgreen: 0x00fa9a,
+ mediumturquoise: 0x48d1cc,
+ mediumvioletred: 0xc71585,
+ midnightblue: 0x191970,
+ mintcream: 0xf5fffa,
+ mistyrose: 0xffe4e1,
+ moccasin: 0xffe4b5,
+ navajowhite: 0xffdead,
+ navy: 0x000080,
+ oldlace: 0xfdf5e6,
+ olive: 0x808000,
+ olivedrab: 0x6b8e23,
+ orange: 0xffa500,
+ orangered: 0xff4500,
+ orchid: 0xda70d6,
+ palegoldenrod: 0xeee8aa,
+ palegreen: 0x98fb98,
+ paleturquoise: 0xafeeee,
+ palevioletred: 0xdb7093,
+ papayawhip: 0xffefd5,
+ peachpuff: 0xffdab9,
+ peru: 0xcd853f,
+ pink: 0xffc0cb,
+ plum: 0xdda0dd,
+ powderblue: 0xb0e0e6,
+ purple: 0x800080,
+ rebeccapurple: 0x663399,
+ red: 0xff0000,
+ rosybrown: 0xbc8f8f,
+ royalblue: 0x4169e1,
+ saddlebrown: 0x8b4513,
+ salmon: 0xfa8072,
+ sandybrown: 0xf4a460,
+ seagreen: 0x2e8b57,
+ seashell: 0xfff5ee,
+ sienna: 0xa0522d,
+ silver: 0xc0c0c0,
+ skyblue: 0x87ceeb,
+ slateblue: 0x6a5acd,
+ slategray: 0x708090,
+ slategrey: 0x708090,
+ snow: 0xfffafa,
+ springgreen: 0x00ff7f,
+ steelblue: 0x4682b4,
+ tan: 0xd2b48c,
+ teal: 0x008080,
+ thistle: 0xd8bfd8,
+ tomato: 0xff6347,
+ turquoise: 0x40e0d0,
+ violet: 0xee82ee,
+ wheat: 0xf5deb3,
+ white: 0xffffff,
+ whitesmoke: 0xf5f5f5,
+ yellow: 0xffff00,
+ yellowgreen: 0x9acd32
+};
+
+define(Color, color, {
+ displayable: function() {
+ return this.rgb().displayable();
+ },
+ hex: function() {
+ return this.rgb().hex();
+ },
+ toString: function() {
+ return this.rgb() + "";
}
- var d3_geo_clipAntimeridian = d3_geo_clip(d3_true, d3_geo_clipAntimeridianLine, d3_geo_clipAntimeridianInterpolate, [ -Ï€, -Ï€ / 2 ]);
- function d3_geo_clipAntimeridianLine(listener) {
- var λ0 = NaN, φ0 = NaN, sλ0 = NaN, clean;
- return {
- lineStart: function() {
- listener.lineStart();
- clean = 1;
- },
- point: function(λ1, φ1) {
- var sλ1 = λ1 > 0 ? π : -π, dλ = abs(λ1 - λ0);
- if (abs(dλ - π) < ε) {
- listener.point(λ0, φ0 = (φ0 + φ1) / 2 > 0 ? halfπ : -halfπ);
- listener.point(sλ0, φ0);
- listener.lineEnd();
- listener.lineStart();
- listener.point(sλ1, φ0);
- listener.point(λ1, φ0);
- clean = 0;
- } else if (sλ0 !== sλ1 && dλ >= π) {
- if (abs(λ0 - sλ0) < ε) λ0 -= sλ0 * ε;
- if (abs(λ1 - sλ1) < ε) λ1 -= sλ1 * ε;
- φ0 = d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1);
- listener.point(sλ0, φ0);
- listener.lineEnd();
- listener.lineStart();
- listener.point(sλ1, φ0);
- clean = 0;
- }
- listener.point(λ0 = λ1, φ0 = φ1);
- sλ0 = sλ1;
- },
- lineEnd: function() {
- listener.lineEnd();
- λ0 = φ0 = NaN;
- },
- clean: function() {
- return 2 - clean;
- }
+});
+
+function color(format) {
+ var m;
+ format = (format + "").trim().toLowerCase();
+ return (m = reHex3.exec(format)) ? (m = parseInt(m[1], 16), new Rgb((m >> 8 & 0xf) | (m >> 4 & 0x0f0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1)) // #f00
+ : (m = reHex6.exec(format)) ? rgbn(parseInt(m[1], 16)) // #ff0000
+ : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)
+ : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)
+ : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)
+ : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)
+ : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)
+ : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)
+ : named.hasOwnProperty(format) ? rgbn(named[format])
+ : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0)
+ : null;
+}
+
+function rgbn(n) {
+ return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);
+}
+
+function rgba(r, g, b, a) {
+ if (a <= 0) r = g = b = NaN;
+ return new Rgb(r, g, b, a);
+}
+
+function rgbConvert(o) {
+ if (!(o instanceof Color)) o = color(o);
+ if (!o) return new Rgb;
+ o = o.rgb();
+ return new Rgb(o.r, o.g, o.b, o.opacity);
+}
+
+function rgb(r, g, b, opacity) {
+ return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);
+}
+
+function Rgb(r, g, b, opacity) {
+ this.r = +r;
+ this.g = +g;
+ this.b = +b;
+ this.opacity = +opacity;
+}
+
+define(Rgb, rgb, extend(Color, {
+ brighter: function(k) {
+ k = k == null ? brighter : Math.pow(brighter, k);
+ return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
+ },
+ darker: function(k) {
+ k = k == null ? darker : Math.pow(darker, k);
+ return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);
+ },
+ rgb: function() {
+ return this;
+ },
+ displayable: function() {
+ return (-0.5 <= this.r && this.r < 255.5)
+ && (-0.5 <= this.g && this.g < 255.5)
+ && (-0.5 <= this.b && this.b < 255.5)
+ && (0 <= this.opacity && this.opacity <= 1);
+ },
+ hex: function() {
+ return "#" + hex(this.r) + hex(this.g) + hex(this.b);
+ },
+ toString: function() {
+ var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));
+ return (a === 1 ? "rgb(" : "rgba(")
+ + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + ", "
+ + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + ", "
+ + Math.max(0, Math.min(255, Math.round(this.b) || 0))
+ + (a === 1 ? ")" : ", " + a + ")");
+ }
+}));
+
+function hex(value) {
+ value = Math.max(0, Math.min(255, Math.round(value) || 0));
+ return (value < 16 ? "0" : "") + value.toString(16);
+}
+
+function hsla(h, s, l, a) {
+ if (a <= 0) h = s = l = NaN;
+ else if (l <= 0 || l >= 1) h = s = NaN;
+ else if (s <= 0) h = NaN;
+ return new Hsl(h, s, l, a);
+}
+
+function hslConvert(o) {
+ if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);
+ if (!(o instanceof Color)) o = color(o);
+ if (!o) return new Hsl;
+ if (o instanceof Hsl) return o;
+ o = o.rgb();
+ var r = o.r / 255,
+ g = o.g / 255,
+ b = o.b / 255,
+ min = Math.min(r, g, b),
+ max = Math.max(r, g, b),
+ h = NaN,
+ s = max - min,
+ l = (max + min) / 2;
+ if (s) {
+ if (r === max) h = (g - b) / s + (g < b) * 6;
+ else if (g === max) h = (b - r) / s + 2;
+ else h = (r - g) / s + 4;
+ s /= l < 0.5 ? max + min : 2 - max - min;
+ h *= 60;
+ } else {
+ s = l > 0 && l < 1 ? 0 : h;
+ }
+ return new Hsl(h, s, l, o.opacity);
+}
+
+function hsl(h, s, l, opacity) {
+ return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);
+}
+
+function Hsl(h, s, l, opacity) {
+ this.h = +h;
+ this.s = +s;
+ this.l = +l;
+ this.opacity = +opacity;
+}
+
+define(Hsl, hsl, extend(Color, {
+ brighter: function(k) {
+ k = k == null ? brighter : Math.pow(brighter, k);
+ return new Hsl(this.h, this.s, this.l * k, this.opacity);
+ },
+ darker: function(k) {
+ k = k == null ? darker : Math.pow(darker, k);
+ return new Hsl(this.h, this.s, this.l * k, this.opacity);
+ },
+ rgb: function() {
+ var h = this.h % 360 + (this.h < 0) * 360,
+ s = isNaN(h) || isNaN(this.s) ? 0 : this.s,
+ l = this.l,
+ m2 = l + (l < 0.5 ? l : 1 - l) * s,
+ m1 = 2 * l - m2;
+ return new Rgb(
+ hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),
+ hsl2rgb(h, m1, m2),
+ hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),
+ this.opacity
+ );
+ },
+ displayable: function() {
+ return (0 <= this.s && this.s <= 1 || isNaN(this.s))
+ && (0 <= this.l && this.l <= 1)
+ && (0 <= this.opacity && this.opacity <= 1);
+ }
+}));
+
+/* From FvD 13.37, CSS Color Module Level 3 */
+function hsl2rgb(h, m1, m2) {
+ return (h < 60 ? m1 + (m2 - m1) * h / 60
+ : h < 180 ? m2
+ : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60
+ : m1) * 255;
+}
+
+var deg2rad = Math.PI / 180;
+var rad2deg = 180 / Math.PI;
+
+// https://observablehq.com/@mbostock/lab-and-rgb
+var K = 18,
+ Xn = 0.96422,
+ Yn = 1,
+ Zn = 0.82521,
+ t0 = 4 / 29,
+ t1 = 6 / 29,
+ t2 = 3 * t1 * t1,
+ t3 = t1 * t1 * t1;
+
+function labConvert(o) {
+ if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);
+ if (o instanceof Hcl) return hcl2lab(o);
+ if (!(o instanceof Rgb)) o = rgbConvert(o);
+ var r = rgb2lrgb(o.r),
+ g = rgb2lrgb(o.g),
+ b = rgb2lrgb(o.b),
+ y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;
+ if (r === g && g === b) x = z = y; else {
+ x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);
+ z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);
+ }
+ return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);
+}
+
+function gray(l, opacity) {
+ return new Lab(l, 0, 0, opacity == null ? 1 : opacity);
+}
+
+function lab(l, a, b, opacity) {
+ return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);
+}
+
+function Lab(l, a, b, opacity) {
+ this.l = +l;
+ this.a = +a;
+ this.b = +b;
+ this.opacity = +opacity;
+}
+
+define(Lab, lab, extend(Color, {
+ brighter: function(k) {
+ return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);
+ },
+ darker: function(k) {
+ return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);
+ },
+ rgb: function() {
+ var y = (this.l + 16) / 116,
+ x = isNaN(this.a) ? y : y + this.a / 500,
+ z = isNaN(this.b) ? y : y - this.b / 200;
+ x = Xn * lab2xyz(x);
+ y = Yn * lab2xyz(y);
+ z = Zn * lab2xyz(z);
+ return new Rgb(
+ lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),
+ lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),
+ lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),
+ this.opacity
+ );
+ }
+}));
+
+function xyz2lab(t) {
+ return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;
+}
+
+function lab2xyz(t) {
+ return t > t1 ? t * t * t : t2 * (t - t0);
+}
+
+function lrgb2rgb(x) {
+ return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);
+}
+
+function rgb2lrgb(x) {
+ return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);
+}
+
+function hclConvert(o) {
+ if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);
+ if (!(o instanceof Lab)) o = labConvert(o);
+ if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);
+ var h = Math.atan2(o.b, o.a) * rad2deg;
+ return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);
+}
+
+function lch(l, c, h, opacity) {
+ return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity);
+}
+
+function hcl(h, c, l, opacity) {
+ return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);
+}
+
+function Hcl(h, c, l, opacity) {
+ this.h = +h;
+ this.c = +c;
+ this.l = +l;
+ this.opacity = +opacity;
+}
+
+function hcl2lab(o) {
+ if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);
+ var h = o.h * deg2rad;
+ return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);
+}
+
+define(Hcl, hcl, extend(Color, {
+ brighter: function(k) {
+ return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);
+ },
+ darker: function(k) {
+ return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);
+ },
+ rgb: function() {
+ return hcl2lab(this).rgb();
+ }
+}));
+
+var A = -0.14861,
+ B = +1.78277,
+ C = -0.29227,
+ D = -0.90649,
+ E = +1.97294,
+ ED = E * D,
+ EB = E * B,
+ BC_DA = B * C - D * A;
+
+function cubehelixConvert(o) {
+ if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);
+ if (!(o instanceof Rgb)) o = rgbConvert(o);
+ var r = o.r / 255,
+ g = o.g / 255,
+ b = o.b / 255,
+ l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),
+ bl = b - l,
+ k = (E * (g - l) - C * bl) / D,
+ s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1
+ h = s ? Math.atan2(k, bl) * rad2deg - 120 : NaN;
+ return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);
+}
+
+function cubehelix(h, s, l, opacity) {
+ return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);
+}
+
+function Cubehelix(h, s, l, opacity) {
+ this.h = +h;
+ this.s = +s;
+ this.l = +l;
+ this.opacity = +opacity;
+}
+
+define(Cubehelix, cubehelix, extend(Color, {
+ brighter: function(k) {
+ k = k == null ? brighter : Math.pow(brighter, k);
+ return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
+ },
+ darker: function(k) {
+ k = k == null ? darker : Math.pow(darker, k);
+ return new Cubehelix(this.h, this.s, this.l * k, this.opacity);
+ },
+ rgb: function() {
+ var h = isNaN(this.h) ? 0 : (this.h + 120) * deg2rad,
+ l = +this.l,
+ a = isNaN(this.s) ? 0 : this.s * l * (1 - l),
+ cosh = Math.cos(h),
+ sinh = Math.sin(h);
+ return new Rgb(
+ 255 * (l + a * (A * cosh + B * sinh)),
+ 255 * (l + a * (C * cosh + D * sinh)),
+ 255 * (l + a * (E * cosh)),
+ this.opacity
+ );
+ }
+}));
+
+function basis(t1, v0, v1, v2, v3) {
+ var t2 = t1 * t1, t3 = t2 * t1;
+ return ((1 - 3 * t1 + 3 * t2 - t3) * v0
+ + (4 - 6 * t2 + 3 * t3) * v1
+ + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2
+ + t3 * v3) / 6;
+}
+
+function basis$1(values) {
+ var n = values.length - 1;
+ return function(t) {
+ var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),
+ v1 = values[i],
+ v2 = values[i + 1],
+ v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,
+ v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;
+ return basis((t - i / n) * n, v0, v1, v2, v3);
+ };
+}
+
+function basisClosed(values) {
+ var n = values.length;
+ return function(t) {
+ var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),
+ v0 = values[(i + n - 1) % n],
+ v1 = values[i % n],
+ v2 = values[(i + 1) % n],
+ v3 = values[(i + 2) % n];
+ return basis((t - i / n) * n, v0, v1, v2, v3);
+ };
+}
+
+function constant$3(x) {
+ return function() {
+ return x;
+ };
+}
+
+function linear(a, d) {
+ return function(t) {
+ return a + t * d;
+ };
+}
+
+function exponential(a, b, y) {
+ return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {
+ return Math.pow(a + t * b, y);
+ };
+}
+
+function hue(a, b) {
+ var d = b - a;
+ return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant$3(isNaN(a) ? b : a);
+}
+
+function gamma(y) {
+ return (y = +y) === 1 ? nogamma : function(a, b) {
+ return b - a ? exponential(a, b, y) : constant$3(isNaN(a) ? b : a);
+ };
+}
+
+function nogamma(a, b) {
+ var d = b - a;
+ return d ? linear(a, d) : constant$3(isNaN(a) ? b : a);
+}
+
+var interpolateRgb = (function rgbGamma(y) {
+ var color$$1 = gamma(y);
+
+ function rgb$$1(start, end) {
+ var r = color$$1((start = rgb(start)).r, (end = rgb(end)).r),
+ g = color$$1(start.g, end.g),
+ b = color$$1(start.b, end.b),
+ opacity = nogamma(start.opacity, end.opacity);
+ return function(t) {
+ start.r = r(t);
+ start.g = g(t);
+ start.b = b(t);
+ start.opacity = opacity(t);
+ return start + "";
};
}
- function d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1) {
- var cosφ0, cosφ1, sinλ0_λ1 = Math.sin(λ0 - λ1);
- return abs(sinλ0_λ1) > ε ? Math.atan((Math.sin(φ0) * (cosφ1 = Math.cos(φ1)) * Math.sin(λ1) - Math.sin(φ1) * (cosφ0 = Math.cos(φ0)) * Math.sin(λ0)) / (cosφ0 * cosφ1 * sinλ0_λ1)) : (φ0 + φ1) / 2;
- }
- function d3_geo_clipAntimeridianInterpolate(from, to, direction, listener) {
- var φ;
- if (from == null) {
- φ = direction * halfπ;
- listener.point(-π, φ);
- listener.point(0, φ);
- listener.point(π, φ);
- listener.point(Ï€, 0);
- listener.point(π, -φ);
- listener.point(0, -φ);
- listener.point(-π, -φ);
- listener.point(-Ï€, 0);
- listener.point(-π, φ);
- } else if (abs(from[0] - to[0]) > ε) {
- var s = from[0] < to[0] ? π : -π;
- φ = direction * s / 2;
- listener.point(-s, φ);
- listener.point(0, φ);
- listener.point(s, φ);
+
+ rgb$$1.gamma = rgbGamma;
+
+ return rgb$$1;
+})(1);
+
+function rgbSpline(spline) {
+ return function(colors) {
+ var n = colors.length,
+ r = new Array(n),
+ g = new Array(n),
+ b = new Array(n),
+ i, color$$1;
+ for (i = 0; i < n; ++i) {
+ color$$1 = rgb(colors[i]);
+ r[i] = color$$1.r || 0;
+ g[i] = color$$1.g || 0;
+ b[i] = color$$1.b || 0;
+ }
+ r = spline(r);
+ g = spline(g);
+ b = spline(b);
+ color$$1.opacity = 1;
+ return function(t) {
+ color$$1.r = r(t);
+ color$$1.g = g(t);
+ color$$1.b = b(t);
+ return color$$1 + "";
+ };
+ };
+}
+
+var rgbBasis = rgbSpline(basis$1);
+var rgbBasisClosed = rgbSpline(basisClosed);
+
+function array$1(a, b) {
+ var nb = b ? b.length : 0,
+ na = a ? Math.min(nb, a.length) : 0,
+ x = new Array(na),
+ c = new Array(nb),
+ i;
+
+ for (i = 0; i < na; ++i) x[i] = interpolateValue(a[i], b[i]);
+ for (; i < nb; ++i) c[i] = b[i];
+
+ return function(t) {
+ for (i = 0; i < na; ++i) c[i] = x[i](t);
+ return c;
+ };
+}
+
+function date(a, b) {
+ var d = new Date;
+ return a = +a, b -= a, function(t) {
+ return d.setTime(a + b * t), d;
+ };
+}
+
+function interpolateNumber(a, b) {
+ return a = +a, b -= a, function(t) {
+ return a + b * t;
+ };
+}
+
+function object(a, b) {
+ var i = {},
+ c = {},
+ k;
+
+ if (a === null || typeof a !== "object") a = {};
+ if (b === null || typeof b !== "object") b = {};
+
+ for (k in b) {
+ if (k in a) {
+ i[k] = interpolateValue(a[k], b[k]);
} else {
- listener.point(to[0], to[1]);
- }
- }
- function d3_geo_pointInPolygon(point, polygon) {
- var meridian = point[0], parallel = point[1], meridianNormal = [ Math.sin(meridian), -Math.cos(meridian), 0 ], polarAngle = 0, winding = 0;
- d3_geo_areaRingSum.reset();
- for (var i = 0, n = polygon.length; i < n; ++i) {
- var ring = polygon[i], m = ring.length;
- if (!m) continue;
- var point0 = ring[0], λ0 = point0[0], φ0 = point0[1] / 2 + π / 4, sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), j = 1;
- while (true) {
- if (j === m) j = 0;
- point = ring[j];
- var λ = point[0], φ = point[1] / 2 + π / 4, sinφ = Math.sin(φ), cosφ = Math.cos(φ), dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, antimeridian = adλ > π, k = sinφ0 * sinφ;
- d3_geo_areaRingSum.add(Math.atan2(k * sdλ * Math.sin(adλ), cosφ0 * cosφ + k * Math.cos(adλ)));
- polarAngle += antimeridian ? dλ + sdλ * τ : dλ;
- if (antimeridian ^ λ0 >= meridian ^ λ >= meridian) {
- var arc = d3_geo_cartesianCross(d3_geo_cartesian(point0), d3_geo_cartesian(point));
- d3_geo_cartesianNormalize(arc);
- var intersection = d3_geo_cartesianCross(meridianNormal, arc);
- d3_geo_cartesianNormalize(intersection);
- var φarc = (antimeridian ^ dλ >= 0 ? -1 : 1) * d3_asin(intersection[2]);
- if (parallel > φarc || parallel === φarc && (arc[0] || arc[1])) {
- winding += antimeridian ^ dλ >= 0 ? 1 : -1;
- }
- }
- if (!j++) break;
- λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ, point0 = point;
- }
- }
- return (polarAngle < -ε || polarAngle < ε && d3_geo_areaRingSum < 0) ^ winding & 1;
- }
- function d3_geo_clipCircle(radius) {
- var cr = Math.cos(radius), smallRadius = cr > 0, notHemisphere = abs(cr) > ε, interpolate = d3_geo_circleInterpolate(radius, 6 * d3_radians);
- return d3_geo_clip(visible, clipLine, interpolate, smallRadius ? [ 0, -radius ] : [ -π, radius - π ]);
- function visible(λ, φ) {
- return Math.cos(λ) * Math.cos(φ) > cr;
- }
- function clipLine(listener) {
- var point0, c0, v0, v00, clean;
- return {
- lineStart: function() {
- v00 = v0 = false;
- clean = 1;
- },
- point: function(λ, φ) {
- var point1 = [ λ, φ ], point2, v = visible(λ, φ), c = smallRadius ? v ? 0 : code(λ, φ) : v ? code(λ + (λ < 0 ? π : -π), φ) : 0;
- if (!point0 && (v00 = v0 = v)) listener.lineStart();
- if (v !== v0) {
- point2 = intersect(point0, point1);
- if (d3_geo_sphericalEqual(point0, point2) || d3_geo_sphericalEqual(point1, point2)) {
- point1[0] += ε;
- point1[1] += ε;
- v = visible(point1[0], point1[1]);
- }
- }
- if (v !== v0) {
- clean = 0;
- if (v) {
- listener.lineStart();
- point2 = intersect(point1, point0);
- listener.point(point2[0], point2[1]);
- } else {
- point2 = intersect(point0, point1);
- listener.point(point2[0], point2[1]);
- listener.lineEnd();
- }
- point0 = point2;
- } else if (notHemisphere && point0 && smallRadius ^ v) {
- var t;
- if (!(c & c0) && (t = intersect(point1, point0, true))) {
- clean = 0;
- if (smallRadius) {
- listener.lineStart();
- listener.point(t[0][0], t[0][1]);
- listener.point(t[1][0], t[1][1]);
- listener.lineEnd();
- } else {
- listener.point(t[1][0], t[1][1]);
- listener.lineEnd();
- listener.lineStart();
- listener.point(t[0][0], t[0][1]);
- }
- }
- }
- if (v && (!point0 || !d3_geo_sphericalEqual(point0, point1))) {
- listener.point(point1[0], point1[1]);
- }
- point0 = point1, v0 = v, c0 = c;
- },
- lineEnd: function() {
- if (v0) listener.lineEnd();
- point0 = null;
- },
- clean: function() {
- return clean | (v00 && v0) << 1;
- }
- };
+ c[k] = b[k];
}
- function intersect(a, b, two) {
- var pa = d3_geo_cartesian(a), pb = d3_geo_cartesian(b);
- var n1 = [ 1, 0, 0 ], n2 = d3_geo_cartesianCross(pa, pb), n2n2 = d3_geo_cartesianDot(n2, n2), n1n2 = n2[0], determinant = n2n2 - n1n2 * n1n2;
- if (!determinant) return !two && a;
- var c1 = cr * n2n2 / determinant, c2 = -cr * n1n2 / determinant, n1xn2 = d3_geo_cartesianCross(n1, n2), A = d3_geo_cartesianScale(n1, c1), B = d3_geo_cartesianScale(n2, c2);
- d3_geo_cartesianAdd(A, B);
- var u = n1xn2, w = d3_geo_cartesianDot(A, u), uu = d3_geo_cartesianDot(u, u), t2 = w * w - uu * (d3_geo_cartesianDot(A, A) - 1);
- if (t2 < 0) return;
- var t = Math.sqrt(t2), q = d3_geo_cartesianScale(u, (-w - t) / uu);
- d3_geo_cartesianAdd(q, A);
- q = d3_geo_spherical(q);
- if (!two) return q;
- var λ0 = a[0], λ1 = b[0], φ0 = a[1], φ1 = b[1], z;
- if (λ1 < λ0) z = λ0, λ0 = λ1, λ1 = z;
- var δλ = λ1 - λ0, polar = abs(δλ - π) < ε, meridian = polar || δλ < ε;
- if (!polar && φ1 < φ0) z = φ0, φ0 = φ1, φ1 = z;
- if (meridian ? polar ? φ0 + φ1 > 0 ^ q[1] < (abs(q[0] - λ0) < ε ? φ0 : φ1) : φ0 <= q[1] && q[1] <= φ1 : δλ > π ^ (λ0 <= q[0] && q[0] <= λ1)) {
- var q1 = d3_geo_cartesianScale(u, (-w + t) / uu);
- d3_geo_cartesianAdd(q1, A);
- return [ q, d3_geo_spherical(q1) ];
- }
- }
- function code(λ, φ) {
- var r = smallRadius ? radius : π - radius, code = 0;
- if (λ < -r) code |= 1; else if (λ > r) code |= 2;
- if (φ < -r) code |= 4; else if (φ > r) code |= 8;
- return code;
- }
- }
- function d3_geom_clipLine(x0, y0, x1, y1) {
- return function(line) {
- var a = line.a, b = line.b, ax = a.x, ay = a.y, bx = b.x, by = b.y, t0 = 0, t1 = 1, dx = bx - ax, dy = by - ay, r;
- r = x0 - ax;
- if (!dx && r > 0) return;
- r /= dx;
- if (dx < 0) {
- if (r < t0) return;
- if (r < t1) t1 = r;
- } else if (dx > 0) {
- if (r > t1) return;
- if (r > t0) t0 = r;
- }
- r = x1 - ax;
- if (!dx && r < 0) return;
- r /= dx;
- if (dx < 0) {
- if (r > t1) return;
- if (r > t0) t0 = r;
- } else if (dx > 0) {
- if (r < t0) return;
- if (r < t1) t1 = r;
- }
- r = y0 - ay;
- if (!dy && r > 0) return;
- r /= dy;
- if (dy < 0) {
- if (r < t0) return;
- if (r < t1) t1 = r;
- } else if (dy > 0) {
- if (r > t1) return;
- if (r > t0) t0 = r;
- }
- r = y1 - ay;
- if (!dy && r < 0) return;
- r /= dy;
- if (dy < 0) {
- if (r > t1) return;
- if (r > t0) t0 = r;
- } else if (dy > 0) {
- if (r < t0) return;
- if (r < t1) t1 = r;
- }
- if (t0 > 0) line.a = {
- x: ax + t0 * dx,
- y: ay + t0 * dy
- };
- if (t1 < 1) line.b = {
- x: ax + t1 * dx,
- y: ay + t1 * dy
- };
- return line;
- };
}
- var d3_geo_clipExtentMAX = 1e9;
- d3.geo.clipExtent = function() {
- var x0, y0, x1, y1, stream, clip, clipExtent = {
- stream: function(output) {
- if (stream) stream.valid = false;
- stream = clip(output);
- stream.valid = true;
- return stream;
- },
- extent: function(_) {
- if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ];
- clip = d3_geo_clipExtent(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]);
- if (stream) stream.valid = false, stream = null;
- return clipExtent;
- }
- };
- return clipExtent.extent([ [ 0, 0 ], [ 960, 500 ] ]);
- };
- function d3_geo_clipExtent(x0, y0, x1, y1) {
- return function(listener) {
- var listener_ = listener, bufferListener = d3_geo_clipBufferListener(), clipLine = d3_geom_clipLine(x0, y0, x1, y1), segments, polygon, ring;
- var clip = {
- point: point,
- lineStart: lineStart,
- lineEnd: lineEnd,
- polygonStart: function() {
- listener = bufferListener;
- segments = [];
- polygon = [];
- clean = true;
- },
- polygonEnd: function() {
- listener = listener_;
- segments = d3.merge(segments);
- var clipStartInside = insidePolygon([ x0, y1 ]), inside = clean && clipStartInside, visible = segments.length;
- if (inside || visible) {
- listener.polygonStart();
- if (inside) {
- listener.lineStart();
- interpolate(null, null, 1, listener);
- listener.lineEnd();
- }
- if (visible) {
- d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener);
- }
- listener.polygonEnd();
- }
- segments = polygon = ring = null;
- }
- };
- function insidePolygon(p) {
- var wn = 0, n = polygon.length, y = p[1];
- for (var i = 0; i < n; ++i) {
- for (var j = 1, v = polygon[i], m = v.length, a = v[0], b; j < m; ++j) {
- b = v[j];
- if (a[1] <= y) {
- if (b[1] > y && d3_cross2d(a, b, p) > 0) ++wn;
- } else {
- if (b[1] <= y && d3_cross2d(a, b, p) < 0) --wn;
- }
- a = b;
- }
- }
- return wn !== 0;
- }
- function interpolate(from, to, direction, listener) {
- var a = 0, a1 = 0;
- if (from == null || (a = corner(from, direction)) !== (a1 = corner(to, direction)) || comparePoints(from, to) < 0 ^ direction > 0) {
- do {
- listener.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0);
- } while ((a = (a + direction + 4) % 4) !== a1);
- } else {
- listener.point(to[0], to[1]);
- }
- }
- function pointVisible(x, y) {
- return x0 <= x && x <= x1 && y0 <= y && y <= y1;
- }
- function point(x, y) {
- if (pointVisible(x, y)) listener.point(x, y);
- }
- var x__, y__, v__, x_, y_, v_, first, clean;
- function lineStart() {
- clip.point = linePoint;
- if (polygon) polygon.push(ring = []);
- first = true;
- v_ = false;
- x_ = y_ = NaN;
- }
- function lineEnd() {
- if (segments) {
- linePoint(x__, y__);
- if (v__ && v_) bufferListener.rejoin();
- segments.push(bufferListener.buffer());
- }
- clip.point = point;
- if (v_) listener.lineEnd();
- }
- function linePoint(x, y) {
- x = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, x));
- y = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, y));
- var v = pointVisible(x, y);
- if (polygon) ring.push([ x, y ]);
- if (first) {
- x__ = x, y__ = y, v__ = v;
- first = false;
- if (v) {
- listener.lineStart();
- listener.point(x, y);
- }
- } else {
- if (v && v_) listener.point(x, y); else {
- var l = {
- a: {
- x: x_,
- y: y_
- },
- b: {
- x: x,
- y: y
- }
- };
- if (clipLine(l)) {
- if (!v_) {
- listener.lineStart();
- listener.point(l.a.x, l.a.y);
- }
- listener.point(l.b.x, l.b.y);
- if (!v) listener.lineEnd();
- clean = false;
- } else if (v) {
- listener.lineStart();
- listener.point(x, y);
- clean = false;
- }
- }
- }
- x_ = x, y_ = y, v_ = v;
- }
- return clip;
- };
- function corner(p, direction) {
- return abs(p[0] - x0) < ε ? direction > 0 ? 0 : 3 : abs(p[0] - x1) < ε ? direction > 0 ? 2 : 1 : abs(p[1] - y0) < ε ? direction > 0 ? 1 : 0 : direction > 0 ? 3 : 2;
+
+ return function(t) {
+ for (k in i) c[k] = i[k](t);
+ return c;
+ };
+}
+
+var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,
+ reB = new RegExp(reA.source, "g");
+
+function zero(b) {
+ return function() {
+ return b;
+ };
+}
+
+function one(b) {
+ return function(t) {
+ return b(t) + "";
+ };
+}
+
+function interpolateString(a, b) {
+ var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b
+ am, // current match in a
+ bm, // current match in b
+ bs, // string preceding current number in b, if any
+ i = -1, // index in s
+ s = [], // string constants and placeholders
+ q = []; // number interpolators
+
+ // Coerce inputs to strings.
+ a = a + "", b = b + "";
+
+ // Interpolate pairs of numbers in a & b.
+ while ((am = reA.exec(a))
+ && (bm = reB.exec(b))) {
+ if ((bs = bm.index) > bi) { // a string precedes the next number in b
+ bs = b.slice(bi, bs);
+ if (s[i]) s[i] += bs; // coalesce with previous string
+ else s[++i] = bs;
+ }
+ if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match
+ if (s[i]) s[i] += bm; // coalesce with previous string
+ else s[++i] = bm;
+ } else { // interpolate non-matching numbers
+ s[++i] = null;
+ q.push({i: i, x: interpolateNumber(am, bm)});
+ }
+ bi = reB.lastIndex;
+ }
+
+ // Add remains of b.
+ if (bi < b.length) {
+ bs = b.slice(bi);
+ if (s[i]) s[i] += bs; // coalesce with previous string
+ else s[++i] = bs;
+ }
+
+ // Special optimization for only a single match.
+ // Otherwise, interpolate each of the numbers and rejoin the string.
+ return s.length < 2 ? (q[0]
+ ? one(q[0].x)
+ : zero(b))
+ : (b = q.length, function(t) {
+ for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);
+ return s.join("");
+ });
+}
+
+function interpolateValue(a, b) {
+ var t = typeof b, c;
+ return b == null || t === "boolean" ? constant$3(b)
+ : (t === "number" ? interpolateNumber
+ : t === "string" ? ((c = color(b)) ? (b = c, interpolateRgb) : interpolateString)
+ : b instanceof color ? interpolateRgb
+ : b instanceof Date ? date
+ : Array.isArray(b) ? array$1
+ : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object
+ : interpolateNumber)(a, b);
+}
+
+function discrete(range) {
+ var n = range.length;
+ return function(t) {
+ return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];
+ };
+}
+
+function hue$1(a, b) {
+ var i = hue(+a, +b);
+ return function(t) {
+ var x = i(t);
+ return x - 360 * Math.floor(x / 360);
+ };
+}
+
+function interpolateRound(a, b) {
+ return a = +a, b -= a, function(t) {
+ return Math.round(a + b * t);
+ };
+}
+
+var degrees = 180 / Math.PI;
+
+var identity$2 = {
+ translateX: 0,
+ translateY: 0,
+ rotate: 0,
+ skewX: 0,
+ scaleX: 1,
+ scaleY: 1
+};
+
+function decompose(a, b, c, d, e, f) {
+ var scaleX, scaleY, skewX;
+ if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;
+ if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;
+ if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;
+ if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;
+ return {
+ translateX: e,
+ translateY: f,
+ rotate: Math.atan2(b, a) * degrees,
+ skewX: Math.atan(skewX) * degrees,
+ scaleX: scaleX,
+ scaleY: scaleY
+ };
+}
+
+var cssNode,
+ cssRoot,
+ cssView,
+ svgNode;
+
+function parseCss(value) {
+ if (value === "none") return identity$2;
+ if (!cssNode) cssNode = document.createElement("DIV"), cssRoot = document.documentElement, cssView = document.defaultView;
+ cssNode.style.transform = value;
+ value = cssView.getComputedStyle(cssRoot.appendChild(cssNode), null).getPropertyValue("transform");
+ cssRoot.removeChild(cssNode);
+ value = value.slice(7, -1).split(",");
+ return decompose(+value[0], +value[1], +value[2], +value[3], +value[4], +value[5]);
+}
+
+function parseSvg(value) {
+ if (value == null) return identity$2;
+ if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g");
+ svgNode.setAttribute("transform", value);
+ if (!(value = svgNode.transform.baseVal.consolidate())) return identity$2;
+ value = value.matrix;
+ return decompose(value.a, value.b, value.c, value.d, value.e, value.f);
+}
+
+function interpolateTransform(parse, pxComma, pxParen, degParen) {
+
+ function pop(s) {
+ return s.length ? s.pop() + " " : "";
+ }
+
+ function translate(xa, ya, xb, yb, s, q) {
+ if (xa !== xb || ya !== yb) {
+ var i = s.push("translate(", null, pxComma, null, pxParen);
+ q.push({i: i - 4, x: interpolateNumber(xa, xb)}, {i: i - 2, x: interpolateNumber(ya, yb)});
+ } else if (xb || yb) {
+ s.push("translate(" + xb + pxComma + yb + pxParen);
}
- function compare(a, b) {
- return comparePoints(a.x, b.x);
+ }
+
+ function rotate(a, b, s, q) {
+ if (a !== b) {
+ if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path
+ q.push({i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: interpolateNumber(a, b)});
+ } else if (b) {
+ s.push(pop(s) + "rotate(" + b + degParen);
}
- function comparePoints(a, b) {
- var ca = corner(a, 1), cb = corner(b, 1);
- return ca !== cb ? ca - cb : ca === 0 ? b[1] - a[1] : ca === 1 ? a[0] - b[0] : ca === 2 ? a[1] - b[1] : b[0] - a[0];
+ }
+
+ function skewX(a, b, s, q) {
+ if (a !== b) {
+ q.push({i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: interpolateNumber(a, b)});
+ } else if (b) {
+ s.push(pop(s) + "skewX(" + b + degParen);
}
}
- function d3_geo_compose(a, b) {
- function compose(x, y) {
- return x = a(x, y), b(x[0], x[1]);
+
+ function scale(xa, ya, xb, yb, s, q) {
+ if (xa !== xb || ya !== yb) {
+ var i = s.push(pop(s) + "scale(", null, ",", null, ")");
+ q.push({i: i - 4, x: interpolateNumber(xa, xb)}, {i: i - 2, x: interpolateNumber(ya, yb)});
+ } else if (xb !== 1 || yb !== 1) {
+ s.push(pop(s) + "scale(" + xb + "," + yb + ")");
}
- if (a.invert && b.invert) compose.invert = function(x, y) {
- return x = b.invert(x, y), x && a.invert(x[0], x[1]);
+ }
+
+ return function(a, b) {
+ var s = [], // string constants and placeholders
+ q = []; // number interpolators
+ a = parse(a), b = parse(b);
+ translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);
+ rotate(a.rotate, b.rotate, s, q);
+ skewX(a.skewX, b.skewX, s, q);
+ scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);
+ a = b = null; // gc
+ return function(t) {
+ var i = -1, n = q.length, o;
+ while (++i < n) s[(o = q[i]).i] = o.x(t);
+ return s.join("");
+ };
+ };
+}
+
+var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)");
+var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")");
+
+var rho = Math.SQRT2,
+ rho2 = 2,
+ rho4 = 4,
+ epsilon2 = 1e-12;
+
+function cosh(x) {
+ return ((x = Math.exp(x)) + 1 / x) / 2;
+}
+
+function sinh(x) {
+ return ((x = Math.exp(x)) - 1 / x) / 2;
+}
+
+function tanh(x) {
+ return ((x = Math.exp(2 * x)) - 1) / (x + 1);
+}
+
+// p0 = [ux0, uy0, w0]
+// p1 = [ux1, uy1, w1]
+function interpolateZoom(p0, p1) {
+ var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],
+ ux1 = p1[0], uy1 = p1[1], w1 = p1[2],
+ dx = ux1 - ux0,
+ dy = uy1 - uy0,
+ d2 = dx * dx + dy * dy,
+ i,
+ S;
+
+ // Special case for u0 ≅ u1.
+ if (d2 < epsilon2) {
+ S = Math.log(w1 / w0) / rho;
+ i = function(t) {
+ return [
+ ux0 + t * dx,
+ uy0 + t * dy,
+ w0 * Math.exp(rho * t * S)
+ ];
};
- return compose;
}
- function d3_geo_conic(projectAt) {
- var φ0 = 0, φ1 = π / 3, m = d3_geo_projectionMutator(projectAt), p = m(φ0, φ1);
- p.parallels = function(_) {
- if (!arguments.length) return [ φ0 / π * 180, φ1 / π * 180 ];
- return m(φ0 = _[0] * π / 180, φ1 = _[1] * π / 180);
+
+ // General case.
+ else {
+ var d1 = Math.sqrt(d2),
+ b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),
+ b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),
+ r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),
+ r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);
+ S = (r1 - r0) / rho;
+ i = function(t) {
+ var s = t * S,
+ coshr0 = cosh(r0),
+ u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));
+ return [
+ ux0 + u * dx,
+ uy0 + u * dy,
+ w0 * coshr0 / cosh(rho * s + r0)
+ ];
};
- return p;
}
- function d3_geo_conicEqualArea(φ0, φ1) {
- var sinφ0 = Math.sin(φ0), n = (sinφ0 + Math.sin(φ1)) / 2, C = 1 + sinφ0 * (2 * n - sinφ0), Ï0 = Math.sqrt(C) / n;
- function forward(λ, φ) {
- var Ï = Math.sqrt(C - 2 * n * Math.sin(φ)) / n;
- return [ Ï * Math.sin(λ *= n), Ï0 - Ï * Math.cos(λ) ];
- }
- forward.invert = function(x, y) {
- var Ï0_y = Ï0 - y;
- return [ Math.atan2(x, Ï0_y) / n, d3_asin((C - (x * x + Ï0_y * Ï0_y) * n * n) / (2 * n)) ];
+
+ i.duration = S * 1000;
+
+ return i;
+}
+
+function hsl$1(hue$$1) {
+ return function(start, end) {
+ var h = hue$$1((start = hsl(start)).h, (end = hsl(end)).h),
+ s = nogamma(start.s, end.s),
+ l = nogamma(start.l, end.l),
+ opacity = nogamma(start.opacity, end.opacity);
+ return function(t) {
+ start.h = h(t);
+ start.s = s(t);
+ start.l = l(t);
+ start.opacity = opacity(t);
+ return start + "";
};
- return forward;
- }
- (d3.geo.conicEqualArea = function() {
- return d3_geo_conic(d3_geo_conicEqualArea);
- }).raw = d3_geo_conicEqualArea;
- d3.geo.albers = function() {
- return d3.geo.conicEqualArea().rotate([ 96, 0 ]).center([ -.6, 38.7 ]).parallels([ 29.5, 45.5 ]).scale(1070);
- };
- d3.geo.albersUsa = function() {
- var lower48 = d3.geo.albers();
- var alaska = d3.geo.conicEqualArea().rotate([ 154, 0 ]).center([ -2, 58.5 ]).parallels([ 55, 65 ]);
- var hawaii = d3.geo.conicEqualArea().rotate([ 157, 0 ]).center([ -3, 19.9 ]).parallels([ 8, 18 ]);
- var point, pointStream = {
- point: function(x, y) {
- point = [ x, y ];
- }
- }, lower48Point, alaskaPoint, hawaiiPoint;
- function albersUsa(coordinates) {
- var x = coordinates[0], y = coordinates[1];
- point = null;
- (lower48Point(x, y), point) || (alaskaPoint(x, y), point) || hawaiiPoint(x, y);
- return point;
- }
- albersUsa.invert = function(coordinates) {
- var k = lower48.scale(), t = lower48.translate(), x = (coordinates[0] - t[0]) / k, y = (coordinates[1] - t[1]) / k;
- return (y >= .12 && y < .234 && x >= -.425 && x < -.214 ? alaska : y >= .166 && y < .234 && x >= -.214 && x < -.115 ? hawaii : lower48).invert(coordinates);
+ }
+}
+
+var hsl$2 = hsl$1(hue);
+var hslLong = hsl$1(nogamma);
+
+function lab$1(start, end) {
+ var l = nogamma((start = lab(start)).l, (end = lab(end)).l),
+ a = nogamma(start.a, end.a),
+ b = nogamma(start.b, end.b),
+ opacity = nogamma(start.opacity, end.opacity);
+ return function(t) {
+ start.l = l(t);
+ start.a = a(t);
+ start.b = b(t);
+ start.opacity = opacity(t);
+ return start + "";
+ };
+}
+
+function hcl$1(hue$$1) {
+ return function(start, end) {
+ var h = hue$$1((start = hcl(start)).h, (end = hcl(end)).h),
+ c = nogamma(start.c, end.c),
+ l = nogamma(start.l, end.l),
+ opacity = nogamma(start.opacity, end.opacity);
+ return function(t) {
+ start.h = h(t);
+ start.c = c(t);
+ start.l = l(t);
+ start.opacity = opacity(t);
+ return start + "";
};
- albersUsa.stream = function(stream) {
- var lower48Stream = lower48.stream(stream), alaskaStream = alaska.stream(stream), hawaiiStream = hawaii.stream(stream);
- return {
- point: function(x, y) {
- lower48Stream.point(x, y);
- alaskaStream.point(x, y);
- hawaiiStream.point(x, y);
- },
- sphere: function() {
- lower48Stream.sphere();
- alaskaStream.sphere();
- hawaiiStream.sphere();
- },
- lineStart: function() {
- lower48Stream.lineStart();
- alaskaStream.lineStart();
- hawaiiStream.lineStart();
- },
- lineEnd: function() {
- lower48Stream.lineEnd();
- alaskaStream.lineEnd();
- hawaiiStream.lineEnd();
- },
- polygonStart: function() {
- lower48Stream.polygonStart();
- alaskaStream.polygonStart();
- hawaiiStream.polygonStart();
- },
- polygonEnd: function() {
- lower48Stream.polygonEnd();
- alaskaStream.polygonEnd();
- hawaiiStream.polygonEnd();
- }
+ }
+}
+
+var hcl$2 = hcl$1(hue);
+var hclLong = hcl$1(nogamma);
+
+function cubehelix$1(hue$$1) {
+ return (function cubehelixGamma(y) {
+ y = +y;
+
+ function cubehelix$$1(start, end) {
+ var h = hue$$1((start = cubehelix(start)).h, (end = cubehelix(end)).h),
+ s = nogamma(start.s, end.s),
+ l = nogamma(start.l, end.l),
+ opacity = nogamma(start.opacity, end.opacity);
+ return function(t) {
+ start.h = h(t);
+ start.s = s(t);
+ start.l = l(Math.pow(t, y));
+ start.opacity = opacity(t);
+ return start + "";
};
- };
- albersUsa.precision = function(_) {
- if (!arguments.length) return lower48.precision();
- lower48.precision(_);
- alaska.precision(_);
- hawaii.precision(_);
- return albersUsa;
- };
- albersUsa.scale = function(_) {
- if (!arguments.length) return lower48.scale();
- lower48.scale(_);
- alaska.scale(_ * .35);
- hawaii.scale(_);
- return albersUsa.translate(lower48.translate());
- };
- albersUsa.translate = function(_) {
- if (!arguments.length) return lower48.translate();
- var k = lower48.scale(), x = +_[0], y = +_[1];
- lower48Point = lower48.translate(_).clipExtent([ [ x - .455 * k, y - .238 * k ], [ x + .455 * k, y + .238 * k ] ]).stream(pointStream).point;
- alaskaPoint = alaska.translate([ x - .307 * k, y + .201 * k ]).clipExtent([ [ x - .425 * k + ε, y + .12 * k + ε ], [ x - .214 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point;
- hawaiiPoint = hawaii.translate([ x - .205 * k, y + .212 * k ]).clipExtent([ [ x - .214 * k + ε, y + .166 * k + ε ], [ x - .115 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point;
- return albersUsa;
- };
- return albersUsa.scale(1070);
- };
- var d3_geo_pathAreaSum, d3_geo_pathAreaPolygon, d3_geo_pathArea = {
- point: d3_noop,
- lineStart: d3_noop,
- lineEnd: d3_noop,
- polygonStart: function() {
- d3_geo_pathAreaPolygon = 0;
- d3_geo_pathArea.lineStart = d3_geo_pathAreaRingStart;
- },
- polygonEnd: function() {
- d3_geo_pathArea.lineStart = d3_geo_pathArea.lineEnd = d3_geo_pathArea.point = d3_noop;
- d3_geo_pathAreaSum += abs(d3_geo_pathAreaPolygon / 2);
}
+
+ cubehelix$$1.gamma = cubehelixGamma;
+
+ return cubehelix$$1;
+ })(1);
+}
+
+var cubehelix$2 = cubehelix$1(hue);
+var cubehelixLong = cubehelix$1(nogamma);
+
+function piecewise(interpolate, values) {
+ var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);
+ while (i < n) I[i] = interpolate(v, v = values[++i]);
+ return function(t) {
+ var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));
+ return I[i](t - i);
};
- function d3_geo_pathAreaRingStart() {
- var x00, y00, x0, y0;
- d3_geo_pathArea.point = function(x, y) {
- d3_geo_pathArea.point = nextPoint;
- x00 = x0 = x, y00 = y0 = y;
- };
- function nextPoint(x, y) {
- d3_geo_pathAreaPolygon += y0 * x - x0 * y;
- x0 = x, y0 = y;
- }
- d3_geo_pathArea.lineEnd = function() {
- nextPoint(x00, y00);
- };
+}
+
+function quantize(interpolator, n) {
+ var samples = new Array(n);
+ for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));
+ return samples;
+}
+
+var frame = 0, // is an animation frame pending?
+ timeout = 0, // is a timeout pending?
+ interval = 0, // are any timers active?
+ pokeDelay = 1000, // how frequently we check for clock skew
+ taskHead,
+ taskTail,
+ clockLast = 0,
+ clockNow = 0,
+ clockSkew = 0,
+ clock = typeof performance === "object" && performance.now ? performance : Date,
+ setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };
+
+function now() {
+ return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);
+}
+
+function clearNow() {
+ clockNow = 0;
+}
+
+function Timer() {
+ this._call =
+ this._time =
+ this._next = null;
+}
+
+Timer.prototype = timer.prototype = {
+ constructor: Timer,
+ restart: function(callback, delay, time) {
+ if (typeof callback !== "function") throw new TypeError("callback is not a function");
+ time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);
+ if (!this._next && taskTail !== this) {
+ if (taskTail) taskTail._next = this;
+ else taskHead = this;
+ taskTail = this;
+ }
+ this._call = callback;
+ this._time = time;
+ sleep();
+ },
+ stop: function() {
+ if (this._call) {
+ this._call = null;
+ this._time = Infinity;
+ sleep();
+ }
+ }
+};
+
+function timer(callback, delay, time) {
+ var t = new Timer;
+ t.restart(callback, delay, time);
+ return t;
+}
+
+function timerFlush() {
+ now(); // Get the current time, if not already set.
+ ++frame; // Pretend we’ve set an alarm, if we haven’t already.
+ var t = taskHead, e;
+ while (t) {
+ if ((e = clockNow - t._time) >= 0) t._call.call(null, e);
+ t = t._next;
+ }
+ --frame;
+}
+
+function wake() {
+ clockNow = (clockLast = clock.now()) + clockSkew;
+ frame = timeout = 0;
+ try {
+ timerFlush();
+ } finally {
+ frame = 0;
+ nap();
+ clockNow = 0;
}
- var d3_geo_pathBoundsX0, d3_geo_pathBoundsY0, d3_geo_pathBoundsX1, d3_geo_pathBoundsY1;
- var d3_geo_pathBounds = {
- point: d3_geo_pathBoundsPoint,
- lineStart: d3_noop,
- lineEnd: d3_noop,
- polygonStart: d3_noop,
- polygonEnd: d3_noop
- };
- function d3_geo_pathBoundsPoint(x, y) {
- if (x < d3_geo_pathBoundsX0) d3_geo_pathBoundsX0 = x;
- if (x > d3_geo_pathBoundsX1) d3_geo_pathBoundsX1 = x;
- if (y < d3_geo_pathBoundsY0) d3_geo_pathBoundsY0 = y;
- if (y > d3_geo_pathBoundsY1) d3_geo_pathBoundsY1 = y;
- }
- function d3_geo_pathBuffer() {
- var pointCircle = d3_geo_pathBufferCircle(4.5), buffer = [];
- var stream = {
- point: point,
- lineStart: function() {
- stream.point = pointLineStart;
- },
- lineEnd: lineEnd,
- polygonStart: function() {
- stream.lineEnd = lineEndPolygon;
- },
- polygonEnd: function() {
- stream.lineEnd = lineEnd;
- stream.point = point;
- },
- pointRadius: function(_) {
- pointCircle = d3_geo_pathBufferCircle(_);
- return stream;
- },
- result: function() {
- if (buffer.length) {
- var result = buffer.join("");
- buffer = [];
- return result;
- }
- }
- };
- function point(x, y) {
- buffer.push("M", x, ",", y, pointCircle);
- }
- function pointLineStart(x, y) {
- buffer.push("M", x, ",", y);
- stream.point = pointLine;
- }
- function pointLine(x, y) {
- buffer.push("L", x, ",", y);
- }
- function lineEnd() {
- stream.point = point;
- }
- function lineEndPolygon() {
- buffer.push("Z");
+}
+
+function poke() {
+ var now = clock.now(), delay = now - clockLast;
+ if (delay > pokeDelay) clockSkew -= delay, clockLast = now;
+}
+
+function nap() {
+ var t0, t1 = taskHead, t2, time = Infinity;
+ while (t1) {
+ if (t1._call) {
+ if (time > t1._time) time = t1._time;
+ t0 = t1, t1 = t1._next;
+ } else {
+ t2 = t1._next, t1._next = null;
+ t1 = t0 ? t0._next = t2 : taskHead = t2;
}
- return stream;
- }
- function d3_geo_pathBufferCircle(radius) {
- return "m0," + radius + "a" + radius + "," + radius + " 0 1,1 0," + -2 * radius + "a" + radius + "," + radius + " 0 1,1 0," + 2 * radius + "z";
}
- var d3_geo_pathCentroid = {
- point: d3_geo_pathCentroidPoint,
- lineStart: d3_geo_pathCentroidLineStart,
- lineEnd: d3_geo_pathCentroidLineEnd,
- polygonStart: function() {
- d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidRingStart;
- },
- polygonEnd: function() {
- d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint;
- d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidLineStart;
- d3_geo_pathCentroid.lineEnd = d3_geo_pathCentroidLineEnd;
- }
- };
- function d3_geo_pathCentroidPoint(x, y) {
- d3_geo_centroidX0 += x;
- d3_geo_centroidY0 += y;
- ++d3_geo_centroidZ0;
- }
- function d3_geo_pathCentroidLineStart() {
- var x0, y0;
- d3_geo_pathCentroid.point = function(x, y) {
- d3_geo_pathCentroid.point = nextPoint;
- d3_geo_pathCentroidPoint(x0 = x, y0 = y);
- };
- function nextPoint(x, y) {
- var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy);
- d3_geo_centroidX1 += z * (x0 + x) / 2;
- d3_geo_centroidY1 += z * (y0 + y) / 2;
- d3_geo_centroidZ1 += z;
- d3_geo_pathCentroidPoint(x0 = x, y0 = y);
- }
- }
- function d3_geo_pathCentroidLineEnd() {
- d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint;
- }
- function d3_geo_pathCentroidRingStart() {
- var x00, y00, x0, y0;
- d3_geo_pathCentroid.point = function(x, y) {
- d3_geo_pathCentroid.point = nextPoint;
- d3_geo_pathCentroidPoint(x00 = x0 = x, y00 = y0 = y);
- };
- function nextPoint(x, y) {
- var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy);
- d3_geo_centroidX1 += z * (x0 + x) / 2;
- d3_geo_centroidY1 += z * (y0 + y) / 2;
- d3_geo_centroidZ1 += z;
- z = y0 * x - x0 * y;
- d3_geo_centroidX2 += z * (x0 + x);
- d3_geo_centroidY2 += z * (y0 + y);
- d3_geo_centroidZ2 += z * 3;
- d3_geo_pathCentroidPoint(x0 = x, y0 = y);
- }
- d3_geo_pathCentroid.lineEnd = function() {
- nextPoint(x00, y00);
- };
+ taskTail = t0;
+ sleep(time);
+}
+
+function sleep(time) {
+ if (frame) return; // Soonest alarm already set, or will be.
+ if (timeout) timeout = clearTimeout(timeout);
+ var delay = time - clockNow; // Strictly less than if we recomputed clockNow.
+ if (delay > 24) {
+ if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);
+ if (interval) interval = clearInterval(interval);
+ } else {
+ if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);
+ frame = 1, setFrame(wake);
+ }
+}
+
+function timeout$1(callback, delay, time) {
+ var t = new Timer;
+ delay = delay == null ? 0 : +delay;
+ t.restart(function(elapsed) {
+ t.stop();
+ callback(elapsed + delay);
+ }, delay, time);
+ return t;
+}
+
+function interval$1(callback, delay, time) {
+ var t = new Timer, total = delay;
+ if (delay == null) return t.restart(callback, delay, time), t;
+ delay = +delay, time = time == null ? now() : +time;
+ t.restart(function tick(elapsed) {
+ elapsed += total;
+ t.restart(tick, total += delay, time);
+ callback(elapsed);
+ }, delay, time);
+ return t;
+}
+
+var emptyOn = dispatch("start", "end", "cancel", "interrupt");
+var emptyTween = [];
+
+var CREATED = 0;
+var SCHEDULED = 1;
+var STARTING = 2;
+var STARTED = 3;
+var RUNNING = 4;
+var ENDING = 5;
+var ENDED = 6;
+
+function schedule(node, name, id, index, group, timing) {
+ var schedules = node.__transition;
+ if (!schedules) node.__transition = {};
+ else if (id in schedules) return;
+ create$1(node, id, {
+ name: name,
+ index: index, // For context during callback.
+ group: group, // For context during callback.
+ on: emptyOn,
+ tween: emptyTween,
+ time: timing.time,
+ delay: timing.delay,
+ duration: timing.duration,
+ ease: timing.ease,
+ timer: null,
+ state: CREATED
+ });
+}
+
+function init(node, id) {
+ var schedule = get$1(node, id);
+ if (schedule.state > CREATED) throw new Error("too late; already scheduled");
+ return schedule;
+}
+
+function set$1(node, id) {
+ var schedule = get$1(node, id);
+ if (schedule.state > STARTED) throw new Error("too late; already running");
+ return schedule;
+}
+
+function get$1(node, id) {
+ var schedule = node.__transition;
+ if (!schedule || !(schedule = schedule[id])) throw new Error("transition not found");
+ return schedule;
+}
+
+function create$1(node, id, self) {
+ var schedules = node.__transition,
+ tween;
+
+ // Initialize the self timer when the transition is created.
+ // Note the actual delay is not known until the first callback!
+ schedules[id] = self;
+ self.timer = timer(schedule, 0, self.time);
+
+ function schedule(elapsed) {
+ self.state = SCHEDULED;
+ self.timer.restart(start, self.delay, self.time);
+
+ // If the elapsed delay is less than our first sleep, start immediately.
+ if (self.delay <= elapsed) start(elapsed - self.delay);
}
- function d3_geo_pathContext(context) {
- var pointRadius = 4.5;
- var stream = {
- point: point,
- lineStart: function() {
- stream.point = pointLineStart;
- },
- lineEnd: lineEnd,
- polygonStart: function() {
- stream.lineEnd = lineEndPolygon;
- },
- polygonEnd: function() {
- stream.lineEnd = lineEnd;
- stream.point = point;
- },
- pointRadius: function(_) {
- pointRadius = _;
- return stream;
- },
- result: d3_noop
- };
- function point(x, y) {
- context.moveTo(x, y);
- context.arc(x, y, pointRadius, 0, Ï„);
- }
- function pointLineStart(x, y) {
- context.moveTo(x, y);
- stream.point = pointLine;
- }
- function pointLine(x, y) {
- context.lineTo(x, y);
- }
- function lineEnd() {
- stream.point = point;
+
+ function start(elapsed) {
+ var i, j, n, o;
+
+ // If the state is not SCHEDULED, then we previously errored on start.
+ if (self.state !== SCHEDULED) return stop();
+
+ for (i in schedules) {
+ o = schedules[i];
+ if (o.name !== self.name) continue;
+
+ // While this element already has a starting transition during this frame,
+ // defer starting an interrupting transition until that transition has a
+ // chance to tick (and possibly end); see d3/d3-transition#54!
+ if (o.state === STARTED) return timeout$1(start);
+
+ // Interrupt the active transition, if any.
+ if (o.state === RUNNING) {
+ o.state = ENDED;
+ o.timer.stop();
+ o.on.call("interrupt", node, node.__data__, o.index, o.group);
+ delete schedules[i];
+ }
+
+ // Cancel any pre-empted transitions.
+ else if (+i < id) {
+ o.state = ENDED;
+ o.timer.stop();
+ o.on.call("cancel", node, node.__data__, o.index, o.group);
+ delete schedules[i];
+ }
}
- function lineEndPolygon() {
- context.closePath();
+
+ // Defer the first tick to end of the current frame; see d3/d3#1576.
+ // Note the transition may be canceled after start and before the first tick!
+ // Note this must be scheduled before the start event; see d3/d3-transition#16!
+ // Assuming this is successful, subsequent callbacks go straight to tick.
+ timeout$1(function() {
+ if (self.state === STARTED) {
+ self.state = RUNNING;
+ self.timer.restart(tick, self.delay, self.time);
+ tick(elapsed);
+ }
+ });
+
+ // Dispatch the start event.
+ // Note this must be done before the tween are initialized.
+ self.state = STARTING;
+ self.on.call("start", node, node.__data__, self.index, self.group);
+ if (self.state !== STARTING) return; // interrupted
+ self.state = STARTED;
+
+ // Initialize the tween, deleting null tween.
+ tween = new Array(n = self.tween.length);
+ for (i = 0, j = -1; i < n; ++i) {
+ if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {
+ tween[++j] = o;
+ }
}
- return stream;
+ tween.length = j + 1;
}
- function d3_geo_resample(project) {
- var δ2 = .5, cosMinDistance = Math.cos(30 * d3_radians), maxDepth = 16;
- function resample(stream) {
- return (maxDepth ? resampleRecursive : resampleNone)(stream);
+
+ function tick(elapsed) {
+ var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1),
+ i = -1,
+ n = tween.length;
+
+ while (++i < n) {
+ tween[i].call(node, t);
}
- function resampleNone(stream) {
- return d3_geo_transformPoint(stream, function(x, y) {
- x = project(x, y);
- stream.point(x[0], x[1]);
- });
+
+ // Dispatch the end event.
+ if (self.state === ENDING) {
+ self.on.call("end", node, node.__data__, self.index, self.group);
+ stop();
}
- function resampleRecursive(stream) {
- var λ00, φ00, x00, y00, a00, b00, c00, λ0, x0, y0, a0, b0, c0;
- var resample = {
- point: point,
- lineStart: lineStart,
- lineEnd: lineEnd,
- polygonStart: function() {
- stream.polygonStart();
- resample.lineStart = ringStart;
- },
- polygonEnd: function() {
- stream.polygonEnd();
- resample.lineStart = lineStart;
+ }
+
+ function stop() {
+ self.state = ENDED;
+ self.timer.stop();
+ delete schedules[id];
+ for (var i in schedules) return; // eslint-disable-line no-unused-vars
+ delete node.__transition;
+ }
+}
+
+function interrupt(node, name) {
+ var schedules = node.__transition,
+ schedule$$1,
+ active,
+ empty = true,
+ i;
+
+ if (!schedules) return;
+
+ name = name == null ? null : name + "";
+
+ for (i in schedules) {
+ if ((schedule$$1 = schedules[i]).name !== name) { empty = false; continue; }
+ active = schedule$$1.state > STARTING && schedule$$1.state < ENDING;
+ schedule$$1.state = ENDED;
+ schedule$$1.timer.stop();
+ schedule$$1.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule$$1.index, schedule$$1.group);
+ delete schedules[i];
+ }
+
+ if (empty) delete node.__transition;
+}
+
+function selection_interrupt(name) {
+ return this.each(function() {
+ interrupt(this, name);
+ });
+}
+
+function tweenRemove(id, name) {
+ var tween0, tween1;
+ return function() {
+ var schedule$$1 = set$1(this, id),
+ tween = schedule$$1.tween;
+
+ // If this node shared tween with the previous node,
+ // just assign the updated shared tween and we’re done!
+ // Otherwise, copy-on-write.
+ if (tween !== tween0) {
+ tween1 = tween0 = tween;
+ for (var i = 0, n = tween1.length; i < n; ++i) {
+ if (tween1[i].name === name) {
+ tween1 = tween1.slice();
+ tween1.splice(i, 1);
+ break;
}
- };
- function point(x, y) {
- x = project(x, y);
- stream.point(x[0], x[1]);
- }
- function lineStart() {
- x0 = NaN;
- resample.point = linePoint;
- stream.lineStart();
}
- function linePoint(λ, φ) {
- var c = d3_geo_cartesian([ λ, φ ]), p = project(λ, φ);
- resampleLineTo(x0, y0, λ0, a0, b0, c0, x0 = p[0], y0 = p[1], λ0 = λ, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);
- stream.point(x0, y0);
- }
- function lineEnd() {
- resample.point = point;
- stream.lineEnd();
- }
- function ringStart() {
- lineStart();
- resample.point = ringPoint;
- resample.lineEnd = ringEnd;
- }
- function ringPoint(λ, φ) {
- linePoint(λ00 = λ, φ00 = φ), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0;
- resample.point = linePoint;
- }
- function ringEnd() {
- resampleLineTo(x0, y0, λ0, a0, b0, c0, x00, y00, λ00, a00, b00, c00, maxDepth, stream);
- resample.lineEnd = lineEnd;
- lineEnd();
- }
- return resample;
- }
- function resampleLineTo(x0, y0, λ0, a0, b0, c0, x1, y1, λ1, a1, b1, c1, depth, stream) {
- var dx = x1 - x0, dy = y1 - y0, d2 = dx * dx + dy * dy;
- if (d2 > 4 * δ2 && depth--) {
- var a = a0 + a1, b = b0 + b1, c = c0 + c1, m = Math.sqrt(a * a + b * b + c * c), φ2 = Math.asin(c /= m), λ2 = abs(abs(c) - 1) < ε || abs(λ0 - λ1) < ε ? (λ0 + λ1) / 2 : Math.atan2(b, a), p = project(λ2, φ2), x2 = p[0], y2 = p[1], dx2 = x2 - x0, dy2 = y2 - y0, dz = dy * dx2 - dx * dy2;
- if (dz * dz / d2 > δ2 || abs((dx * dx2 + dy * dy2) / d2 - .5) > .3 || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) {
- resampleLineTo(x0, y0, λ0, a0, b0, c0, x2, y2, λ2, a /= m, b /= m, c, depth, stream);
- stream.point(x2, y2);
- resampleLineTo(x2, y2, λ2, a, b, c, x1, y1, λ1, a1, b1, c1, depth, stream);
+ }
+
+ schedule$$1.tween = tween1;
+ };
+}
+
+function tweenFunction(id, name, value) {
+ var tween0, tween1;
+ if (typeof value !== "function") throw new Error;
+ return function() {
+ var schedule$$1 = set$1(this, id),
+ tween = schedule$$1.tween;
+
+ // If this node shared tween with the previous node,
+ // just assign the updated shared tween and we’re done!
+ // Otherwise, copy-on-write.
+ if (tween !== tween0) {
+ tween1 = (tween0 = tween).slice();
+ for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {
+ if (tween1[i].name === name) {
+ tween1[i] = t;
+ break;
}
}
+ if (i === n) tween1.push(t);
}
- resample.precision = function(_) {
- if (!arguments.length) return Math.sqrt(δ2);
- maxDepth = (δ2 = _ * _) > 0 && 16;
- return resample;
- };
- return resample;
- }
- d3.geo.path = function() {
- var pointRadius = 4.5, projection, context, projectStream, contextStream, cacheStream;
- function path(object) {
- if (object) {
- if (typeof pointRadius === "function") contextStream.pointRadius(+pointRadius.apply(this, arguments));
- if (!cacheStream || !cacheStream.valid) cacheStream = projectStream(contextStream);
- d3.geo.stream(object, cacheStream);
- }
- return contextStream.result();
- }
- path.area = function(object) {
- d3_geo_pathAreaSum = 0;
- d3.geo.stream(object, projectStream(d3_geo_pathArea));
- return d3_geo_pathAreaSum;
- };
- path.centroid = function(object) {
- d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0;
- d3.geo.stream(object, projectStream(d3_geo_pathCentroid));
- return d3_geo_centroidZ2 ? [ d3_geo_centroidX2 / d3_geo_centroidZ2, d3_geo_centroidY2 / d3_geo_centroidZ2 ] : d3_geo_centroidZ1 ? [ d3_geo_centroidX1 / d3_geo_centroidZ1, d3_geo_centroidY1 / d3_geo_centroidZ1 ] : d3_geo_centroidZ0 ? [ d3_geo_centroidX0 / d3_geo_centroidZ0, d3_geo_centroidY0 / d3_geo_centroidZ0 ] : [ NaN, NaN ];
- };
- path.bounds = function(object) {
- d3_geo_pathBoundsX1 = d3_geo_pathBoundsY1 = -(d3_geo_pathBoundsX0 = d3_geo_pathBoundsY0 = Infinity);
- d3.geo.stream(object, projectStream(d3_geo_pathBounds));
- return [ [ d3_geo_pathBoundsX0, d3_geo_pathBoundsY0 ], [ d3_geo_pathBoundsX1, d3_geo_pathBoundsY1 ] ];
- };
- path.projection = function(_) {
- if (!arguments.length) return projection;
- projectStream = (projection = _) ? _.stream || d3_geo_pathProjectStream(_) : d3_identity;
- return reset();
- };
- path.context = function(_) {
- if (!arguments.length) return context;
- contextStream = (context = _) == null ? new d3_geo_pathBuffer() : new d3_geo_pathContext(_);
- if (typeof pointRadius !== "function") contextStream.pointRadius(pointRadius);
- return reset();
- };
- path.pointRadius = function(_) {
- if (!arguments.length) return pointRadius;
- pointRadius = typeof _ === "function" ? _ : (contextStream.pointRadius(+_), +_);
- return path;
- };
- function reset() {
- cacheStream = null;
- return path;
- }
- return path.projection(d3.geo.albersUsa()).context(null);
+
+ schedule$$1.tween = tween1;
};
- function d3_geo_pathProjectStream(project) {
- var resample = d3_geo_resample(function(x, y) {
- return project([ x * d3_degrees, y * d3_degrees ]);
- });
- return function(stream) {
- return d3_geo_projectionRadians(resample(stream));
- };
- }
- d3.geo.transform = function(methods) {
- return {
- stream: function(stream) {
- var transform = new d3_geo_transform(stream);
- for (var k in methods) transform[k] = methods[k];
- return transform;
+}
+
+function transition_tween(name, value) {
+ var id = this._id;
+
+ name += "";
+
+ if (arguments.length < 2) {
+ var tween = get$1(this.node(), id).tween;
+ for (var i = 0, n = tween.length, t; i < n; ++i) {
+ if ((t = tween[i]).name === name) {
+ return t.value;
}
- };
- };
- function d3_geo_transform(stream) {
- this.stream = stream;
- }
- d3_geo_transform.prototype = {
- point: function(x, y) {
- this.stream.point(x, y);
- },
- sphere: function() {
- this.stream.sphere();
- },
- lineStart: function() {
- this.stream.lineStart();
- },
- lineEnd: function() {
- this.stream.lineEnd();
- },
- polygonStart: function() {
- this.stream.polygonStart();
- },
- polygonEnd: function() {
- this.stream.polygonEnd();
}
+ return null;
+ }
+
+ return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));
+}
+
+function tweenValue(transition, name, value) {
+ var id = transition._id;
+
+ transition.each(function() {
+ var schedule$$1 = set$1(this, id);
+ (schedule$$1.value || (schedule$$1.value = {}))[name] = value.apply(this, arguments);
+ });
+
+ return function(node) {
+ return get$1(node, id).value[name];
};
- function d3_geo_transformPoint(stream, point) {
- return {
- point: point,
- sphere: function() {
- stream.sphere();
- },
- lineStart: function() {
- stream.lineStart();
- },
- lineEnd: function() {
- stream.lineEnd();
- },
- polygonStart: function() {
- stream.polygonStart();
- },
- polygonEnd: function() {
- stream.polygonEnd();
- }
- };
- }
- d3.geo.projection = d3_geo_projection;
- d3.geo.projectionMutator = d3_geo_projectionMutator;
- function d3_geo_projection(project) {
- return d3_geo_projectionMutator(function() {
- return project;
- })();
- }
- function d3_geo_projectionMutator(projectAt) {
- var project, rotate, projectRotate, projectResample = d3_geo_resample(function(x, y) {
- x = project(x, y);
- return [ x[0] * k + δx, δy - x[1] * k ];
- }), k = 150, x = 480, y = 250, λ = 0, φ = 0, δλ = 0, δφ = 0, δγ = 0, δx, δy, preclip = d3_geo_clipAntimeridian, postclip = d3_identity, clipAngle = null, clipExtent = null, stream;
- function projection(point) {
- point = projectRotate(point[0] * d3_radians, point[1] * d3_radians);
- return [ point[0] * k + δx, δy - point[1] * k ];
- }
- function invert(point) {
- point = projectRotate.invert((point[0] - δx) / k, (δy - point[1]) / k);
- return point && [ point[0] * d3_degrees, point[1] * d3_degrees ];
- }
- projection.stream = function(output) {
- if (stream) stream.valid = false;
- stream = d3_geo_projectionRadians(preclip(rotate, projectResample(postclip(output))));
- stream.valid = true;
- return stream;
- };
- projection.clipAngle = function(_) {
- if (!arguments.length) return clipAngle;
- preclip = _ == null ? (clipAngle = _, d3_geo_clipAntimeridian) : d3_geo_clipCircle((clipAngle = +_) * d3_radians);
- return invalidate();
- };
- projection.clipExtent = function(_) {
- if (!arguments.length) return clipExtent;
- clipExtent = _;
- postclip = _ ? d3_geo_clipExtent(_[0][0], _[0][1], _[1][0], _[1][1]) : d3_identity;
- return invalidate();
- };
- projection.scale = function(_) {
- if (!arguments.length) return k;
- k = +_;
- return reset();
- };
- projection.translate = function(_) {
- if (!arguments.length) return [ x, y ];
- x = +_[0];
- y = +_[1];
- return reset();
- };
- projection.center = function(_) {
- if (!arguments.length) return [ λ * d3_degrees, φ * d3_degrees ];
- λ = _[0] % 360 * d3_radians;
- φ = _[1] % 360 * d3_radians;
- return reset();
- };
- projection.rotate = function(_) {
- if (!arguments.length) return [ δλ * d3_degrees, δφ * d3_degrees, δγ * d3_degrees ];
- δλ = _[0] % 360 * d3_radians;
- δφ = _[1] % 360 * d3_radians;
- δγ = _.length > 2 ? _[2] % 360 * d3_radians : 0;
- return reset();
- };
- d3.rebind(projection, projectResample, "precision");
- function reset() {
- projectRotate = d3_geo_compose(rotate = d3_geo_rotation(δλ, δφ, δγ), project);
- var center = project(λ, φ);
- δx = x - center[0] * k;
- δy = y + center[1] * k;
- return invalidate();
- }
- function invalidate() {
- if (stream) stream.valid = false, stream = null;
- return projection;
- }
- return function() {
- project = projectAt.apply(this, arguments);
- projection.invert = project.invert && invert;
- return reset();
- };
- }
- function d3_geo_projectionRadians(stream) {
- return d3_geo_transformPoint(stream, function(x, y) {
- stream.point(x * d3_radians, y * d3_radians);
- });
- }
- function d3_geo_equirectangular(λ, φ) {
- return [ λ, φ ];
- }
- (d3.geo.equirectangular = function() {
- return d3_geo_projection(d3_geo_equirectangular);
- }).raw = d3_geo_equirectangular.invert = d3_geo_equirectangular;
- d3.geo.rotation = function(rotate) {
- rotate = d3_geo_rotation(rotate[0] % 360 * d3_radians, rotate[1] * d3_radians, rotate.length > 2 ? rotate[2] * d3_radians : 0);
- function forward(coordinates) {
- coordinates = rotate(coordinates[0] * d3_radians, coordinates[1] * d3_radians);
- return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates;
- }
- forward.invert = function(coordinates) {
- coordinates = rotate.invert(coordinates[0] * d3_radians, coordinates[1] * d3_radians);
- return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates;
- };
- return forward;
+}
+
+function interpolate(a, b) {
+ var c;
+ return (typeof b === "number" ? interpolateNumber
+ : b instanceof color ? interpolateRgb
+ : (c = color(b)) ? (b = c, interpolateRgb)
+ : interpolateString)(a, b);
+}
+
+function attrRemove$1(name) {
+ return function() {
+ this.removeAttribute(name);
};
- function d3_geo_identityRotation(λ, φ) {
- return [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ];
- }
- d3_geo_identityRotation.invert = d3_geo_equirectangular;
- function d3_geo_rotation(δλ, δφ, δγ) {
- return δλ ? δφ || δγ ? d3_geo_compose(d3_geo_rotationλ(δλ), d3_geo_rotationφγ(δφ, δγ)) : d3_geo_rotationλ(δλ) : δφ || δγ ? d3_geo_rotationφγ(δφ, δγ) : d3_geo_identityRotation;
- }
- function d3_geo_forwardRotationλ(δλ) {
- return function(λ, φ) {
- return λ += δλ, [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ];
- };
- }
- function d3_geo_rotationλ(δλ) {
- var rotation = d3_geo_forwardRotationλ(δλ);
- rotation.invert = d3_geo_forwardRotationλ(-δλ);
- return rotation;
- }
- function d3_geo_rotationφγ(δφ, δγ) {
- var cosδφ = Math.cos(δφ), sinδφ = Math.sin(δφ), cosδγ = Math.cos(δγ), sinδγ = Math.sin(δγ);
- function rotation(λ, φ) {
- var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδφ + x * sinδφ;
- return [ Math.atan2(y * cosδγ - k * sinδγ, x * cosδφ - z * sinδφ), d3_asin(k * cosδγ + y * sinδγ) ];
- }
- rotation.invert = function(λ, φ) {
- var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδγ - y * sinδγ;
- return [ Math.atan2(y * cosδγ + z * sinδγ, x * cosδφ + k * sinδφ), d3_asin(k * cosδφ - x * sinδφ) ];
- };
- return rotation;
- }
- d3.geo.circle = function() {
- var origin = [ 0, 0 ], angle, precision = 6, interpolate;
- function circle() {
- var center = typeof origin === "function" ? origin.apply(this, arguments) : origin, rotate = d3_geo_rotation(-center[0] * d3_radians, -center[1] * d3_radians, 0).invert, ring = [];
- interpolate(null, null, 1, {
- point: function(x, y) {
- ring.push(x = rotate(x, y));
- x[0] *= d3_degrees, x[1] *= d3_degrees;
- }
- });
- return {
- type: "Polygon",
- coordinates: [ ring ]
- };
- }
- circle.origin = function(x) {
- if (!arguments.length) return origin;
- origin = x;
- return circle;
- };
- circle.angle = function(x) {
- if (!arguments.length) return angle;
- interpolate = d3_geo_circleInterpolate((angle = +x) * d3_radians, precision * d3_radians);
- return circle;
- };
- circle.precision = function(_) {
- if (!arguments.length) return precision;
- interpolate = d3_geo_circleInterpolate(angle * d3_radians, (precision = +_) * d3_radians);
- return circle;
- };
- return circle.angle(90);
- };
- function d3_geo_circleInterpolate(radius, precision) {
- var cr = Math.cos(radius), sr = Math.sin(radius);
- return function(from, to, direction, listener) {
- var step = direction * precision;
- if (from != null) {
- from = d3_geo_circleAngle(cr, from);
- to = d3_geo_circleAngle(cr, to);
- if (direction > 0 ? from < to : from > to) from += direction * Ï„;
- } else {
- from = radius + direction * Ï„;
- to = radius - .5 * step;
- }
- for (var point, t = from; direction > 0 ? t > to : t < to; t -= step) {
- listener.point((point = d3_geo_spherical([ cr, -sr * Math.cos(t), -sr * Math.sin(t) ]))[0], point[1]);
- }
- };
- }
- function d3_geo_circleAngle(cr, point) {
- var a = d3_geo_cartesian(point);
- a[0] -= cr;
- d3_geo_cartesianNormalize(a);
- var angle = d3_acos(-a[1]);
- return ((-a[2] < 0 ? -angle : angle) + 2 * Math.PI - ε) % (2 * Math.PI);
- }
- d3.geo.distance = function(a, b) {
- var Δλ = (b[0] - a[0]) * d3_radians, φ0 = a[1] * d3_radians, φ1 = b[1] * d3_radians, sinΔλ = Math.sin(Δλ), cosΔλ = Math.cos(Δλ), sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), sinφ1 = Math.sin(φ1), cosφ1 = Math.cos(φ1), t;
- return Math.atan2(Math.sqrt((t = cosφ1 * sinΔλ) * t + (t = cosφ0 * sinφ1 - sinφ0 * cosφ1 * cosΔλ) * t), sinφ0 * sinφ1 + cosφ0 * cosφ1 * cosΔλ);
+}
+
+function attrRemoveNS$1(fullname) {
+ return function() {
+ this.removeAttributeNS(fullname.space, fullname.local);
};
- d3.geo.graticule = function() {
- var x1, x0, X1, X0, y1, y0, Y1, Y0, dx = 10, dy = dx, DX = 90, DY = 360, x, y, X, Y, precision = 2.5;
- function graticule() {
- return {
- type: "MultiLineString",
- coordinates: lines()
- };
- }
- function lines() {
- return d3.range(Math.ceil(X0 / DX) * DX, X1, DX).map(X).concat(d3.range(Math.ceil(Y0 / DY) * DY, Y1, DY).map(Y)).concat(d3.range(Math.ceil(x0 / dx) * dx, x1, dx).filter(function(x) {
- return abs(x % DX) > ε;
- }).map(x)).concat(d3.range(Math.ceil(y0 / dy) * dy, y1, dy).filter(function(y) {
- return abs(y % DY) > ε;
- }).map(y));
- }
- graticule.lines = function() {
- return lines().map(function(coordinates) {
- return {
- type: "LineString",
- coordinates: coordinates
- };
- });
- };
- graticule.outline = function() {
- return {
- type: "Polygon",
- coordinates: [ X(X0).concat(Y(Y1).slice(1), X(X1).reverse().slice(1), Y(Y0).reverse().slice(1)) ]
- };
- };
- graticule.extent = function(_) {
- if (!arguments.length) return graticule.minorExtent();
- return graticule.majorExtent(_).minorExtent(_);
- };
- graticule.majorExtent = function(_) {
- if (!arguments.length) return [ [ X0, Y0 ], [ X1, Y1 ] ];
- X0 = +_[0][0], X1 = +_[1][0];
- Y0 = +_[0][1], Y1 = +_[1][1];
- if (X0 > X1) _ = X0, X0 = X1, X1 = _;
- if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _;
- return graticule.precision(precision);
- };
- graticule.minorExtent = function(_) {
- if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ];
- x0 = +_[0][0], x1 = +_[1][0];
- y0 = +_[0][1], y1 = +_[1][1];
- if (x0 > x1) _ = x0, x0 = x1, x1 = _;
- if (y0 > y1) _ = y0, y0 = y1, y1 = _;
- return graticule.precision(precision);
- };
- graticule.step = function(_) {
- if (!arguments.length) return graticule.minorStep();
- return graticule.majorStep(_).minorStep(_);
- };
- graticule.majorStep = function(_) {
- if (!arguments.length) return [ DX, DY ];
- DX = +_[0], DY = +_[1];
- return graticule;
- };
- graticule.minorStep = function(_) {
- if (!arguments.length) return [ dx, dy ];
- dx = +_[0], dy = +_[1];
- return graticule;
- };
- graticule.precision = function(_) {
- if (!arguments.length) return precision;
- precision = +_;
- x = d3_geo_graticuleX(y0, y1, 90);
- y = d3_geo_graticuleY(x0, x1, precision);
- X = d3_geo_graticuleX(Y0, Y1, 90);
- Y = d3_geo_graticuleY(X0, X1, precision);
- return graticule;
- };
- return graticule.majorExtent([ [ -180, -90 + ε ], [ 180, 90 - ε ] ]).minorExtent([ [ -180, -80 - ε ], [ 180, 80 + ε ] ]);
+}
+
+function attrConstant$1(name, interpolate$$1, value1) {
+ var string00,
+ string1 = value1 + "",
+ interpolate0;
+ return function() {
+ var string0 = this.getAttribute(name);
+ return string0 === string1 ? null
+ : string0 === string00 ? interpolate0
+ : interpolate0 = interpolate$$1(string00 = string0, value1);
};
- function d3_geo_graticuleX(y0, y1, dy) {
- var y = d3.range(y0, y1 - ε, dy).concat(y1);
- return function(x) {
- return y.map(function(y) {
- return [ x, y ];
- });
- };
- }
- function d3_geo_graticuleY(x0, x1, dx) {
- var x = d3.range(x0, x1 - ε, dx).concat(x1);
- return function(y) {
- return x.map(function(x) {
- return [ x, y ];
- });
- };
- }
- function d3_source(d) {
- return d.source;
- }
- function d3_target(d) {
- return d.target;
- }
- d3.geo.greatArc = function() {
- var source = d3_source, source_, target = d3_target, target_;
- function greatArc() {
- return {
- type: "LineString",
- coordinates: [ source_ || source.apply(this, arguments), target_ || target.apply(this, arguments) ]
- };
- }
- greatArc.distance = function() {
- return d3.geo.distance(source_ || source.apply(this, arguments), target_ || target.apply(this, arguments));
- };
- greatArc.source = function(_) {
- if (!arguments.length) return source;
- source = _, source_ = typeof _ === "function" ? null : _;
- return greatArc;
- };
- greatArc.target = function(_) {
- if (!arguments.length) return target;
- target = _, target_ = typeof _ === "function" ? null : _;
- return greatArc;
- };
- greatArc.precision = function() {
- return arguments.length ? greatArc : 0;
- };
- return greatArc;
- };
- d3.geo.interpolate = function(source, target) {
- return d3_geo_interpolate(source[0] * d3_radians, source[1] * d3_radians, target[0] * d3_radians, target[1] * d3_radians);
- };
- function d3_geo_interpolate(x0, y0, x1, y1) {
- var cy0 = Math.cos(y0), sy0 = Math.sin(y0), cy1 = Math.cos(y1), sy1 = Math.sin(y1), kx0 = cy0 * Math.cos(x0), ky0 = cy0 * Math.sin(x0), kx1 = cy1 * Math.cos(x1), ky1 = cy1 * Math.sin(x1), d = 2 * Math.asin(Math.sqrt(d3_haversin(y1 - y0) + cy0 * cy1 * d3_haversin(x1 - x0))), k = 1 / Math.sin(d);
- var interpolate = d ? function(t) {
- var B = Math.sin(t *= d) * k, A = Math.sin(d - t) * k, x = A * kx0 + B * kx1, y = A * ky0 + B * ky1, z = A * sy0 + B * sy1;
- return [ Math.atan2(y, x) * d3_degrees, Math.atan2(z, Math.sqrt(x * x + y * y)) * d3_degrees ];
- } : function() {
- return [ x0 * d3_degrees, y0 * d3_degrees ];
- };
- interpolate.distance = d;
- return interpolate;
- }
- d3.geo.length = function(object) {
- d3_geo_lengthSum = 0;
- d3.geo.stream(object, d3_geo_length);
- return d3_geo_lengthSum;
- };
- var d3_geo_lengthSum;
- var d3_geo_length = {
- sphere: d3_noop,
- point: d3_noop,
- lineStart: d3_geo_lengthLineStart,
- lineEnd: d3_noop,
- polygonStart: d3_noop,
- polygonEnd: d3_noop
- };
- function d3_geo_lengthLineStart() {
- var λ0, sinφ0, cosφ0;
- d3_geo_length.point = function(λ, φ) {
- λ0 = λ * d3_radians, sinφ0 = Math.sin(φ *= d3_radians), cosφ0 = Math.cos(φ);
- d3_geo_length.point = nextPoint;
- };
- d3_geo_length.lineEnd = function() {
- d3_geo_length.point = d3_geo_length.lineEnd = d3_noop;
- };
- function nextPoint(λ, φ) {
- var sinφ = Math.sin(φ *= d3_radians), cosφ = Math.cos(φ), t = abs((λ *= d3_radians) - λ0), cosΔλ = Math.cos(t);
- d3_geo_lengthSum += Math.atan2(Math.sqrt((t = cosφ * Math.sin(t)) * t + (t = cosφ0 * sinφ - sinφ0 * cosφ * cosΔλ) * t), sinφ0 * sinφ + cosφ0 * cosφ * cosΔλ);
- λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ;
+}
+
+function attrConstantNS$1(fullname, interpolate$$1, value1) {
+ var string00,
+ string1 = value1 + "",
+ interpolate0;
+ return function() {
+ var string0 = this.getAttributeNS(fullname.space, fullname.local);
+ return string0 === string1 ? null
+ : string0 === string00 ? interpolate0
+ : interpolate0 = interpolate$$1(string00 = string0, value1);
+ };
+}
+
+function attrFunction$1(name, interpolate$$1, value) {
+ var string00,
+ string10,
+ interpolate0;
+ return function() {
+ var string0, value1 = value(this), string1;
+ if (value1 == null) return void this.removeAttribute(name);
+ string0 = this.getAttribute(name);
+ string1 = value1 + "";
+ return string0 === string1 ? null
+ : string0 === string00 && string1 === string10 ? interpolate0
+ : (string10 = string1, interpolate0 = interpolate$$1(string00 = string0, value1));
+ };
+}
+
+function attrFunctionNS$1(fullname, interpolate$$1, value) {
+ var string00,
+ string10,
+ interpolate0;
+ return function() {
+ var string0, value1 = value(this), string1;
+ if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);
+ string0 = this.getAttributeNS(fullname.space, fullname.local);
+ string1 = value1 + "";
+ return string0 === string1 ? null
+ : string0 === string00 && string1 === string10 ? interpolate0
+ : (string10 = string1, interpolate0 = interpolate$$1(string00 = string0, value1));
+ };
+}
+
+function transition_attr(name, value) {
+ var fullname = namespace(name), i = fullname === "transform" ? interpolateTransformSvg : interpolate;
+ return this.attrTween(name, typeof value === "function"
+ ? (fullname.local ? attrFunctionNS$1 : attrFunction$1)(fullname, i, tweenValue(this, "attr." + name, value))
+ : value == null ? (fullname.local ? attrRemoveNS$1 : attrRemove$1)(fullname)
+ : (fullname.local ? attrConstantNS$1 : attrConstant$1)(fullname, i, value));
+}
+
+function attrInterpolate(name, i) {
+ return function(t) {
+ this.setAttribute(name, i(t));
+ };
+}
+
+function attrInterpolateNS(fullname, i) {
+ return function(t) {
+ this.setAttributeNS(fullname.space, fullname.local, i(t));
+ };
+}
+
+function attrTweenNS(fullname, value) {
+ var t0, i0;
+ function tween() {
+ var i = value.apply(this, arguments);
+ if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);
+ return t0;
+ }
+ tween._value = value;
+ return tween;
+}
+
+function attrTween(name, value) {
+ var t0, i0;
+ function tween() {
+ var i = value.apply(this, arguments);
+ if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);
+ return t0;
+ }
+ tween._value = value;
+ return tween;
+}
+
+function transition_attrTween(name, value) {
+ var key = "attr." + name;
+ if (arguments.length < 2) return (key = this.tween(key)) && key._value;
+ if (value == null) return this.tween(key, null);
+ if (typeof value !== "function") throw new Error;
+ var fullname = namespace(name);
+ return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));
+}
+
+function delayFunction(id, value) {
+ return function() {
+ init(this, id).delay = +value.apply(this, arguments);
+ };
+}
+
+function delayConstant(id, value) {
+ return value = +value, function() {
+ init(this, id).delay = value;
+ };
+}
+
+function transition_delay(value) {
+ var id = this._id;
+
+ return arguments.length
+ ? this.each((typeof value === "function"
+ ? delayFunction
+ : delayConstant)(id, value))
+ : get$1(this.node(), id).delay;
+}
+
+function durationFunction(id, value) {
+ return function() {
+ set$1(this, id).duration = +value.apply(this, arguments);
+ };
+}
+
+function durationConstant(id, value) {
+ return value = +value, function() {
+ set$1(this, id).duration = value;
+ };
+}
+
+function transition_duration(value) {
+ var id = this._id;
+
+ return arguments.length
+ ? this.each((typeof value === "function"
+ ? durationFunction
+ : durationConstant)(id, value))
+ : get$1(this.node(), id).duration;
+}
+
+function easeConstant(id, value) {
+ if (typeof value !== "function") throw new Error;
+ return function() {
+ set$1(this, id).ease = value;
+ };
+}
+
+function transition_ease(value) {
+ var id = this._id;
+
+ return arguments.length
+ ? this.each(easeConstant(id, value))
+ : get$1(this.node(), id).ease;
+}
+
+function transition_filter(match) {
+ if (typeof match !== "function") match = matcher(match);
+
+ for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
+ for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {
+ if ((node = group[i]) && match.call(node, node.__data__, i, group)) {
+ subgroup.push(node);
+ }
}
}
- function d3_geo_azimuthal(scale, angle) {
- function azimuthal(λ, φ) {
- var cosλ = Math.cos(λ), cosφ = Math.cos(φ), k = scale(cosλ * cosφ);
- return [ k * cosφ * Math.sin(λ), k * Math.sin(φ) ];
+
+ return new Transition(subgroups, this._parents, this._name, this._id);
+}
+
+function transition_merge(transition$$1) {
+ if (transition$$1._id !== this._id) throw new Error;
+
+ for (var groups0 = this._groups, groups1 = transition$$1._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {
+ for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {
+ if (node = group0[i] || group1[i]) {
+ merge[i] = node;
+ }
}
- azimuthal.invert = function(x, y) {
- var Ï = Math.sqrt(x * x + y * y), c = angle(Ï), sinc = Math.sin(c), cosc = Math.cos(c);
- return [ Math.atan2(x * sinc, Ï * cosc), Math.asin(Ï && y * sinc / Ï) ];
- };
- return azimuthal;
}
- var d3_geo_azimuthalEqualArea = d3_geo_azimuthal(function(cosλcosφ) {
- return Math.sqrt(2 / (1 + cosλcosφ));
- }, function(Ï) {
- return 2 * Math.asin(Ï / 2);
+
+ for (; j < m0; ++j) {
+ merges[j] = groups0[j];
+ }
+
+ return new Transition(merges, this._parents, this._name, this._id);
+}
+
+function start(name) {
+ return (name + "").trim().split(/^|\s+/).every(function(t) {
+ var i = t.indexOf(".");
+ if (i >= 0) t = t.slice(0, i);
+ return !t || t === "start";
});
- (d3.geo.azimuthalEqualArea = function() {
- return d3_geo_projection(d3_geo_azimuthalEqualArea);
- }).raw = d3_geo_azimuthalEqualArea;
- var d3_geo_azimuthalEquidistant = d3_geo_azimuthal(function(cosλcosφ) {
- var c = Math.acos(cosλcosφ);
- return c && c / Math.sin(c);
- }, d3_identity);
- (d3.geo.azimuthalEquidistant = function() {
- return d3_geo_projection(d3_geo_azimuthalEquidistant);
- }).raw = d3_geo_azimuthalEquidistant;
- function d3_geo_conicConformal(φ0, φ1) {
- var cosφ0 = Math.cos(φ0), t = function(φ) {
- return Math.tan(π / 4 + φ / 2);
- }, n = φ0 === φ1 ? Math.sin(φ0) : Math.log(cosφ0 / Math.cos(φ1)) / Math.log(t(φ1) / t(φ0)), F = cosφ0 * Math.pow(t(φ0), n) / n;
- if (!n) return d3_geo_mercator;
- function forward(λ, φ) {
- if (F > 0) {
- if (φ < -halfπ + ε) φ = -halfπ + ε;
- } else {
- if (φ > halfπ - ε) φ = halfπ - ε;
+}
+
+function onFunction(id, name, listener) {
+ var on0, on1, sit = start(name) ? init : set$1;
+ return function() {
+ var schedule$$1 = sit(this, id),
+ on = schedule$$1.on;
+
+ // If this node shared a dispatch with the previous node,
+ // just assign the updated shared dispatch and we’re done!
+ // Otherwise, copy-on-write.
+ if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);
+
+ schedule$$1.on = on1;
+ };
+}
+
+function transition_on(name, listener) {
+ var id = this._id;
+
+ return arguments.length < 2
+ ? get$1(this.node(), id).on.on(name)
+ : this.each(onFunction(id, name, listener));
+}
+
+function removeFunction(id) {
+ return function() {
+ var parent = this.parentNode;
+ for (var i in this.__transition) if (+i !== id) return;
+ if (parent) parent.removeChild(this);
+ };
+}
+
+function transition_remove() {
+ return this.on("end.remove", removeFunction(this._id));
+}
+
+function transition_select(select$$1) {
+ var name = this._name,
+ id = this._id;
+
+ if (typeof select$$1 !== "function") select$$1 = selector(select$$1);
+
+ for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
+ for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {
+ if ((node = group[i]) && (subnode = select$$1.call(node, node.__data__, i, group))) {
+ if ("__data__" in node) subnode.__data__ = node.__data__;
+ subgroup[i] = subnode;
+ schedule(subgroup[i], name, id, i, subgroup, get$1(node, id));
}
- var Ï = F / Math.pow(t(φ), n);
- return [ Ï * Math.sin(n * λ), F - Ï * Math.cos(n * λ) ];
}
- forward.invert = function(x, y) {
- var Ï0_y = F - y, Ï = d3_sgn(n) * Math.sqrt(x * x + Ï0_y * Ï0_y);
- return [ Math.atan2(x, Ï0_y) / n, 2 * Math.atan(Math.pow(F / Ï, 1 / n)) - halfÏ€ ];
- };
- return forward;
- }
- (d3.geo.conicConformal = function() {
- return d3_geo_conic(d3_geo_conicConformal);
- }).raw = d3_geo_conicConformal;
- function d3_geo_conicEquidistant(φ0, φ1) {
- var cosφ0 = Math.cos(φ0), n = φ0 === φ1 ? Math.sin(φ0) : (cosφ0 - Math.cos(φ1)) / (φ1 - φ0), G = cosφ0 / n + φ0;
- if (abs(n) < ε) return d3_geo_equirectangular;
- function forward(λ, φ) {
- var Ï = G - φ;
- return [ Ï * Math.sin(n * λ), G - Ï * Math.cos(n * λ) ];
- }
- forward.invert = function(x, y) {
- var Ï0_y = G - y;
- return [ Math.atan2(x, Ï0_y) / n, G - d3_sgn(n) * Math.sqrt(x * x + Ï0_y * Ï0_y) ];
- };
- return forward;
- }
- (d3.geo.conicEquidistant = function() {
- return d3_geo_conic(d3_geo_conicEquidistant);
- }).raw = d3_geo_conicEquidistant;
- var d3_geo_gnomonic = d3_geo_azimuthal(function(cosλcosφ) {
- return 1 / cosλcosφ;
- }, Math.atan);
- (d3.geo.gnomonic = function() {
- return d3_geo_projection(d3_geo_gnomonic);
- }).raw = d3_geo_gnomonic;
- function d3_geo_mercator(λ, φ) {
- return [ λ, Math.log(Math.tan(π / 4 + φ / 2)) ];
- }
- d3_geo_mercator.invert = function(x, y) {
- return [ x, 2 * Math.atan(Math.exp(y)) - halfπ ];
- };
- function d3_geo_mercatorProjection(project) {
- var m = d3_geo_projection(project), scale = m.scale, translate = m.translate, clipExtent = m.clipExtent, clipAuto;
- m.scale = function() {
- var v = scale.apply(m, arguments);
- return v === m ? clipAuto ? m.clipExtent(null) : m : v;
- };
- m.translate = function() {
- var v = translate.apply(m, arguments);
- return v === m ? clipAuto ? m.clipExtent(null) : m : v;
- };
- m.clipExtent = function(_) {
- var v = clipExtent.apply(m, arguments);
- if (v === m) {
- if (clipAuto = _ == null) {
- var k = π * scale(), t = translate();
- clipExtent([ [ t[0] - k, t[1] - k ], [ t[0] + k, t[1] + k ] ]);
+ }
+
+ return new Transition(subgroups, this._parents, name, id);
+}
+
+function transition_selectAll(select$$1) {
+ var name = this._name,
+ id = this._id;
+
+ if (typeof select$$1 !== "function") select$$1 = selectorAll(select$$1);
+
+ for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {
+ for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
+ if (node = group[i]) {
+ for (var children = select$$1.call(node, node.__data__, i, group), child, inherit = get$1(node, id), k = 0, l = children.length; k < l; ++k) {
+ if (child = children[k]) {
+ schedule(child, name, id, k, children, inherit);
+ }
}
- } else if (clipAuto) {
- v = null;
+ subgroups.push(children);
+ parents.push(node);
}
- return v;
- };
- return m.clipExtent(null);
- }
- (d3.geo.mercator = function() {
- return d3_geo_mercatorProjection(d3_geo_mercator);
- }).raw = d3_geo_mercator;
- var d3_geo_orthographic = d3_geo_azimuthal(function() {
- return 1;
- }, Math.asin);
- (d3.geo.orthographic = function() {
- return d3_geo_projection(d3_geo_orthographic);
- }).raw = d3_geo_orthographic;
- var d3_geo_stereographic = d3_geo_azimuthal(function(cosλcosφ) {
- return 1 / (1 + cosλcosφ);
- }, function(Ï) {
- return 2 * Math.atan(Ï);
- });
- (d3.geo.stereographic = function() {
- return d3_geo_projection(d3_geo_stereographic);
- }).raw = d3_geo_stereographic;
- function d3_geo_transverseMercator(λ, φ) {
- return [ Math.log(Math.tan(π / 4 + φ / 2)), -λ ];
- }
- d3_geo_transverseMercator.invert = function(x, y) {
- return [ -y, 2 * Math.atan(Math.exp(x)) - halfπ ];
- };
- (d3.geo.transverseMercator = function() {
- var projection = d3_geo_mercatorProjection(d3_geo_transverseMercator), center = projection.center, rotate = projection.rotate;
- projection.center = function(_) {
- return _ ? center([ -_[1], _[0] ]) : (_ = center(), [ _[1], -_[0] ]);
- };
- projection.rotate = function(_) {
- return _ ? rotate([ _[0], _[1], _.length > 2 ? _[2] + 90 : 90 ]) : (_ = rotate(),
- [ _[0], _[1], _[2] - 90 ]);
- };
- return rotate([ 0, 0, 90 ]);
- }).raw = d3_geo_transverseMercator;
- d3.geom = {};
- function d3_geom_pointX(d) {
- return d[0];
- }
- function d3_geom_pointY(d) {
- return d[1];
- }
- d3.geom.hull = function(vertices) {
- var x = d3_geom_pointX, y = d3_geom_pointY;
- if (arguments.length) return hull(vertices);
- function hull(data) {
- if (data.length < 3) return [];
- var fx = d3_functor(x), fy = d3_functor(y), i, n = data.length, points = [], flippedPoints = [];
- for (i = 0; i < n; i++) {
- points.push([ +fx.call(this, data[i], i), +fy.call(this, data[i], i), i ]);
- }
- points.sort(d3_geom_hullOrder);
- for (i = 0; i < n; i++) flippedPoints.push([ points[i][0], -points[i][1] ]);
- var upper = d3_geom_hullUpper(points), lower = d3_geom_hullUpper(flippedPoints);
- var skipLeft = lower[0] === upper[0], skipRight = lower[lower.length - 1] === upper[upper.length - 1], polygon = [];
- for (i = upper.length - 1; i >= 0; --i) polygon.push(data[points[upper[i]][2]]);
- for (i = +skipLeft; i < lower.length - skipRight; ++i) polygon.push(data[points[lower[i]][2]]);
- return polygon;
- }
- hull.x = function(_) {
- return arguments.length ? (x = _, hull) : x;
- };
- hull.y = function(_) {
- return arguments.length ? (y = _, hull) : y;
- };
- return hull;
- };
- function d3_geom_hullUpper(points) {
- var n = points.length, hull = [ 0, 1 ], hs = 2;
- for (var i = 2; i < n; i++) {
- while (hs > 1 && d3_cross2d(points[hull[hs - 2]], points[hull[hs - 1]], points[i]) <= 0) --hs;
- hull[hs++] = i;
}
- return hull.slice(0, hs);
- }
- function d3_geom_hullOrder(a, b) {
- return a[0] - b[0] || a[1] - b[1];
}
- d3.geom.polygon = function(coordinates) {
- d3_subclass(coordinates, d3_geom_polygonPrototype);
- return coordinates;
+
+ return new Transition(subgroups, parents, name, id);
+}
+
+var Selection$1 = selection.prototype.constructor;
+
+function transition_selection() {
+ return new Selection$1(this._groups, this._parents);
+}
+
+function styleNull(name, interpolate$$1) {
+ var string00,
+ string10,
+ interpolate0;
+ return function() {
+ var string0 = styleValue(this, name),
+ string1 = (this.style.removeProperty(name), styleValue(this, name));
+ return string0 === string1 ? null
+ : string0 === string00 && string1 === string10 ? interpolate0
+ : interpolate0 = interpolate$$1(string00 = string0, string10 = string1);
};
- var d3_geom_polygonPrototype = d3.geom.polygon.prototype = [];
- d3_geom_polygonPrototype.area = function() {
- var i = -1, n = this.length, a, b = this[n - 1], area = 0;
- while (++i < n) {
- a = b;
- b = this[i];
- area += a[1] * b[0] - a[0] * b[1];
- }
- return area * .5;
+}
+
+function styleRemove$1(name) {
+ return function() {
+ this.style.removeProperty(name);
};
- d3_geom_polygonPrototype.centroid = function(k) {
- var i = -1, n = this.length, x = 0, y = 0, a, b = this[n - 1], c;
- if (!arguments.length) k = -1 / (6 * this.area());
- while (++i < n) {
- a = b;
- b = this[i];
- c = a[0] * b[1] - b[0] * a[1];
- x += (a[0] + b[0]) * c;
- y += (a[1] + b[1]) * c;
- }
- return [ x * k, y * k ];
+}
+
+function styleConstant$1(name, interpolate$$1, value1) {
+ var string00,
+ string1 = value1 + "",
+ interpolate0;
+ return function() {
+ var string0 = styleValue(this, name);
+ return string0 === string1 ? null
+ : string0 === string00 ? interpolate0
+ : interpolate0 = interpolate$$1(string00 = string0, value1);
};
- d3_geom_polygonPrototype.clip = function(subject) {
- var input, closed = d3_geom_polygonClosed(subject), i = -1, n = this.length - d3_geom_polygonClosed(this), j, m, a = this[n - 1], b, c, d;
- while (++i < n) {
- input = subject.slice();
- subject.length = 0;
- b = this[i];
- c = input[(m = input.length - closed) - 1];
- j = -1;
- while (++j < m) {
- d = input[j];
- if (d3_geom_polygonInside(d, a, b)) {
- if (!d3_geom_polygonInside(c, a, b)) {
- subject.push(d3_geom_polygonIntersect(c, d, a, b));
- }
- subject.push(d);
- } else if (d3_geom_polygonInside(c, a, b)) {
- subject.push(d3_geom_polygonIntersect(c, d, a, b));
- }
- c = d;
- }
- if (closed) subject.push(subject[0]);
- a = b;
- }
- return subject;
- };
- function d3_geom_polygonInside(p, a, b) {
- return (b[0] - a[0]) * (p[1] - a[1]) < (b[1] - a[1]) * (p[0] - a[0]);
- }
- function d3_geom_polygonIntersect(c, d, a, b) {
- var x1 = c[0], x3 = a[0], x21 = d[0] - x1, x43 = b[0] - x3, y1 = c[1], y3 = a[1], y21 = d[1] - y1, y43 = b[1] - y3, ua = (x43 * (y1 - y3) - y43 * (x1 - x3)) / (y43 * x21 - x43 * y21);
- return [ x1 + ua * x21, y1 + ua * y21 ];
- }
- function d3_geom_polygonClosed(coordinates) {
- var a = coordinates[0], b = coordinates[coordinates.length - 1];
- return !(a[0] - b[0] || a[1] - b[1]);
- }
- var d3_geom_voronoiEdges, d3_geom_voronoiCells, d3_geom_voronoiBeaches, d3_geom_voronoiBeachPool = [], d3_geom_voronoiFirstCircle, d3_geom_voronoiCircles, d3_geom_voronoiCirclePool = [];
- function d3_geom_voronoiBeach() {
- d3_geom_voronoiRedBlackNode(this);
- this.edge = this.site = this.circle = null;
- }
- function d3_geom_voronoiCreateBeach(site) {
- var beach = d3_geom_voronoiBeachPool.pop() || new d3_geom_voronoiBeach();
- beach.site = site;
- return beach;
- }
- function d3_geom_voronoiDetachBeach(beach) {
- d3_geom_voronoiDetachCircle(beach);
- d3_geom_voronoiBeaches.remove(beach);
- d3_geom_voronoiBeachPool.push(beach);
- d3_geom_voronoiRedBlackNode(beach);
- }
- function d3_geom_voronoiRemoveBeach(beach) {
- var circle = beach.circle, x = circle.x, y = circle.cy, vertex = {
- x: x,
- y: y
- }, previous = beach.P, next = beach.N, disappearing = [ beach ];
- d3_geom_voronoiDetachBeach(beach);
- var lArc = previous;
- while (lArc.circle && abs(x - lArc.circle.x) < ε && abs(y - lArc.circle.cy) < ε) {
- previous = lArc.P;
- disappearing.unshift(lArc);
- d3_geom_voronoiDetachBeach(lArc);
- lArc = previous;
- }
- disappearing.unshift(lArc);
- d3_geom_voronoiDetachCircle(lArc);
- var rArc = next;
- while (rArc.circle && abs(x - rArc.circle.x) < ε && abs(y - rArc.circle.cy) < ε) {
- next = rArc.N;
- disappearing.push(rArc);
- d3_geom_voronoiDetachBeach(rArc);
- rArc = next;
- }
- disappearing.push(rArc);
- d3_geom_voronoiDetachCircle(rArc);
- var nArcs = disappearing.length, iArc;
- for (iArc = 1; iArc < nArcs; ++iArc) {
- rArc = disappearing[iArc];
- lArc = disappearing[iArc - 1];
- d3_geom_voronoiSetEdgeEnd(rArc.edge, lArc.site, rArc.site, vertex);
- }
- lArc = disappearing[0];
- rArc = disappearing[nArcs - 1];
- rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, rArc.site, null, vertex);
- d3_geom_voronoiAttachCircle(lArc);
- d3_geom_voronoiAttachCircle(rArc);
- }
- function d3_geom_voronoiAddBeach(site) {
- var x = site.x, directrix = site.y, lArc, rArc, dxl, dxr, node = d3_geom_voronoiBeaches._;
- while (node) {
- dxl = d3_geom_voronoiLeftBreakPoint(node, directrix) - x;
- if (dxl > ε) node = node.L; else {
- dxr = x - d3_geom_voronoiRightBreakPoint(node, directrix);
- if (dxr > ε) {
- if (!node.R) {
- lArc = node;
- break;
- }
- node = node.R;
- } else {
- if (dxl > -ε) {
- lArc = node.P;
- rArc = node;
- } else if (dxr > -ε) {
- lArc = node;
- rArc = node.N;
- } else {
- lArc = rArc = node;
- }
- break;
- }
- }
- }
- var newArc = d3_geom_voronoiCreateBeach(site);
- d3_geom_voronoiBeaches.insert(lArc, newArc);
- if (!lArc && !rArc) return;
- if (lArc === rArc) {
- d3_geom_voronoiDetachCircle(lArc);
- rArc = d3_geom_voronoiCreateBeach(lArc.site);
- d3_geom_voronoiBeaches.insert(newArc, rArc);
- newArc.edge = rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site);
- d3_geom_voronoiAttachCircle(lArc);
- d3_geom_voronoiAttachCircle(rArc);
- return;
- }
- if (!rArc) {
- newArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site);
- return;
- }
- d3_geom_voronoiDetachCircle(lArc);
- d3_geom_voronoiDetachCircle(rArc);
- var lSite = lArc.site, ax = lSite.x, ay = lSite.y, bx = site.x - ax, by = site.y - ay, rSite = rArc.site, cx = rSite.x - ax, cy = rSite.y - ay, d = 2 * (bx * cy - by * cx), hb = bx * bx + by * by, hc = cx * cx + cy * cy, vertex = {
- x: (cy * hb - by * hc) / d + ax,
- y: (bx * hc - cx * hb) / d + ay
- };
- d3_geom_voronoiSetEdgeEnd(rArc.edge, lSite, rSite, vertex);
- newArc.edge = d3_geom_voronoiCreateEdge(lSite, site, null, vertex);
- rArc.edge = d3_geom_voronoiCreateEdge(site, rSite, null, vertex);
- d3_geom_voronoiAttachCircle(lArc);
- d3_geom_voronoiAttachCircle(rArc);
- }
- function d3_geom_voronoiLeftBreakPoint(arc, directrix) {
- var site = arc.site, rfocx = site.x, rfocy = site.y, pby2 = rfocy - directrix;
- if (!pby2) return rfocx;
- var lArc = arc.P;
- if (!lArc) return -Infinity;
- site = lArc.site;
- var lfocx = site.x, lfocy = site.y, plby2 = lfocy - directrix;
- if (!plby2) return lfocx;
- var hl = lfocx - rfocx, aby2 = 1 / pby2 - 1 / plby2, b = hl / plby2;
- if (aby2) return (-b + Math.sqrt(b * b - 2 * aby2 * (hl * hl / (-2 * plby2) - lfocy + plby2 / 2 + rfocy - pby2 / 2))) / aby2 + rfocx;
- return (rfocx + lfocx) / 2;
- }
- function d3_geom_voronoiRightBreakPoint(arc, directrix) {
- var rArc = arc.N;
- if (rArc) return d3_geom_voronoiLeftBreakPoint(rArc, directrix);
- var site = arc.site;
- return site.y === directrix ? site.x : Infinity;
- }
- function d3_geom_voronoiCell(site) {
- this.site = site;
- this.edges = [];
- }
- d3_geom_voronoiCell.prototype.prepare = function() {
- var halfEdges = this.edges, iHalfEdge = halfEdges.length, edge;
- while (iHalfEdge--) {
- edge = halfEdges[iHalfEdge].edge;
- if (!edge.b || !edge.a) halfEdges.splice(iHalfEdge, 1);
- }
- halfEdges.sort(d3_geom_voronoiHalfEdgeOrder);
- return halfEdges.length;
- };
- function d3_geom_voronoiCloseCells(extent) {
- var x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], x2, y2, x3, y3, cells = d3_geom_voronoiCells, iCell = cells.length, cell, iHalfEdge, halfEdges, nHalfEdges, start, end;
- while (iCell--) {
- cell = cells[iCell];
- if (!cell || !cell.prepare()) continue;
- halfEdges = cell.edges;
- nHalfEdges = halfEdges.length;
- iHalfEdge = 0;
- while (iHalfEdge < nHalfEdges) {
- end = halfEdges[iHalfEdge].end(), x3 = end.x, y3 = end.y;
- start = halfEdges[++iHalfEdge % nHalfEdges].start(), x2 = start.x, y2 = start.y;
- if (abs(x3 - x2) > ε || abs(y3 - y2) > ε) {
- halfEdges.splice(iHalfEdge, 0, new d3_geom_voronoiHalfEdge(d3_geom_voronoiCreateBorderEdge(cell.site, end, abs(x3 - x0) < ε && y1 - y3 > ε ? {
- x: x0,
- y: abs(x2 - x0) < ε ? y2 : y1
- } : abs(y3 - y1) < ε && x1 - x3 > ε ? {
- x: abs(y2 - y1) < ε ? x2 : x1,
- y: y1
- } : abs(x3 - x1) < ε && y3 - y0 > ε ? {
- x: x1,
- y: abs(x2 - x1) < ε ? y2 : y0
- } : abs(y3 - y0) < ε && x3 - x0 > ε ? {
- x: abs(y2 - y0) < ε ? x2 : x0,
- y: y0
- } : null), cell.site, null));
- ++nHalfEdges;
- }
+}
+
+function styleFunction$1(name, interpolate$$1, value) {
+ var string00,
+ string10,
+ interpolate0;
+ return function() {
+ var string0 = styleValue(this, name),
+ value1 = value(this),
+ string1 = value1 + "";
+ if (value1 == null) string1 = value1 = (this.style.removeProperty(name), styleValue(this, name));
+ return string0 === string1 ? null
+ : string0 === string00 && string1 === string10 ? interpolate0
+ : (string10 = string1, interpolate0 = interpolate$$1(string00 = string0, value1));
+ };
+}
+
+function styleMaybeRemove(id, name) {
+ var on0, on1, listener0, key = "style." + name, event = "end." + key, remove;
+ return function() {
+ var schedule$$1 = set$1(this, id),
+ on = schedule$$1.on,
+ listener = schedule$$1.value[key] == null ? remove || (remove = styleRemove$1(name)) : undefined;
+
+ // If this node shared a dispatch with the previous node,
+ // just assign the updated shared dispatch and we’re done!
+ // Otherwise, copy-on-write.
+ if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);
+
+ schedule$$1.on = on1;
+ };
+}
+
+function transition_style(name, value, priority) {
+ var i = (name += "") === "transform" ? interpolateTransformCss : interpolate;
+ return value == null ? this
+ .styleTween(name, styleNull(name, i))
+ .on("end.style." + name, styleRemove$1(name))
+ : typeof value === "function" ? this
+ .styleTween(name, styleFunction$1(name, i, tweenValue(this, "style." + name, value)))
+ .each(styleMaybeRemove(this._id, name))
+ : this
+ .styleTween(name, styleConstant$1(name, i, value), priority)
+ .on("end.style." + name, null);
+}
+
+function styleInterpolate(name, i, priority) {
+ return function(t) {
+ this.style.setProperty(name, i(t), priority);
+ };
+}
+
+function styleTween(name, value, priority) {
+ var t, i0;
+ function tween() {
+ var i = value.apply(this, arguments);
+ if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority);
+ return t;
+ }
+ tween._value = value;
+ return tween;
+}
+
+function transition_styleTween(name, value, priority) {
+ var key = "style." + (name += "");
+ if (arguments.length < 2) return (key = this.tween(key)) && key._value;
+ if (value == null) return this.tween(key, null);
+ if (typeof value !== "function") throw new Error;
+ return this.tween(key, styleTween(name, value, priority == null ? "" : priority));
+}
+
+function textConstant$1(value) {
+ return function() {
+ this.textContent = value;
+ };
+}
+
+function textFunction$1(value) {
+ return function() {
+ var value1 = value(this);
+ this.textContent = value1 == null ? "" : value1;
+ };
+}
+
+function transition_text(value) {
+ return this.tween("text", typeof value === "function"
+ ? textFunction$1(tweenValue(this, "text", value))
+ : textConstant$1(value == null ? "" : value + ""));
+}
+
+function transition_transition() {
+ var name = this._name,
+ id0 = this._id,
+ id1 = newId();
+
+ for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {
+ for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
+ if (node = group[i]) {
+ var inherit = get$1(node, id0);
+ schedule(node, name, id1, i, group, {
+ time: inherit.time + inherit.delay + inherit.duration,
+ delay: 0,
+ duration: inherit.duration,
+ ease: inherit.ease
+ });
}
}
}
- function d3_geom_voronoiHalfEdgeOrder(a, b) {
- return b.angle - a.angle;
- }
- function d3_geom_voronoiCircle() {
- d3_geom_voronoiRedBlackNode(this);
- this.x = this.y = this.arc = this.site = this.cy = null;
- }
- function d3_geom_voronoiAttachCircle(arc) {
- var lArc = arc.P, rArc = arc.N;
- if (!lArc || !rArc) return;
- var lSite = lArc.site, cSite = arc.site, rSite = rArc.site;
- if (lSite === rSite) return;
- var bx = cSite.x, by = cSite.y, ax = lSite.x - bx, ay = lSite.y - by, cx = rSite.x - bx, cy = rSite.y - by;
- var d = 2 * (ax * cy - ay * cx);
- if (d >= -ε2) return;
- var ha = ax * ax + ay * ay, hc = cx * cx + cy * cy, x = (cy * ha - ay * hc) / d, y = (ax * hc - cx * ha) / d, cy = y + by;
- var circle = d3_geom_voronoiCirclePool.pop() || new d3_geom_voronoiCircle();
- circle.arc = arc;
- circle.site = cSite;
- circle.x = x + bx;
- circle.y = cy + Math.sqrt(x * x + y * y);
- circle.cy = cy;
- arc.circle = circle;
- var before = null, node = d3_geom_voronoiCircles._;
- while (node) {
- if (circle.y < node.y || circle.y === node.y && circle.x <= node.x) {
- if (node.L) node = node.L; else {
- before = node.P;
- break;
- }
- } else {
- if (node.R) node = node.R; else {
- before = node;
- break;
- }
+
+ return new Transition(groups, this._parents, name, id1);
+}
+
+function transition_end() {
+ var on0, on1, that = this, id = that._id, size = that.size();
+ return new Promise(function(resolve, reject) {
+ var cancel = {value: reject},
+ end = {value: function() { if (--size === 0) resolve(); }};
+
+ that.each(function() {
+ var schedule$$1 = set$1(this, id),
+ on = schedule$$1.on;
+
+ // If this node shared a dispatch with the previous node,
+ // just assign the updated shared dispatch and we’re done!
+ // Otherwise, copy-on-write.
+ if (on !== on0) {
+ on1 = (on0 = on).copy();
+ on1._.cancel.push(cancel);
+ on1._.interrupt.push(cancel);
+ on1._.end.push(end);
}
- }
- d3_geom_voronoiCircles.insert(before, circle);
- if (!before) d3_geom_voronoiFirstCircle = circle;
+
+ schedule$$1.on = on1;
+ });
+ });
+}
+
+var id = 0;
+
+function Transition(groups, parents, name, id) {
+ this._groups = groups;
+ this._parents = parents;
+ this._name = name;
+ this._id = id;
+}
+
+function transition(name) {
+ return selection().transition(name);
+}
+
+function newId() {
+ return ++id;
+}
+
+var selection_prototype = selection.prototype;
+
+Transition.prototype = transition.prototype = {
+ constructor: Transition,
+ select: transition_select,
+ selectAll: transition_selectAll,
+ filter: transition_filter,
+ merge: transition_merge,
+ selection: transition_selection,
+ transition: transition_transition,
+ call: selection_prototype.call,
+ nodes: selection_prototype.nodes,
+ node: selection_prototype.node,
+ size: selection_prototype.size,
+ empty: selection_prototype.empty,
+ each: selection_prototype.each,
+ on: transition_on,
+ attr: transition_attr,
+ attrTween: transition_attrTween,
+ style: transition_style,
+ styleTween: transition_styleTween,
+ text: transition_text,
+ remove: transition_remove,
+ tween: transition_tween,
+ delay: transition_delay,
+ duration: transition_duration,
+ ease: transition_ease,
+ end: transition_end
+};
+
+function linear$1(t) {
+ return +t;
+}
+
+function quadIn(t) {
+ return t * t;
+}
+
+function quadOut(t) {
+ return t * (2 - t);
+}
+
+function quadInOut(t) {
+ return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2;
+}
+
+function cubicIn(t) {
+ return t * t * t;
+}
+
+function cubicOut(t) {
+ return --t * t * t + 1;
+}
+
+function cubicInOut(t) {
+ return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
+}
+
+var exponent = 3;
+
+var polyIn = (function custom(e) {
+ e = +e;
+
+ function polyIn(t) {
+ return Math.pow(t, e);
}
- function d3_geom_voronoiDetachCircle(arc) {
- var circle = arc.circle;
- if (circle) {
- if (!circle.P) d3_geom_voronoiFirstCircle = circle.N;
- d3_geom_voronoiCircles.remove(circle);
- d3_geom_voronoiCirclePool.push(circle);
- d3_geom_voronoiRedBlackNode(circle);
- arc.circle = null;
- }
+
+ polyIn.exponent = custom;
+
+ return polyIn;
+})(exponent);
+
+var polyOut = (function custom(e) {
+ e = +e;
+
+ function polyOut(t) {
+ return 1 - Math.pow(1 - t, e);
}
- function d3_geom_voronoiClipEdges(extent) {
- var edges = d3_geom_voronoiEdges, clip = d3_geom_clipLine(extent[0][0], extent[0][1], extent[1][0], extent[1][1]), i = edges.length, e;
- while (i--) {
- e = edges[i];
- if (!d3_geom_voronoiConnectEdge(e, extent) || !clip(e) || abs(e.a.x - e.b.x) < ε && abs(e.a.y - e.b.y) < ε) {
- e.a = e.b = null;
- edges.splice(i, 1);
- }
- }
+
+ polyOut.exponent = custom;
+
+ return polyOut;
+})(exponent);
+
+var polyInOut = (function custom(e) {
+ e = +e;
+
+ function polyInOut(t) {
+ return ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2;
}
- function d3_geom_voronoiConnectEdge(edge, extent) {
- var vb = edge.b;
- if (vb) return true;
- var va = edge.a, x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], lSite = edge.l, rSite = edge.r, lx = lSite.x, ly = lSite.y, rx = rSite.x, ry = rSite.y, fx = (lx + rx) / 2, fy = (ly + ry) / 2, fm, fb;
- if (ry === ly) {
- if (fx < x0 || fx >= x1) return;
- if (lx > rx) {
- if (!va) va = {
- x: fx,
- y: y0
- }; else if (va.y >= y1) return;
- vb = {
- x: fx,
- y: y1
- };
- } else {
- if (!va) va = {
- x: fx,
- y: y1
- }; else if (va.y < y0) return;
- vb = {
- x: fx,
- y: y0
- };
- }
- } else {
- fm = (lx - rx) / (ry - ly);
- fb = fy - fm * fx;
- if (fm < -1 || fm > 1) {
- if (lx > rx) {
- if (!va) va = {
- x: (y0 - fb) / fm,
- y: y0
- }; else if (va.y >= y1) return;
- vb = {
- x: (y1 - fb) / fm,
- y: y1
- };
- } else {
- if (!va) va = {
- x: (y1 - fb) / fm,
- y: y1
- }; else if (va.y < y0) return;
- vb = {
- x: (y0 - fb) / fm,
- y: y0
- };
- }
- } else {
- if (ly < ry) {
- if (!va) va = {
- x: x0,
- y: fm * x0 + fb
- }; else if (va.x >= x1) return;
- vb = {
- x: x1,
- y: fm * x1 + fb
- };
- } else {
- if (!va) va = {
- x: x1,
- y: fm * x1 + fb
- }; else if (va.x < x0) return;
- vb = {
- x: x0,
- y: fm * x0 + fb
- };
- }
+
+ polyInOut.exponent = custom;
+
+ return polyInOut;
+})(exponent);
+
+var pi = Math.PI,
+ halfPi = pi / 2;
+
+function sinIn(t) {
+ return 1 - Math.cos(t * halfPi);
+}
+
+function sinOut(t) {
+ return Math.sin(t * halfPi);
+}
+
+function sinInOut(t) {
+ return (1 - Math.cos(pi * t)) / 2;
+}
+
+function expIn(t) {
+ return Math.pow(2, 10 * t - 10);
+}
+
+function expOut(t) {
+ return 1 - Math.pow(2, -10 * t);
+}
+
+function expInOut(t) {
+ return ((t *= 2) <= 1 ? Math.pow(2, 10 * t - 10) : 2 - Math.pow(2, 10 - 10 * t)) / 2;
+}
+
+function circleIn(t) {
+ return 1 - Math.sqrt(1 - t * t);
+}
+
+function circleOut(t) {
+ return Math.sqrt(1 - --t * t);
+}
+
+function circleInOut(t) {
+ return ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2;
+}
+
+var b1 = 4 / 11,
+ b2 = 6 / 11,
+ b3 = 8 / 11,
+ b4 = 3 / 4,
+ b5 = 9 / 11,
+ b6 = 10 / 11,
+ b7 = 15 / 16,
+ b8 = 21 / 22,
+ b9 = 63 / 64,
+ b0 = 1 / b1 / b1;
+
+function bounceIn(t) {
+ return 1 - bounceOut(1 - t);
+}
+
+function bounceOut(t) {
+ return (t = +t) < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;
+}
+
+function bounceInOut(t) {
+ return ((t *= 2) <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2;
+}
+
+var overshoot = 1.70158;
+
+var backIn = (function custom(s) {
+ s = +s;
+
+ function backIn(t) {
+ return t * t * ((s + 1) * t - s);
+ }
+
+ backIn.overshoot = custom;
+
+ return backIn;
+})(overshoot);
+
+var backOut = (function custom(s) {
+ s = +s;
+
+ function backOut(t) {
+ return --t * t * ((s + 1) * t + s) + 1;
+ }
+
+ backOut.overshoot = custom;
+
+ return backOut;
+})(overshoot);
+
+var backInOut = (function custom(s) {
+ s = +s;
+
+ function backInOut(t) {
+ return ((t *= 2) < 1 ? t * t * ((s + 1) * t - s) : (t -= 2) * t * ((s + 1) * t + s) + 2) / 2;
+ }
+
+ backInOut.overshoot = custom;
+
+ return backInOut;
+})(overshoot);
+
+var tau = 2 * Math.PI,
+ amplitude = 1,
+ period = 0.3;
+
+var elasticIn = (function custom(a, p) {
+ var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
+
+ function elasticIn(t) {
+ return a * Math.pow(2, 10 * --t) * Math.sin((s - t) / p);
+ }
+
+ elasticIn.amplitude = function(a) { return custom(a, p * tau); };
+ elasticIn.period = function(p) { return custom(a, p); };
+
+ return elasticIn;
+})(amplitude, period);
+
+var elasticOut = (function custom(a, p) {
+ var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
+
+ function elasticOut(t) {
+ return 1 - a * Math.pow(2, -10 * (t = +t)) * Math.sin((t + s) / p);
+ }
+
+ elasticOut.amplitude = function(a) { return custom(a, p * tau); };
+ elasticOut.period = function(p) { return custom(a, p); };
+
+ return elasticOut;
+})(amplitude, period);
+
+var elasticInOut = (function custom(a, p) {
+ var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
+
+ function elasticInOut(t) {
+ return ((t = t * 2 - 1) < 0
+ ? a * Math.pow(2, 10 * t) * Math.sin((s - t) / p)
+ : 2 - a * Math.pow(2, -10 * t) * Math.sin((s + t) / p)) / 2;
+ }
+
+ elasticInOut.amplitude = function(a) { return custom(a, p * tau); };
+ elasticInOut.period = function(p) { return custom(a, p); };
+
+ return elasticInOut;
+})(amplitude, period);
+
+var defaultTiming = {
+ time: null, // Set on use.
+ delay: 0,
+ duration: 250,
+ ease: cubicInOut
+};
+
+function inherit(node, id) {
+ var timing;
+ while (!(timing = node.__transition) || !(timing = timing[id])) {
+ if (!(node = node.parentNode)) {
+ return defaultTiming.time = now(), defaultTiming;
+ }
+ }
+ return timing;
+}
+
+function selection_transition(name) {
+ var id,
+ timing;
+
+ if (name instanceof Transition) {
+ id = name._id, name = name._name;
+ } else {
+ id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + "";
+ }
+
+ for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {
+ for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {
+ if (node = group[i]) {
+ schedule(node, name, id, i, group, timing || inherit(node, id));
}
}
- edge.a = va;
- edge.b = vb;
- return true;
}
- function d3_geom_voronoiEdge(lSite, rSite) {
- this.l = lSite;
- this.r = rSite;
- this.a = this.b = null;
- }
- function d3_geom_voronoiCreateEdge(lSite, rSite, va, vb) {
- var edge = new d3_geom_voronoiEdge(lSite, rSite);
- d3_geom_voronoiEdges.push(edge);
- if (va) d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, va);
- if (vb) d3_geom_voronoiSetEdgeEnd(edge, rSite, lSite, vb);
- d3_geom_voronoiCells[lSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, lSite, rSite));
- d3_geom_voronoiCells[rSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, rSite, lSite));
- return edge;
- }
- function d3_geom_voronoiCreateBorderEdge(lSite, va, vb) {
- var edge = new d3_geom_voronoiEdge(lSite, null);
- edge.a = va;
- edge.b = vb;
- d3_geom_voronoiEdges.push(edge);
- return edge;
- }
- function d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, vertex) {
- if (!edge.a && !edge.b) {
- edge.a = vertex;
- edge.l = lSite;
- edge.r = rSite;
- } else if (edge.l === rSite) {
- edge.b = vertex;
+
+ return new Transition(groups, this._parents, name, id);
+}
+
+selection.prototype.interrupt = selection_interrupt;
+selection.prototype.transition = selection_transition;
+
+var root$1 = [null];
+
+function active(node, name) {
+ var schedules = node.__transition,
+ schedule$$1,
+ i;
+
+ if (schedules) {
+ name = name == null ? null : name + "";
+ for (i in schedules) {
+ if ((schedule$$1 = schedules[i]).state > SCHEDULED && schedule$$1.name === name) {
+ return new Transition([[node]], root$1, name, +i);
+ }
+ }
+ }
+
+ return null;
+}
+
+function constant$4(x) {
+ return function() {
+ return x;
+ };
+}
+
+function BrushEvent(target, type, selection) {
+ this.target = target;
+ this.type = type;
+ this.selection = selection;
+}
+
+function nopropagation$1() {
+ exports.event.stopImmediatePropagation();
+}
+
+function noevent$1() {
+ exports.event.preventDefault();
+ exports.event.stopImmediatePropagation();
+}
+
+var MODE_DRAG = {name: "drag"},
+ MODE_SPACE = {name: "space"},
+ MODE_HANDLE = {name: "handle"},
+ MODE_CENTER = {name: "center"};
+
+var X = {
+ name: "x",
+ handles: ["e", "w"].map(type),
+ input: function(x, e) { return x && [[x[0], e[0][1]], [x[1], e[1][1]]]; },
+ output: function(xy) { return xy && [xy[0][0], xy[1][0]]; }
+};
+
+var Y = {
+ name: "y",
+ handles: ["n", "s"].map(type),
+ input: function(y, e) { return y && [[e[0][0], y[0]], [e[1][0], y[1]]]; },
+ output: function(xy) { return xy && [xy[0][1], xy[1][1]]; }
+};
+
+var XY = {
+ name: "xy",
+ handles: ["n", "e", "s", "w", "nw", "ne", "se", "sw"].map(type),
+ input: function(xy) { return xy; },
+ output: function(xy) { return xy; }
+};
+
+var cursors = {
+ overlay: "crosshair",
+ selection: "move",
+ n: "ns-resize",
+ e: "ew-resize",
+ s: "ns-resize",
+ w: "ew-resize",
+ nw: "nwse-resize",
+ ne: "nesw-resize",
+ se: "nwse-resize",
+ sw: "nesw-resize"
+};
+
+var flipX = {
+ e: "w",
+ w: "e",
+ nw: "ne",
+ ne: "nw",
+ se: "sw",
+ sw: "se"
+};
+
+var flipY = {
+ n: "s",
+ s: "n",
+ nw: "sw",
+ ne: "se",
+ se: "ne",
+ sw: "nw"
+};
+
+var signsX = {
+ overlay: +1,
+ selection: +1,
+ n: null,
+ e: +1,
+ s: null,
+ w: -1,
+ nw: -1,
+ ne: +1,
+ se: +1,
+ sw: -1
+};
+
+var signsY = {
+ overlay: +1,
+ selection: +1,
+ n: -1,
+ e: null,
+ s: +1,
+ w: null,
+ nw: -1,
+ ne: -1,
+ se: +1,
+ sw: +1
+};
+
+function type(t) {
+ return {type: t};
+}
+
+// Ignore right-click, since that should open the context menu.
+function defaultFilter$1() {
+ return !exports.event.button;
+}
+
+function defaultExtent() {
+ var svg = this.ownerSVGElement || this;
+ return [[0, 0], [svg.width.baseVal.value, svg.height.baseVal.value]];
+}
+
+// Like d3.local, but with the name “__brush†rather than auto-generated.
+function local$1(node) {
+ while (!node.__brush) if (!(node = node.parentNode)) return;
+ return node.__brush;
+}
+
+function empty$1(extent) {
+ return extent[0][0] === extent[1][0]
+ || extent[0][1] === extent[1][1];
+}
+
+function brushSelection(node) {
+ var state = node.__brush;
+ return state ? state.dim.output(state.selection) : null;
+}
+
+function brushX() {
+ return brush$1(X);
+}
+
+function brushY() {
+ return brush$1(Y);
+}
+
+function brush() {
+ return brush$1(XY);
+}
+
+function brush$1(dim) {
+ var extent = defaultExtent,
+ filter = defaultFilter$1,
+ listeners = dispatch(brush, "start", "brush", "end"),
+ handleSize = 6,
+ touchending;
+
+ function brush(group) {
+ var overlay = group
+ .property("__brush", initialize)
+ .selectAll(".overlay")
+ .data([type("overlay")]);
+
+ overlay.enter().append("rect")
+ .attr("class", "overlay")
+ .attr("pointer-events", "all")
+ .attr("cursor", cursors.overlay)
+ .merge(overlay)
+ .each(function() {
+ var extent = local$1(this).extent;
+ select(this)
+ .attr("x", extent[0][0])
+ .attr("y", extent[0][1])
+ .attr("width", extent[1][0] - extent[0][0])
+ .attr("height", extent[1][1] - extent[0][1]);
+ });
+
+ group.selectAll(".selection")
+ .data([type("selection")])
+ .enter().append("rect")
+ .attr("class", "selection")
+ .attr("cursor", cursors.selection)
+ .attr("fill", "#777")
+ .attr("fill-opacity", 0.3)
+ .attr("stroke", "#fff")
+ .attr("shape-rendering", "crispEdges");
+
+ var handle = group.selectAll(".handle")
+ .data(dim.handles, function(d) { return d.type; });
+
+ handle.exit().remove();
+
+ handle.enter().append("rect")
+ .attr("class", function(d) { return "handle handle--" + d.type; })
+ .attr("cursor", function(d) { return cursors[d.type]; });
+
+ group
+ .each(redraw)
+ .attr("fill", "none")
+ .attr("pointer-events", "all")
+ .style("-webkit-tap-highlight-color", "rgba(0,0,0,0)")
+ .on("mousedown.brush touchstart.brush", started);
+ }
+
+ brush.move = function(group, selection$$1) {
+ if (group.selection) {
+ group
+ .on("start.brush", function() { emitter(this, arguments).beforestart().start(); })
+ .on("interrupt.brush end.brush", function() { emitter(this, arguments).end(); })
+ .tween("brush", function() {
+ var that = this,
+ state = that.__brush,
+ emit = emitter(that, arguments),
+ selection0 = state.selection,
+ selection1 = dim.input(typeof selection$$1 === "function" ? selection$$1.apply(this, arguments) : selection$$1, state.extent),
+ i = interpolateValue(selection0, selection1);
+
+ function tween(t) {
+ state.selection = t === 1 && empty$1(selection1) ? null : i(t);
+ redraw.call(that);
+ emit.brush();
+ }
+
+ return selection0 && selection1 ? tween : tween(1);
+ });
} else {
- edge.a = vertex;
+ group
+ .each(function() {
+ var that = this,
+ args = arguments,
+ state = that.__brush,
+ selection1 = dim.input(typeof selection$$1 === "function" ? selection$$1.apply(that, args) : selection$$1, state.extent),
+ emit = emitter(that, args).beforestart();
+
+ interrupt(that);
+ state.selection = selection1 == null || empty$1(selection1) ? null : selection1;
+ redraw.call(that);
+ emit.start().brush().end();
+ });
+ }
+ };
+
+ function redraw() {
+ var group = select(this),
+ selection$$1 = local$1(this).selection;
+
+ if (selection$$1) {
+ group.selectAll(".selection")
+ .style("display", null)
+ .attr("x", selection$$1[0][0])
+ .attr("y", selection$$1[0][1])
+ .attr("width", selection$$1[1][0] - selection$$1[0][0])
+ .attr("height", selection$$1[1][1] - selection$$1[0][1]);
+
+ group.selectAll(".handle")
+ .style("display", null)
+ .attr("x", function(d) { return d.type[d.type.length - 1] === "e" ? selection$$1[1][0] - handleSize / 2 : selection$$1[0][0] - handleSize / 2; })
+ .attr("y", function(d) { return d.type[0] === "s" ? selection$$1[1][1] - handleSize / 2 : selection$$1[0][1] - handleSize / 2; })
+ .attr("width", function(d) { return d.type === "n" || d.type === "s" ? selection$$1[1][0] - selection$$1[0][0] + handleSize : handleSize; })
+ .attr("height", function(d) { return d.type === "e" || d.type === "w" ? selection$$1[1][1] - selection$$1[0][1] + handleSize : handleSize; });
+ }
+
+ else {
+ group.selectAll(".selection,.handle")
+ .style("display", "none")
+ .attr("x", null)
+ .attr("y", null)
+ .attr("width", null)
+ .attr("height", null);
}
}
- function d3_geom_voronoiHalfEdge(edge, lSite, rSite) {
- var va = edge.a, vb = edge.b;
- this.edge = edge;
- this.site = lSite;
- this.angle = rSite ? Math.atan2(rSite.y - lSite.y, rSite.x - lSite.x) : edge.l === lSite ? Math.atan2(vb.x - va.x, va.y - vb.y) : Math.atan2(va.x - vb.x, vb.y - va.y);
+
+ function emitter(that, args) {
+ return that.__brush.emitter || new Emitter(that, args);
+ }
+
+ function Emitter(that, args) {
+ this.that = that;
+ this.args = args;
+ this.state = that.__brush;
+ this.active = 0;
}
- d3_geom_voronoiHalfEdge.prototype = {
+
+ Emitter.prototype = {
+ beforestart: function() {
+ if (++this.active === 1) this.state.emitter = this, this.starting = true;
+ return this;
+ },
start: function() {
- return this.edge.l === this.site ? this.edge.a : this.edge.b;
+ if (this.starting) this.starting = false, this.emit("start");
+ return this;
+ },
+ brush: function() {
+ this.emit("brush");
+ return this;
},
end: function() {
- return this.edge.l === this.site ? this.edge.b : this.edge.a;
- }
- };
- function d3_geom_voronoiRedBlackTree() {
- this._ = null;
- }
- function d3_geom_voronoiRedBlackNode(node) {
- node.U = node.C = node.L = node.R = node.P = node.N = null;
- }
- d3_geom_voronoiRedBlackTree.prototype = {
- insert: function(after, node) {
- var parent, grandpa, uncle;
- if (after) {
- node.P = after;
- node.N = after.N;
- if (after.N) after.N.P = node;
- after.N = node;
- if (after.R) {
- after = after.R;
- while (after.L) after = after.L;
- after.L = node;
- } else {
- after.R = node;
+ if (--this.active === 0) delete this.state.emitter, this.emit("end");
+ return this;
+ },
+ emit: function(type) {
+ customEvent(new BrushEvent(brush, type, dim.output(this.state.selection)), listeners.apply, listeners, [type, this.that, this.args]);
+ }
+ };
+
+ function started() {
+ if (exports.event.touches) { if (exports.event.changedTouches.length < exports.event.touches.length) return noevent$1(); }
+ else if (touchending) return;
+ if (!filter.apply(this, arguments)) return;
+
+ var that = this,
+ type = exports.event.target.__data__.type,
+ mode = (exports.event.metaKey ? type = "overlay" : type) === "selection" ? MODE_DRAG : (exports.event.altKey ? MODE_CENTER : MODE_HANDLE),
+ signX = dim === Y ? null : signsX[type],
+ signY = dim === X ? null : signsY[type],
+ state = local$1(that),
+ extent = state.extent,
+ selection$$1 = state.selection,
+ W = extent[0][0], w0, w1,
+ N = extent[0][1], n0, n1,
+ E = extent[1][0], e0, e1,
+ S = extent[1][1], s0, s1,
+ dx,
+ dy,
+ moving,
+ shifting = signX && signY && exports.event.shiftKey,
+ lockX,
+ lockY,
+ point0 = mouse(that),
+ point$$1 = point0,
+ emit = emitter(that, arguments).beforestart();
+
+ if (type === "overlay") {
+ state.selection = selection$$1 = [
+ [w0 = dim === Y ? W : point0[0], n0 = dim === X ? N : point0[1]],
+ [e0 = dim === Y ? E : w0, s0 = dim === X ? S : n0]
+ ];
+ } else {
+ w0 = selection$$1[0][0];
+ n0 = selection$$1[0][1];
+ e0 = selection$$1[1][0];
+ s0 = selection$$1[1][1];
+ }
+
+ w1 = w0;
+ n1 = n0;
+ e1 = e0;
+ s1 = s0;
+
+ var group = select(that)
+ .attr("pointer-events", "none");
+
+ var overlay = group.selectAll(".overlay")
+ .attr("cursor", cursors[type]);
+
+ if (exports.event.touches) {
+ group
+ .on("touchmove.brush", moved, true)
+ .on("touchend.brush touchcancel.brush", ended, true);
+ } else {
+ var view = select(exports.event.view)
+ .on("keydown.brush", keydowned, true)
+ .on("keyup.brush", keyupped, true)
+ .on("mousemove.brush", moved, true)
+ .on("mouseup.brush", ended, true);
+
+ dragDisable(exports.event.view);
+ }
+
+ nopropagation$1();
+ interrupt(that);
+ redraw.call(that);
+ emit.start();
+
+ function moved() {
+ var point1 = mouse(that);
+ if (shifting && !lockX && !lockY) {
+ if (Math.abs(point1[0] - point$$1[0]) > Math.abs(point1[1] - point$$1[1])) lockY = true;
+ else lockX = true;
+ }
+ point$$1 = point1;
+ moving = true;
+ noevent$1();
+ move();
+ }
+
+ function move() {
+ var t;
+
+ dx = point$$1[0] - point0[0];
+ dy = point$$1[1] - point0[1];
+
+ switch (mode) {
+ case MODE_SPACE:
+ case MODE_DRAG: {
+ if (signX) dx = Math.max(W - w0, Math.min(E - e0, dx)), w1 = w0 + dx, e1 = e0 + dx;
+ if (signY) dy = Math.max(N - n0, Math.min(S - s0, dy)), n1 = n0 + dy, s1 = s0 + dy;
+ break;
}
- parent = after;
- } else if (this._) {
- after = d3_geom_voronoiRedBlackFirst(this._);
- node.P = null;
- node.N = after;
- after.P = after.L = node;
- parent = after;
- } else {
- node.P = node.N = null;
- this._ = node;
- parent = null;
- }
- node.L = node.R = null;
- node.U = parent;
- node.C = true;
- after = node;
- while (parent && parent.C) {
- grandpa = parent.U;
- if (parent === grandpa.L) {
- uncle = grandpa.R;
- if (uncle && uncle.C) {
- parent.C = uncle.C = false;
- grandpa.C = true;
- after = grandpa;
- } else {
- if (after === parent.R) {
- d3_geom_voronoiRedBlackRotateLeft(this, parent);
- after = parent;
- parent = after.U;
- }
- parent.C = false;
- grandpa.C = true;
- d3_geom_voronoiRedBlackRotateRight(this, grandpa);
- }
- } else {
- uncle = grandpa.L;
- if (uncle && uncle.C) {
- parent.C = uncle.C = false;
- grandpa.C = true;
- after = grandpa;
- } else {
- if (after === parent.L) {
- d3_geom_voronoiRedBlackRotateRight(this, parent);
- after = parent;
- parent = after.U;
- }
- parent.C = false;
- grandpa.C = true;
- d3_geom_voronoiRedBlackRotateLeft(this, grandpa);
- }
+ case MODE_HANDLE: {
+ if (signX < 0) dx = Math.max(W - w0, Math.min(E - w0, dx)), w1 = w0 + dx, e1 = e0;
+ else if (signX > 0) dx = Math.max(W - e0, Math.min(E - e0, dx)), w1 = w0, e1 = e0 + dx;
+ if (signY < 0) dy = Math.max(N - n0, Math.min(S - n0, dy)), n1 = n0 + dy, s1 = s0;
+ else if (signY > 0) dy = Math.max(N - s0, Math.min(S - s0, dy)), n1 = n0, s1 = s0 + dy;
+ break;
}
- parent = after.U;
- }
- this._.C = false;
- },
- remove: function(node) {
- if (node.N) node.N.P = node.P;
- if (node.P) node.P.N = node.N;
- node.N = node.P = null;
- var parent = node.U, sibling, left = node.L, right = node.R, next, red;
- if (!left) next = right; else if (!right) next = left; else next = d3_geom_voronoiRedBlackFirst(right);
- if (parent) {
- if (parent.L === node) parent.L = next; else parent.R = next;
- } else {
- this._ = next;
- }
- if (left && right) {
- red = next.C;
- next.C = node.C;
- next.L = left;
- left.U = next;
- if (next !== right) {
- parent = next.U;
- next.U = node.U;
- node = next.R;
- parent.L = node;
- next.R = right;
- right.U = next;
- } else {
- next.U = parent;
- parent = next;
- node = next.R;
+ case MODE_CENTER: {
+ if (signX) w1 = Math.max(W, Math.min(E, w0 - dx * signX)), e1 = Math.max(W, Math.min(E, e0 + dx * signX));
+ if (signY) n1 = Math.max(N, Math.min(S, n0 - dy * signY)), s1 = Math.max(N, Math.min(S, s0 + dy * signY));
+ break;
}
- } else {
- red = node.C;
- node = next;
}
- if (node) node.U = parent;
- if (red) return;
- if (node && node.C) {
- node.C = false;
- return;
+
+ if (e1 < w1) {
+ signX *= -1;
+ t = w0, w0 = e0, e0 = t;
+ t = w1, w1 = e1, e1 = t;
+ if (type in flipX) overlay.attr("cursor", cursors[type = flipX[type]]);
}
- do {
- if (node === this._) break;
- if (node === parent.L) {
- sibling = parent.R;
- if (sibling.C) {
- sibling.C = false;
- parent.C = true;
- d3_geom_voronoiRedBlackRotateLeft(this, parent);
- sibling = parent.R;
+
+ if (s1 < n1) {
+ signY *= -1;
+ t = n0, n0 = s0, s0 = t;
+ t = n1, n1 = s1, s1 = t;
+ if (type in flipY) overlay.attr("cursor", cursors[type = flipY[type]]);
+ }
+
+ if (state.selection) selection$$1 = state.selection; // May be set by brush.move!
+ if (lockX) w1 = selection$$1[0][0], e1 = selection$$1[1][0];
+ if (lockY) n1 = selection$$1[0][1], s1 = selection$$1[1][1];
+
+ if (selection$$1[0][0] !== w1
+ || selection$$1[0][1] !== n1
+ || selection$$1[1][0] !== e1
+ || selection$$1[1][1] !== s1) {
+ state.selection = [[w1, n1], [e1, s1]];
+ redraw.call(that);
+ emit.brush();
+ }
+ }
+
+ function ended() {
+ nopropagation$1();
+ if (exports.event.touches) {
+ if (exports.event.touches.length) return;
+ if (touchending) clearTimeout(touchending);
+ touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed!
+ group.on("touchmove.brush touchend.brush touchcancel.brush", null);
+ } else {
+ yesdrag(exports.event.view, moving);
+ view.on("keydown.brush keyup.brush mousemove.brush mouseup.brush", null);
+ }
+ group.attr("pointer-events", "all");
+ overlay.attr("cursor", cursors.overlay);
+ if (state.selection) selection$$1 = state.selection; // May be set by brush.move (on start)!
+ if (empty$1(selection$$1)) state.selection = null, redraw.call(that);
+ emit.end();
+ }
+
+ function keydowned() {
+ switch (exports.event.keyCode) {
+ case 16: { // SHIFT
+ shifting = signX && signY;
+ break;
+ }
+ case 18: { // ALT
+ if (mode === MODE_HANDLE) {
+ if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX;
+ if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY;
+ mode = MODE_CENTER;
+ move();
}
- if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) {
- if (!sibling.R || !sibling.R.C) {
- sibling.L.C = false;
- sibling.C = true;
- d3_geom_voronoiRedBlackRotateRight(this, sibling);
- sibling = parent.R;
- }
- sibling.C = parent.C;
- parent.C = sibling.R.C = false;
- d3_geom_voronoiRedBlackRotateLeft(this, parent);
- node = this._;
- break;
+ break;
+ }
+ case 32: { // SPACE; takes priority over ALT
+ if (mode === MODE_HANDLE || mode === MODE_CENTER) {
+ if (signX < 0) e0 = e1 - dx; else if (signX > 0) w0 = w1 - dx;
+ if (signY < 0) s0 = s1 - dy; else if (signY > 0) n0 = n1 - dy;
+ mode = MODE_SPACE;
+ overlay.attr("cursor", cursors.selection);
+ move();
}
- } else {
- sibling = parent.L;
- if (sibling.C) {
- sibling.C = false;
- parent.C = true;
- d3_geom_voronoiRedBlackRotateRight(this, parent);
- sibling = parent.L;
+ break;
+ }
+ default: return;
+ }
+ noevent$1();
+ }
+
+ function keyupped() {
+ switch (exports.event.keyCode) {
+ case 16: { // SHIFT
+ if (shifting) {
+ lockX = lockY = shifting = false;
+ move();
}
- if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) {
- if (!sibling.L || !sibling.L.C) {
- sibling.R.C = false;
- sibling.C = true;
- d3_geom_voronoiRedBlackRotateLeft(this, sibling);
- sibling = parent.L;
+ break;
+ }
+ case 18: { // ALT
+ if (mode === MODE_CENTER) {
+ if (signX < 0) e0 = e1; else if (signX > 0) w0 = w1;
+ if (signY < 0) s0 = s1; else if (signY > 0) n0 = n1;
+ mode = MODE_HANDLE;
+ move();
+ }
+ break;
+ }
+ case 32: { // SPACE
+ if (mode === MODE_SPACE) {
+ if (exports.event.altKey) {
+ if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX;
+ if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY;
+ mode = MODE_CENTER;
+ } else {
+ if (signX < 0) e0 = e1; else if (signX > 0) w0 = w1;
+ if (signY < 0) s0 = s1; else if (signY > 0) n0 = n1;
+ mode = MODE_HANDLE;
}
- sibling.C = parent.C;
- parent.C = sibling.L.C = false;
- d3_geom_voronoiRedBlackRotateRight(this, parent);
- node = this._;
- break;
+ overlay.attr("cursor", cursors[type]);
+ move();
}
+ break;
}
- sibling.C = true;
- node = parent;
- parent = parent.U;
- } while (!node.C);
- if (node) node.C = false;
- }
- };
- function d3_geom_voronoiRedBlackRotateLeft(tree, node) {
- var p = node, q = node.R, parent = p.U;
- if (parent) {
- if (parent.L === p) parent.L = q; else parent.R = q;
- } else {
- tree._ = q;
+ default: return;
+ }
+ noevent$1();
}
- q.U = parent;
- p.U = q;
- p.R = q.L;
- if (p.R) p.R.U = p;
- q.L = p;
}
- function d3_geom_voronoiRedBlackRotateRight(tree, node) {
- var p = node, q = node.L, parent = p.U;
- if (parent) {
- if (parent.L === p) parent.L = q; else parent.R = q;
- } else {
- tree._ = q;
- }
- q.U = parent;
- p.U = q;
- p.L = q.R;
- if (p.L) p.L.U = p;
- q.R = p;
- }
- function d3_geom_voronoiRedBlackFirst(node) {
- while (node.L) node = node.L;
- return node;
- }
- function d3_geom_voronoi(sites, bbox) {
- var site = sites.sort(d3_geom_voronoiVertexOrder).pop(), x0, y0, circle;
- d3_geom_voronoiEdges = [];
- d3_geom_voronoiCells = new Array(sites.length);
- d3_geom_voronoiBeaches = new d3_geom_voronoiRedBlackTree();
- d3_geom_voronoiCircles = new d3_geom_voronoiRedBlackTree();
- while (true) {
- circle = d3_geom_voronoiFirstCircle;
- if (site && (!circle || site.y < circle.y || site.y === circle.y && site.x < circle.x)) {
- if (site.x !== x0 || site.y !== y0) {
- d3_geom_voronoiCells[site.i] = new d3_geom_voronoiCell(site);
- d3_geom_voronoiAddBeach(site);
- x0 = site.x, y0 = site.y;
- }
- site = sites.pop();
- } else if (circle) {
- d3_geom_voronoiRemoveBeach(circle.arc);
- } else {
- break;
+
+ function initialize() {
+ var state = this.__brush || {selection: null};
+ state.extent = extent.apply(this, arguments);
+ state.dim = dim;
+ return state;
+ }
+
+ brush.extent = function(_) {
+ return arguments.length ? (extent = typeof _ === "function" ? _ : constant$4([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), brush) : extent;
+ };
+
+ brush.filter = function(_) {
+ return arguments.length ? (filter = typeof _ === "function" ? _ : constant$4(!!_), brush) : filter;
+ };
+
+ brush.handleSize = function(_) {
+ return arguments.length ? (handleSize = +_, brush) : handleSize;
+ };
+
+ brush.on = function() {
+ var value = listeners.on.apply(listeners, arguments);
+ return value === listeners ? brush : value;
+ };
+
+ return brush;
+}
+
+var cos = Math.cos;
+var sin = Math.sin;
+var pi$1 = Math.PI;
+var halfPi$1 = pi$1 / 2;
+var tau$1 = pi$1 * 2;
+var max$1 = Math.max;
+
+function compareValue(compare) {
+ return function(a, b) {
+ return compare(
+ a.source.value + a.target.value,
+ b.source.value + b.target.value
+ );
+ };
+}
+
+function chord() {
+ var padAngle = 0,
+ sortGroups = null,
+ sortSubgroups = null,
+ sortChords = null;
+
+ function chord(matrix) {
+ var n = matrix.length,
+ groupSums = [],
+ groupIndex = sequence(n),
+ subgroupIndex = [],
+ chords = [],
+ groups = chords.groups = new Array(n),
+ subgroups = new Array(n * n),
+ k,
+ x,
+ x0,
+ dx,
+ i,
+ j;
+
+ // Compute the sum.
+ k = 0, i = -1; while (++i < n) {
+ x = 0, j = -1; while (++j < n) {
+ x += matrix[i][j];
}
+ groupSums.push(x);
+ subgroupIndex.push(sequence(n));
+ k += x;
}
- if (bbox) d3_geom_voronoiClipEdges(bbox), d3_geom_voronoiCloseCells(bbox);
- var diagram = {
- cells: d3_geom_voronoiCells,
- edges: d3_geom_voronoiEdges
- };
- d3_geom_voronoiBeaches = d3_geom_voronoiCircles = d3_geom_voronoiEdges = d3_geom_voronoiCells = null;
- return diagram;
- }
- function d3_geom_voronoiVertexOrder(a, b) {
- return b.y - a.y || b.x - a.x;
- }
- d3.geom.voronoi = function(points) {
- var x = d3_geom_pointX, y = d3_geom_pointY, fx = x, fy = y, clipExtent = d3_geom_voronoiClipExtent;
- if (points) return voronoi(points);
- function voronoi(data) {
- var polygons = new Array(data.length), x0 = clipExtent[0][0], y0 = clipExtent[0][1], x1 = clipExtent[1][0], y1 = clipExtent[1][1];
- d3_geom_voronoi(sites(data), clipExtent).cells.forEach(function(cell, i) {
- var edges = cell.edges, site = cell.site, polygon = polygons[i] = edges.length ? edges.map(function(e) {
- var s = e.start();
- return [ s.x, s.y ];
- }) : site.x >= x0 && site.x <= x1 && site.y >= y0 && site.y <= y1 ? [ [ x0, y1 ], [ x1, y1 ], [ x1, y0 ], [ x0, y0 ] ] : [];
- polygon.point = data[i];
+
+ // Sort groups…
+ if (sortGroups) groupIndex.sort(function(a, b) {
+ return sortGroups(groupSums[a], groupSums[b]);
+ });
+
+ // Sort subgroups…
+ if (sortSubgroups) subgroupIndex.forEach(function(d, i) {
+ d.sort(function(a, b) {
+ return sortSubgroups(matrix[i][a], matrix[i][b]);
});
- return polygons;
- }
- function sites(data) {
- return data.map(function(d, i) {
- return {
- x: Math.round(fx(d, i) / ε) * ε,
- y: Math.round(fy(d, i) / ε) * ε,
- i: i
+ });
+
+ // Convert the sum to scaling factor for [0, 2pi].
+ // TODO Allow start and end angle to be specified?
+ // TODO Allow padding to be specified as percentage?
+ k = max$1(0, tau$1 - padAngle * n) / k;
+ dx = k ? padAngle : tau$1 / n;
+
+ // Compute the start and end angle for each group and subgroup.
+ // Note: Opera has a bug reordering object literal properties!
+ x = 0, i = -1; while (++i < n) {
+ x0 = x, j = -1; while (++j < n) {
+ var di = groupIndex[i],
+ dj = subgroupIndex[di][j],
+ v = matrix[di][dj],
+ a0 = x,
+ a1 = x += v * k;
+ subgroups[dj * n + di] = {
+ index: di,
+ subindex: dj,
+ startAngle: a0,
+ endAngle: a1,
+ value: v
};
- });
+ }
+ groups[di] = {
+ index: di,
+ startAngle: x0,
+ endAngle: x,
+ value: groupSums[di]
+ };
+ x += dx;
}
- voronoi.links = function(data) {
- return d3_geom_voronoi(sites(data)).edges.filter(function(edge) {
- return edge.l && edge.r;
- }).map(function(edge) {
- return {
- source: data[edge.l.i],
- target: data[edge.r.i]
- };
- });
- };
- voronoi.triangles = function(data) {
- var triangles = [];
- d3_geom_voronoi(sites(data)).cells.forEach(function(cell, i) {
- var site = cell.site, edges = cell.edges.sort(d3_geom_voronoiHalfEdgeOrder), j = -1, m = edges.length, e0, s0, e1 = edges[m - 1].edge, s1 = e1.l === site ? e1.r : e1.l;
- while (++j < m) {
- e0 = e1;
- s0 = s1;
- e1 = edges[j].edge;
- s1 = e1.l === site ? e1.r : e1.l;
- if (i < s0.i && i < s1.i && d3_geom_voronoiTriangleArea(site, s0, s1) < 0) {
- triangles.push([ data[i], data[s0.i], data[s1.i] ]);
- }
+
+ // Generate chords for each (non-empty) subgroup-subgroup link.
+ i = -1; while (++i < n) {
+ j = i - 1; while (++j < n) {
+ var source = subgroups[j * n + i],
+ target = subgroups[i * n + j];
+ if (source.value || target.value) {
+ chords.push(source.value < target.value
+ ? {source: target, target: source}
+ : {source: source, target: target});
}
- });
- return triangles;
- };
- voronoi.x = function(_) {
- return arguments.length ? (fx = d3_functor(x = _), voronoi) : x;
- };
- voronoi.y = function(_) {
- return arguments.length ? (fy = d3_functor(y = _), voronoi) : y;
- };
- voronoi.clipExtent = function(_) {
- if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent;
- clipExtent = _ == null ? d3_geom_voronoiClipExtent : _;
- return voronoi;
- };
- voronoi.size = function(_) {
- if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent && clipExtent[1];
- return voronoi.clipExtent(_ && [ [ 0, 0 ], _ ]);
- };
- return voronoi;
+ }
+ }
+
+ return sortChords ? chords.sort(sortChords) : chords;
+ }
+
+ chord.padAngle = function(_) {
+ return arguments.length ? (padAngle = max$1(0, _), chord) : padAngle;
+ };
+
+ chord.sortGroups = function(_) {
+ return arguments.length ? (sortGroups = _, chord) : sortGroups;
+ };
+
+ chord.sortSubgroups = function(_) {
+ return arguments.length ? (sortSubgroups = _, chord) : sortSubgroups;
+ };
+
+ chord.sortChords = function(_) {
+ return arguments.length ? (_ == null ? sortChords = null : (sortChords = compareValue(_))._ = _, chord) : sortChords && sortChords._;
+ };
+
+ return chord;
+}
+
+var slice$2 = Array.prototype.slice;
+
+function constant$5(x) {
+ return function() {
+ return x;
+ };
+}
+
+var pi$2 = Math.PI,
+ tau$2 = 2 * pi$2,
+ epsilon$1 = 1e-6,
+ tauEpsilon = tau$2 - epsilon$1;
+
+function Path() {
+ this._x0 = this._y0 = // start of current subpath
+ this._x1 = this._y1 = null; // end of current subpath
+ this._ = "";
+}
+
+function path() {
+ return new Path;
+}
+
+Path.prototype = path.prototype = {
+ constructor: Path,
+ moveTo: function(x, y) {
+ this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y);
+ },
+ closePath: function() {
+ if (this._x1 !== null) {
+ this._x1 = this._x0, this._y1 = this._y0;
+ this._ += "Z";
+ }
+ },
+ lineTo: function(x, y) {
+ this._ += "L" + (this._x1 = +x) + "," + (this._y1 = +y);
+ },
+ quadraticCurveTo: function(x1, y1, x, y) {
+ this._ += "Q" + (+x1) + "," + (+y1) + "," + (this._x1 = +x) + "," + (this._y1 = +y);
+ },
+ bezierCurveTo: function(x1, y1, x2, y2, x, y) {
+ this._ += "C" + (+x1) + "," + (+y1) + "," + (+x2) + "," + (+y2) + "," + (this._x1 = +x) + "," + (this._y1 = +y);
+ },
+ arcTo: function(x1, y1, x2, y2, r) {
+ x1 = +x1, y1 = +y1, x2 = +x2, y2 = +y2, r = +r;
+ var x0 = this._x1,
+ y0 = this._y1,
+ x21 = x2 - x1,
+ y21 = y2 - y1,
+ x01 = x0 - x1,
+ y01 = y0 - y1,
+ l01_2 = x01 * x01 + y01 * y01;
+
+ // Is the radius negative? Error.
+ if (r < 0) throw new Error("negative radius: " + r);
+
+ // Is this path empty? Move to (x1,y1).
+ if (this._x1 === null) {
+ this._ += "M" + (this._x1 = x1) + "," + (this._y1 = y1);
+ }
+
+ // Or, is (x1,y1) coincident with (x0,y0)? Do nothing.
+ else if (!(l01_2 > epsilon$1));
+
+ // Or, are (x0,y0), (x1,y1) and (x2,y2) collinear?
+ // Equivalently, is (x1,y1) coincident with (x2,y2)?
+ // Or, is the radius zero? Line to (x1,y1).
+ else if (!(Math.abs(y01 * x21 - y21 * x01) > epsilon$1) || !r) {
+ this._ += "L" + (this._x1 = x1) + "," + (this._y1 = y1);
+ }
+
+ // Otherwise, draw an arc!
+ else {
+ var x20 = x2 - x0,
+ y20 = y2 - y0,
+ l21_2 = x21 * x21 + y21 * y21,
+ l20_2 = x20 * x20 + y20 * y20,
+ l21 = Math.sqrt(l21_2),
+ l01 = Math.sqrt(l01_2),
+ l = r * Math.tan((pi$2 - Math.acos((l21_2 + l01_2 - l20_2) / (2 * l21 * l01))) / 2),
+ t01 = l / l01,
+ t21 = l / l21;
+
+ // If the start tangent is not coincident with (x0,y0), line to.
+ if (Math.abs(t01 - 1) > epsilon$1) {
+ this._ += "L" + (x1 + t01 * x01) + "," + (y1 + t01 * y01);
+ }
+
+ this._ += "A" + r + "," + r + ",0,0," + (+(y01 * x20 > x01 * y20)) + "," + (this._x1 = x1 + t21 * x21) + "," + (this._y1 = y1 + t21 * y21);
+ }
+ },
+ arc: function(x, y, r, a0, a1, ccw) {
+ x = +x, y = +y, r = +r;
+ var dx = r * Math.cos(a0),
+ dy = r * Math.sin(a0),
+ x0 = x + dx,
+ y0 = y + dy,
+ cw = 1 ^ ccw,
+ da = ccw ? a0 - a1 : a1 - a0;
+
+ // Is the radius negative? Error.
+ if (r < 0) throw new Error("negative radius: " + r);
+
+ // Is this path empty? Move to (x0,y0).
+ if (this._x1 === null) {
+ this._ += "M" + x0 + "," + y0;
+ }
+
+ // Or, is (x0,y0) not coincident with the previous point? Line to (x0,y0).
+ else if (Math.abs(this._x1 - x0) > epsilon$1 || Math.abs(this._y1 - y0) > epsilon$1) {
+ this._ += "L" + x0 + "," + y0;
+ }
+
+ // Is this arc empty? We’re done.
+ if (!r) return;
+
+ // Does the angle go the wrong way? Flip the direction.
+ if (da < 0) da = da % tau$2 + tau$2;
+
+ // Is this a complete circle? Draw two arcs to complete the circle.
+ if (da > tauEpsilon) {
+ this._ += "A" + r + "," + r + ",0,1," + cw + "," + (x - dx) + "," + (y - dy) + "A" + r + "," + r + ",0,1," + cw + "," + (this._x1 = x0) + "," + (this._y1 = y0);
+ }
+
+ // Is this arc non-empty? Draw an arc!
+ else if (da > epsilon$1) {
+ this._ += "A" + r + "," + r + ",0," + (+(da >= pi$2)) + "," + cw + "," + (this._x1 = x + r * Math.cos(a1)) + "," + (this._y1 = y + r * Math.sin(a1));
+ }
+ },
+ rect: function(x, y, w, h) {
+ this._ += "M" + (this._x0 = this._x1 = +x) + "," + (this._y0 = this._y1 = +y) + "h" + (+w) + "v" + (+h) + "h" + (-w) + "Z";
+ },
+ toString: function() {
+ return this._;
+ }
+};
+
+function defaultSource(d) {
+ return d.source;
+}
+
+function defaultTarget(d) {
+ return d.target;
+}
+
+function defaultRadius(d) {
+ return d.radius;
+}
+
+function defaultStartAngle(d) {
+ return d.startAngle;
+}
+
+function defaultEndAngle(d) {
+ return d.endAngle;
+}
+
+function ribbon() {
+ var source = defaultSource,
+ target = defaultTarget,
+ radius = defaultRadius,
+ startAngle = defaultStartAngle,
+ endAngle = defaultEndAngle,
+ context = null;
+
+ function ribbon() {
+ var buffer,
+ argv = slice$2.call(arguments),
+ s = source.apply(this, argv),
+ t = target.apply(this, argv),
+ sr = +radius.apply(this, (argv[0] = s, argv)),
+ sa0 = startAngle.apply(this, argv) - halfPi$1,
+ sa1 = endAngle.apply(this, argv) - halfPi$1,
+ sx0 = sr * cos(sa0),
+ sy0 = sr * sin(sa0),
+ tr = +radius.apply(this, (argv[0] = t, argv)),
+ ta0 = startAngle.apply(this, argv) - halfPi$1,
+ ta1 = endAngle.apply(this, argv) - halfPi$1;
+
+ if (!context) context = buffer = path();
+
+ context.moveTo(sx0, sy0);
+ context.arc(0, 0, sr, sa0, sa1);
+ if (sa0 !== ta0 || sa1 !== ta1) { // TODO sr !== tr?
+ context.quadraticCurveTo(0, 0, tr * cos(ta0), tr * sin(ta0));
+ context.arc(0, 0, tr, ta0, ta1);
+ }
+ context.quadraticCurveTo(0, 0, sx0, sy0);
+ context.closePath();
+
+ if (buffer) return context = null, buffer + "" || null;
+ }
+
+ ribbon.radius = function(_) {
+ return arguments.length ? (radius = typeof _ === "function" ? _ : constant$5(+_), ribbon) : radius;
+ };
+
+ ribbon.startAngle = function(_) {
+ return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant$5(+_), ribbon) : startAngle;
+ };
+
+ ribbon.endAngle = function(_) {
+ return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant$5(+_), ribbon) : endAngle;
+ };
+
+ ribbon.source = function(_) {
+ return arguments.length ? (source = _, ribbon) : source;
+ };
+
+ ribbon.target = function(_) {
+ return arguments.length ? (target = _, ribbon) : target;
+ };
+
+ ribbon.context = function(_) {
+ return arguments.length ? ((context = _ == null ? null : _), ribbon) : context;
+ };
+
+ return ribbon;
+}
+
+var prefix = "$";
+
+function Map() {}
+
+Map.prototype = map$1.prototype = {
+ constructor: Map,
+ has: function(key) {
+ return (prefix + key) in this;
+ },
+ get: function(key) {
+ return this[prefix + key];
+ },
+ set: function(key, value) {
+ this[prefix + key] = value;
+ return this;
+ },
+ remove: function(key) {
+ var property = prefix + key;
+ return property in this && delete this[property];
+ },
+ clear: function() {
+ for (var property in this) if (property[0] === prefix) delete this[property];
+ },
+ keys: function() {
+ var keys = [];
+ for (var property in this) if (property[0] === prefix) keys.push(property.slice(1));
+ return keys;
+ },
+ values: function() {
+ var values = [];
+ for (var property in this) if (property[0] === prefix) values.push(this[property]);
+ return values;
+ },
+ entries: function() {
+ var entries = [];
+ for (var property in this) if (property[0] === prefix) entries.push({key: property.slice(1), value: this[property]});
+ return entries;
+ },
+ size: function() {
+ var size = 0;
+ for (var property in this) if (property[0] === prefix) ++size;
+ return size;
+ },
+ empty: function() {
+ for (var property in this) if (property[0] === prefix) return false;
+ return true;
+ },
+ each: function(f) {
+ for (var property in this) if (property[0] === prefix) f(this[property], property.slice(1), this);
+ }
+};
+
+function map$1(object, f) {
+ var map = new Map;
+
+ // Copy constructor.
+ if (object instanceof Map) object.each(function(value, key) { map.set(key, value); });
+
+ // Index array by numeric index or specified key function.
+ else if (Array.isArray(object)) {
+ var i = -1,
+ n = object.length,
+ o;
+
+ if (f == null) while (++i < n) map.set(i, object[i]);
+ else while (++i < n) map.set(f(o = object[i], i, object), o);
+ }
+
+ // Convert object to map.
+ else if (object) for (var key in object) map.set(key, object[key]);
+
+ return map;
+}
+
+function nest() {
+ var keys = [],
+ sortKeys = [],
+ sortValues,
+ rollup,
+ nest;
+
+ function apply(array, depth, createResult, setResult) {
+ if (depth >= keys.length) {
+ if (sortValues != null) array.sort(sortValues);
+ return rollup != null ? rollup(array) : array;
+ }
+
+ var i = -1,
+ n = array.length,
+ key = keys[depth++],
+ keyValue,
+ value,
+ valuesByKey = map$1(),
+ values,
+ result = createResult();
+
+ while (++i < n) {
+ if (values = valuesByKey.get(keyValue = key(value = array[i]) + "")) {
+ values.push(value);
+ } else {
+ valuesByKey.set(keyValue, [value]);
+ }
+ }
+
+ valuesByKey.each(function(values, key) {
+ setResult(result, key, apply(values, depth, createResult, setResult));
+ });
+
+ return result;
+ }
+
+ function entries(map, depth) {
+ if (++depth > keys.length) return map;
+ var array, sortKey = sortKeys[depth - 1];
+ if (rollup != null && depth >= keys.length) array = map.entries();
+ else array = [], map.each(function(v, k) { array.push({key: k, values: entries(v, depth)}); });
+ return sortKey != null ? array.sort(function(a, b) { return sortKey(a.key, b.key); }) : array;
+ }
+
+ return nest = {
+ object: function(array) { return apply(array, 0, createObject, setObject); },
+ map: function(array) { return apply(array, 0, createMap, setMap); },
+ entries: function(array) { return entries(apply(array, 0, createMap, setMap), 0); },
+ key: function(d) { keys.push(d); return nest; },
+ sortKeys: function(order) { sortKeys[keys.length - 1] = order; return nest; },
+ sortValues: function(order) { sortValues = order; return nest; },
+ rollup: function(f) { rollup = f; return nest; }
+ };
+}
+
+function createObject() {
+ return {};
+}
+
+function setObject(object, key, value) {
+ object[key] = value;
+}
+
+function createMap() {
+ return map$1();
+}
+
+function setMap(map, key, value) {
+ map.set(key, value);
+}
+
+function Set() {}
+
+var proto = map$1.prototype;
+
+Set.prototype = set$2.prototype = {
+ constructor: Set,
+ has: proto.has,
+ add: function(value) {
+ value += "";
+ this[prefix + value] = value;
+ return this;
+ },
+ remove: proto.remove,
+ clear: proto.clear,
+ values: proto.keys,
+ size: proto.size,
+ empty: proto.empty,
+ each: proto.each
+};
+
+function set$2(object, f) {
+ var set = new Set;
+
+ // Copy constructor.
+ if (object instanceof Set) object.each(function(value) { set.add(value); });
+
+ // Otherwise, assume it’s an array.
+ else if (object) {
+ var i = -1, n = object.length;
+ if (f == null) while (++i < n) set.add(object[i]);
+ else while (++i < n) set.add(f(object[i], i, object));
+ }
+
+ return set;
+}
+
+function keys(map) {
+ var keys = [];
+ for (var key in map) keys.push(key);
+ return keys;
+}
+
+function values(map) {
+ var values = [];
+ for (var key in map) values.push(map[key]);
+ return values;
+}
+
+function entries(map) {
+ var entries = [];
+ for (var key in map) entries.push({key: key, value: map[key]});
+ return entries;
+}
+
+var array$2 = Array.prototype;
+
+var slice$3 = array$2.slice;
+
+function ascending$2(a, b) {
+ return a - b;
+}
+
+function area(ring) {
+ var i = 0, n = ring.length, area = ring[n - 1][1] * ring[0][0] - ring[n - 1][0] * ring[0][1];
+ while (++i < n) area += ring[i - 1][1] * ring[i][0] - ring[i - 1][0] * ring[i][1];
+ return area;
+}
+
+function constant$6(x) {
+ return function() {
+ return x;
+ };
+}
+
+function contains(ring, hole) {
+ var i = -1, n = hole.length, c;
+ while (++i < n) if (c = ringContains(ring, hole[i])) return c;
+ return 0;
+}
+
+function ringContains(ring, point) {
+ var x = point[0], y = point[1], contains = -1;
+ for (var i = 0, n = ring.length, j = n - 1; i < n; j = i++) {
+ var pi = ring[i], xi = pi[0], yi = pi[1], pj = ring[j], xj = pj[0], yj = pj[1];
+ if (segmentContains(pi, pj, point)) return 0;
+ if (((yi > y) !== (yj > y)) && ((x < (xj - xi) * (y - yi) / (yj - yi) + xi))) contains = -contains;
+ }
+ return contains;
+}
+
+function segmentContains(a, b, c) {
+ var i; return collinear(a, b, c) && within(a[i = +(a[0] === b[0])], c[i], b[i]);
+}
+
+function collinear(a, b, c) {
+ return (b[0] - a[0]) * (c[1] - a[1]) === (c[0] - a[0]) * (b[1] - a[1]);
+}
+
+function within(p, q, r) {
+ return p <= q && q <= r || r <= q && q <= p;
+}
+
+function noop$1() {}
+
+var cases = [
+ [],
+ [[[1.0, 1.5], [0.5, 1.0]]],
+ [[[1.5, 1.0], [1.0, 1.5]]],
+ [[[1.5, 1.0], [0.5, 1.0]]],
+ [[[1.0, 0.5], [1.5, 1.0]]],
+ [[[1.0, 1.5], [0.5, 1.0]], [[1.0, 0.5], [1.5, 1.0]]],
+ [[[1.0, 0.5], [1.0, 1.5]]],
+ [[[1.0, 0.5], [0.5, 1.0]]],
+ [[[0.5, 1.0], [1.0, 0.5]]],
+ [[[1.0, 1.5], [1.0, 0.5]]],
+ [[[0.5, 1.0], [1.0, 0.5]], [[1.5, 1.0], [1.0, 1.5]]],
+ [[[1.5, 1.0], [1.0, 0.5]]],
+ [[[0.5, 1.0], [1.5, 1.0]]],
+ [[[1.0, 1.5], [1.5, 1.0]]],
+ [[[0.5, 1.0], [1.0, 1.5]]],
+ []
+];
+
+function contours() {
+ var dx = 1,
+ dy = 1,
+ threshold$$1 = thresholdSturges,
+ smooth = smoothLinear;
+
+ function contours(values) {
+ var tz = threshold$$1(values);
+
+ // Convert number of thresholds into uniform thresholds.
+ if (!Array.isArray(tz)) {
+ var domain = extent(values), start = domain[0], stop = domain[1];
+ tz = tickStep(start, stop, tz);
+ tz = sequence(Math.floor(start / tz) * tz, Math.floor(stop / tz) * tz, tz);
+ } else {
+ tz = tz.slice().sort(ascending$2);
+ }
+
+ return tz.map(function(value) {
+ return contour(values, value);
+ });
+ }
+
+ // Accumulate, smooth contour rings, assign holes to exterior rings.
+ // Based on https://github.com/mbostock/shapefile/blob/v0.6.2/shp/polygon.js
+ function contour(values, value) {
+ var polygons = [],
+ holes = [];
+
+ isorings(values, value, function(ring) {
+ smooth(ring, values, value);
+ if (area(ring) > 0) polygons.push([ring]);
+ else holes.push(ring);
+ });
+
+ holes.forEach(function(hole) {
+ for (var i = 0, n = polygons.length, polygon; i < n; ++i) {
+ if (contains((polygon = polygons[i])[0], hole) !== -1) {
+ polygon.push(hole);
+ return;
+ }
+ }
+ });
+
+ return {
+ type: "MultiPolygon",
+ value: value,
+ coordinates: polygons
+ };
+ }
+
+ // Marching squares with isolines stitched into rings.
+ // Based on https://github.com/topojson/topojson-client/blob/v3.0.0/src/stitch.js
+ function isorings(values, value, callback) {
+ var fragmentByStart = new Array,
+ fragmentByEnd = new Array,
+ x, y, t0, t1, t2, t3;
+
+ // Special case for the first row (y = -1, t2 = t3 = 0).
+ x = y = -1;
+ t1 = values[0] >= value;
+ cases[t1 << 1].forEach(stitch);
+ while (++x < dx - 1) {
+ t0 = t1, t1 = values[x + 1] >= value;
+ cases[t0 | t1 << 1].forEach(stitch);
+ }
+ cases[t1 << 0].forEach(stitch);
+
+ // General case for the intermediate rows.
+ while (++y < dy - 1) {
+ x = -1;
+ t1 = values[y * dx + dx] >= value;
+ t2 = values[y * dx] >= value;
+ cases[t1 << 1 | t2 << 2].forEach(stitch);
+ while (++x < dx - 1) {
+ t0 = t1, t1 = values[y * dx + dx + x + 1] >= value;
+ t3 = t2, t2 = values[y * dx + x + 1] >= value;
+ cases[t0 | t1 << 1 | t2 << 2 | t3 << 3].forEach(stitch);
+ }
+ cases[t1 | t2 << 3].forEach(stitch);
+ }
+
+ // Special case for the last row (y = dy - 1, t0 = t1 = 0).
+ x = -1;
+ t2 = values[y * dx] >= value;
+ cases[t2 << 2].forEach(stitch);
+ while (++x < dx - 1) {
+ t3 = t2, t2 = values[y * dx + x + 1] >= value;
+ cases[t2 << 2 | t3 << 3].forEach(stitch);
+ }
+ cases[t2 << 3].forEach(stitch);
+
+ function stitch(line) {
+ var start = [line[0][0] + x, line[0][1] + y],
+ end = [line[1][0] + x, line[1][1] + y],
+ startIndex = index(start),
+ endIndex = index(end),
+ f, g;
+ if (f = fragmentByEnd[startIndex]) {
+ if (g = fragmentByStart[endIndex]) {
+ delete fragmentByEnd[f.end];
+ delete fragmentByStart[g.start];
+ if (f === g) {
+ f.ring.push(end);
+ callback(f.ring);
+ } else {
+ fragmentByStart[f.start] = fragmentByEnd[g.end] = {start: f.start, end: g.end, ring: f.ring.concat(g.ring)};
+ }
+ } else {
+ delete fragmentByEnd[f.end];
+ f.ring.push(end);
+ fragmentByEnd[f.end = endIndex] = f;
+ }
+ } else if (f = fragmentByStart[endIndex]) {
+ if (g = fragmentByEnd[startIndex]) {
+ delete fragmentByStart[f.start];
+ delete fragmentByEnd[g.end];
+ if (f === g) {
+ f.ring.push(end);
+ callback(f.ring);
+ } else {
+ fragmentByStart[g.start] = fragmentByEnd[f.end] = {start: g.start, end: f.end, ring: g.ring.concat(f.ring)};
+ }
+ } else {
+ delete fragmentByStart[f.start];
+ f.ring.unshift(start);
+ fragmentByStart[f.start = startIndex] = f;
+ }
+ } else {
+ fragmentByStart[startIndex] = fragmentByEnd[endIndex] = {start: startIndex, end: endIndex, ring: [start, end]};
+ }
+ }
+ }
+
+ function index(point) {
+ return point[0] * 2 + point[1] * (dx + 1) * 4;
+ }
+
+ function smoothLinear(ring, values, value) {
+ ring.forEach(function(point) {
+ var x = point[0],
+ y = point[1],
+ xt = x | 0,
+ yt = y | 0,
+ v0,
+ v1 = values[yt * dx + xt];
+ if (x > 0 && x < dx && xt === x) {
+ v0 = values[yt * dx + xt - 1];
+ point[0] = x + (value - v0) / (v1 - v0) - 0.5;
+ }
+ if (y > 0 && y < dy && yt === y) {
+ v0 = values[(yt - 1) * dx + xt];
+ point[1] = y + (value - v0) / (v1 - v0) - 0.5;
+ }
+ });
+ }
+
+ contours.contour = contour;
+
+ contours.size = function(_) {
+ if (!arguments.length) return [dx, dy];
+ var _0 = Math.ceil(_[0]), _1 = Math.ceil(_[1]);
+ if (!(_0 > 0) || !(_1 > 0)) throw new Error("invalid size");
+ return dx = _0, dy = _1, contours;
+ };
+
+ contours.thresholds = function(_) {
+ return arguments.length ? (threshold$$1 = typeof _ === "function" ? _ : Array.isArray(_) ? constant$6(slice$3.call(_)) : constant$6(_), contours) : threshold$$1;
+ };
+
+ contours.smooth = function(_) {
+ return arguments.length ? (smooth = _ ? smoothLinear : noop$1, contours) : smooth === smoothLinear;
+ };
+
+ return contours;
+}
+
+// TODO Optimize edge cases.
+// TODO Optimize index calculation.
+// TODO Optimize arguments.
+function blurX(source, target, r) {
+ var n = source.width,
+ m = source.height,
+ w = (r << 1) + 1;
+ for (var j = 0; j < m; ++j) {
+ for (var i = 0, sr = 0; i < n + r; ++i) {
+ if (i < n) {
+ sr += source.data[i + j * n];
+ }
+ if (i >= r) {
+ if (i >= w) {
+ sr -= source.data[i - w + j * n];
+ }
+ target.data[i - r + j * n] = sr / Math.min(i + 1, n - 1 + w - i, w);
+ }
+ }
+ }
+}
+
+// TODO Optimize edge cases.
+// TODO Optimize index calculation.
+// TODO Optimize arguments.
+function blurY(source, target, r) {
+ var n = source.width,
+ m = source.height,
+ w = (r << 1) + 1;
+ for (var i = 0; i < n; ++i) {
+ for (var j = 0, sr = 0; j < m + r; ++j) {
+ if (j < m) {
+ sr += source.data[i + j * n];
+ }
+ if (j >= r) {
+ if (j >= w) {
+ sr -= source.data[i + (j - w) * n];
+ }
+ target.data[i + (j - r) * n] = sr / Math.min(j + 1, m - 1 + w - j, w);
+ }
+ }
+ }
+}
+
+function defaultX(d) {
+ return d[0];
+}
+
+function defaultY(d) {
+ return d[1];
+}
+
+function defaultWeight() {
+ return 1;
+}
+
+function density() {
+ var x = defaultX,
+ y = defaultY,
+ weight = defaultWeight,
+ dx = 960,
+ dy = 500,
+ r = 20, // blur radius
+ k = 2, // log2(grid cell size)
+ o = r * 3, // grid offset, to pad for blur
+ n = (dx + o * 2) >> k, // grid width
+ m = (dy + o * 2) >> k, // grid height
+ threshold$$1 = constant$6(20);
+
+ function density(data) {
+ var values0 = new Float32Array(n * m),
+ values1 = new Float32Array(n * m);
+
+ data.forEach(function(d, i, data) {
+ var xi = (+x(d, i, data) + o) >> k,
+ yi = (+y(d, i, data) + o) >> k,
+ wi = +weight(d, i, data);
+ if (xi >= 0 && xi < n && yi >= 0 && yi < m) {
+ values0[xi + yi * n] += wi;
+ }
+ });
+
+ // TODO Optimize.
+ blurX({width: n, height: m, data: values0}, {width: n, height: m, data: values1}, r >> k);
+ blurY({width: n, height: m, data: values1}, {width: n, height: m, data: values0}, r >> k);
+ blurX({width: n, height: m, data: values0}, {width: n, height: m, data: values1}, r >> k);
+ blurY({width: n, height: m, data: values1}, {width: n, height: m, data: values0}, r >> k);
+ blurX({width: n, height: m, data: values0}, {width: n, height: m, data: values1}, r >> k);
+ blurY({width: n, height: m, data: values1}, {width: n, height: m, data: values0}, r >> k);
+
+ var tz = threshold$$1(values0);
+
+ // Convert number of thresholds into uniform thresholds.
+ if (!Array.isArray(tz)) {
+ var stop = max(values0);
+ tz = tickStep(0, stop, tz);
+ tz = sequence(0, Math.floor(stop / tz) * tz, tz);
+ tz.shift();
+ }
+
+ return contours()
+ .thresholds(tz)
+ .size([n, m])
+ (values0)
+ .map(transform);
+ }
+
+ function transform(geometry) {
+ geometry.value *= Math.pow(2, -2 * k); // Density in points per square pixel.
+ geometry.coordinates.forEach(transformPolygon);
+ return geometry;
+ }
+
+ function transformPolygon(coordinates) {
+ coordinates.forEach(transformRing);
+ }
+
+ function transformRing(coordinates) {
+ coordinates.forEach(transformPoint);
+ }
+
+ // TODO Optimize.
+ function transformPoint(coordinates) {
+ coordinates[0] = coordinates[0] * Math.pow(2, k) - o;
+ coordinates[1] = coordinates[1] * Math.pow(2, k) - o;
+ }
+
+ function resize() {
+ o = r * 3;
+ n = (dx + o * 2) >> k;
+ m = (dy + o * 2) >> k;
+ return density;
+ }
+
+ density.x = function(_) {
+ return arguments.length ? (x = typeof _ === "function" ? _ : constant$6(+_), density) : x;
+ };
+
+ density.y = function(_) {
+ return arguments.length ? (y = typeof _ === "function" ? _ : constant$6(+_), density) : y;
+ };
+
+ density.weight = function(_) {
+ return arguments.length ? (weight = typeof _ === "function" ? _ : constant$6(+_), density) : weight;
+ };
+
+ density.size = function(_) {
+ if (!arguments.length) return [dx, dy];
+ var _0 = Math.ceil(_[0]), _1 = Math.ceil(_[1]);
+ if (!(_0 >= 0) && !(_0 >= 0)) throw new Error("invalid size");
+ return dx = _0, dy = _1, resize();
+ };
+
+ density.cellSize = function(_) {
+ if (!arguments.length) return 1 << k;
+ if (!((_ = +_) >= 1)) throw new Error("invalid cell size");
+ return k = Math.floor(Math.log(_) / Math.LN2), resize();
+ };
+
+ density.thresholds = function(_) {
+ return arguments.length ? (threshold$$1 = typeof _ === "function" ? _ : Array.isArray(_) ? constant$6(slice$3.call(_)) : constant$6(_), density) : threshold$$1;
+ };
+
+ density.bandwidth = function(_) {
+ if (!arguments.length) return Math.sqrt(r * (r + 1));
+ if (!((_ = +_) >= 0)) throw new Error("invalid bandwidth");
+ return r = Math.round((Math.sqrt(4 * _ * _ + 1) - 1) / 2), resize();
+ };
+
+ return density;
+}
+
+var EOL = {},
+ EOF = {},
+ QUOTE = 34,
+ NEWLINE = 10,
+ RETURN = 13;
+
+function objectConverter(columns) {
+ return new Function("d", "return {" + columns.map(function(name, i) {
+ return JSON.stringify(name) + ": d[" + i + "]";
+ }).join(",") + "}");
+}
+
+function customConverter(columns, f) {
+ var object = objectConverter(columns);
+ return function(row, i) {
+ return f(object(row), i, columns);
+ };
+}
+
+// Compute unique columns in order of discovery.
+function inferColumns(rows) {
+ var columnSet = Object.create(null),
+ columns = [];
+
+ rows.forEach(function(row) {
+ for (var column in row) {
+ if (!(column in columnSet)) {
+ columns.push(columnSet[column] = column);
+ }
+ }
+ });
+
+ return columns;
+}
+
+function pad(value, width) {
+ var s = value + "", length = s.length;
+ return length < width ? new Array(width - length + 1).join(0) + s : s;
+}
+
+function formatYear(year) {
+ return year < 0 ? "-" + pad(-year, 6)
+ : year > 9999 ? "+" + pad(year, 6)
+ : pad(year, 4);
+}
+
+function formatDate(date) {
+ var hours = date.getUTCHours(),
+ minutes = date.getUTCMinutes(),
+ seconds = date.getUTCSeconds(),
+ milliseconds = date.getUTCMilliseconds();
+ return isNaN(date) ? "Invalid Date"
+ : formatYear(date.getUTCFullYear(), 4) + "-" + pad(date.getUTCMonth() + 1, 2) + "-" + pad(date.getUTCDate(), 2)
+ + (milliseconds ? "T" + pad(hours, 2) + ":" + pad(minutes, 2) + ":" + pad(seconds, 2) + "." + pad(milliseconds, 3) + "Z"
+ : seconds ? "T" + pad(hours, 2) + ":" + pad(minutes, 2) + ":" + pad(seconds, 2) + "Z"
+ : minutes || hours ? "T" + pad(hours, 2) + ":" + pad(minutes, 2) + "Z"
+ : "");
+}
+
+function dsvFormat(delimiter) {
+ var reFormat = new RegExp("[\"" + delimiter + "\n\r]"),
+ DELIMITER = delimiter.charCodeAt(0);
+
+ function parse(text, f) {
+ var convert, columns, rows = parseRows(text, function(row, i) {
+ if (convert) return convert(row, i - 1);
+ columns = row, convert = f ? customConverter(row, f) : objectConverter(row);
+ });
+ rows.columns = columns || [];
+ return rows;
+ }
+
+ function parseRows(text, f) {
+ var rows = [], // output rows
+ N = text.length,
+ I = 0, // current character index
+ n = 0, // current line number
+ t, // current token
+ eof = N <= 0, // current token followed by EOF?
+ eol = false; // current token followed by EOL?
+
+ // Strip the trailing newline.
+ if (text.charCodeAt(N - 1) === NEWLINE) --N;
+ if (text.charCodeAt(N - 1) === RETURN) --N;
+
+ function token() {
+ if (eof) return EOF;
+ if (eol) return eol = false, EOL;
+
+ // Unescape quotes.
+ var i, j = I, c;
+ if (text.charCodeAt(j) === QUOTE) {
+ while (I++ < N && text.charCodeAt(I) !== QUOTE || text.charCodeAt(++I) === QUOTE);
+ if ((i = I) >= N) eof = true;
+ else if ((c = text.charCodeAt(I++)) === NEWLINE) eol = true;
+ else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }
+ return text.slice(j + 1, i - 1).replace(/""/g, "\"");
+ }
+
+ // Find next delimiter or newline.
+ while (I < N) {
+ if ((c = text.charCodeAt(i = I++)) === NEWLINE) eol = true;
+ else if (c === RETURN) { eol = true; if (text.charCodeAt(I) === NEWLINE) ++I; }
+ else if (c !== DELIMITER) continue;
+ return text.slice(j, i);
+ }
+
+ // Return last token before EOF.
+ return eof = true, text.slice(j, N);
+ }
+
+ while ((t = token()) !== EOF) {
+ var row = [];
+ while (t !== EOL && t !== EOF) row.push(t), t = token();
+ if (f && (row = f(row, n++)) == null) continue;
+ rows.push(row);
+ }
+
+ return rows;
+ }
+
+ function preformatBody(rows, columns) {
+ return rows.map(function(row) {
+ return columns.map(function(column) {
+ return formatValue(row[column]);
+ }).join(delimiter);
+ });
+ }
+
+ function format(rows, columns) {
+ if (columns == null) columns = inferColumns(rows);
+ return [columns.map(formatValue).join(delimiter)].concat(preformatBody(rows, columns)).join("\n");
+ }
+
+ function formatBody(rows, columns) {
+ if (columns == null) columns = inferColumns(rows);
+ return preformatBody(rows, columns).join("\n");
+ }
+
+ function formatRows(rows) {
+ return rows.map(formatRow).join("\n");
+ }
+
+ function formatRow(row) {
+ return row.map(formatValue).join(delimiter);
+ }
+
+ function formatValue(value) {
+ return value == null ? ""
+ : value instanceof Date ? formatDate(value)
+ : reFormat.test(value += "") ? "\"" + value.replace(/"/g, "\"\"") + "\""
+ : value;
+ }
+
+ return {
+ parse: parse,
+ parseRows: parseRows,
+ format: format,
+ formatBody: formatBody,
+ formatRows: formatRows
+ };
+}
+
+var csv = dsvFormat(",");
+
+var csvParse = csv.parse;
+var csvParseRows = csv.parseRows;
+var csvFormat = csv.format;
+var csvFormatBody = csv.formatBody;
+var csvFormatRows = csv.formatRows;
+
+var tsv = dsvFormat("\t");
+
+var tsvParse = tsv.parse;
+var tsvParseRows = tsv.parseRows;
+var tsvFormat = tsv.format;
+var tsvFormatBody = tsv.formatBody;
+var tsvFormatRows = tsv.formatRows;
+
+function autoType(object) {
+ for (var key in object) {
+ var value = object[key].trim(), number;
+ if (!value) value = null;
+ else if (value === "true") value = true;
+ else if (value === "false") value = false;
+ else if (value === "NaN") value = NaN;
+ else if (!isNaN(number = +value)) value = number;
+ else if (/^([-+]\d{2})?\d{4}(-\d{2}(-\d{2})?)?(T\d{2}:\d{2}(:\d{2}(\.\d{3})?)?(Z|[-+]\d{2}:\d{2})?)?$/.test(value)) value = new Date(value);
+ else continue;
+ object[key] = value;
+ }
+ return object;
+}
+
+function responseBlob(response) {
+ if (!response.ok) throw new Error(response.status + " " + response.statusText);
+ return response.blob();
+}
+
+function blob(input, init) {
+ return fetch(input, init).then(responseBlob);
+}
+
+function responseArrayBuffer(response) {
+ if (!response.ok) throw new Error(response.status + " " + response.statusText);
+ return response.arrayBuffer();
+}
+
+function buffer(input, init) {
+ return fetch(input, init).then(responseArrayBuffer);
+}
+
+function responseText(response) {
+ if (!response.ok) throw new Error(response.status + " " + response.statusText);
+ return response.text();
+}
+
+function text(input, init) {
+ return fetch(input, init).then(responseText);
+}
+
+function dsvParse(parse) {
+ return function(input, init, row) {
+ if (arguments.length === 2 && typeof init === "function") row = init, init = undefined;
+ return text(input, init).then(function(response) {
+ return parse(response, row);
+ });
+ };
+}
+
+function dsv(delimiter, input, init, row) {
+ if (arguments.length === 3 && typeof init === "function") row = init, init = undefined;
+ var format = dsvFormat(delimiter);
+ return text(input, init).then(function(response) {
+ return format.parse(response, row);
+ });
+}
+
+var csv$1 = dsvParse(csvParse);
+var tsv$1 = dsvParse(tsvParse);
+
+function image(input, init) {
+ return new Promise(function(resolve, reject) {
+ var image = new Image;
+ for (var key in init) image[key] = init[key];
+ image.onerror = reject;
+ image.onload = function() { resolve(image); };
+ image.src = input;
+ });
+}
+
+function responseJson(response) {
+ if (!response.ok) throw new Error(response.status + " " + response.statusText);
+ return response.json();
+}
+
+function json(input, init) {
+ return fetch(input, init).then(responseJson);
+}
+
+function parser(type) {
+ return function(input, init) {
+ return text(input, init).then(function(text$$1) {
+ return (new DOMParser).parseFromString(text$$1, type);
+ });
+ };
+}
+
+var xml = parser("application/xml");
+
+var html = parser("text/html");
+
+var svg = parser("image/svg+xml");
+
+function center$1(x, y) {
+ var nodes;
+
+ if (x == null) x = 0;
+ if (y == null) y = 0;
+
+ function force() {
+ var i,
+ n = nodes.length,
+ node,
+ sx = 0,
+ sy = 0;
+
+ for (i = 0; i < n; ++i) {
+ node = nodes[i], sx += node.x, sy += node.y;
+ }
+
+ for (sx = sx / n - x, sy = sy / n - y, i = 0; i < n; ++i) {
+ node = nodes[i], node.x -= sx, node.y -= sy;
+ }
+ }
+
+ force.initialize = function(_) {
+ nodes = _;
+ };
+
+ force.x = function(_) {
+ return arguments.length ? (x = +_, force) : x;
+ };
+
+ force.y = function(_) {
+ return arguments.length ? (y = +_, force) : y;
+ };
+
+ return force;
+}
+
+function constant$7(x) {
+ return function() {
+ return x;
+ };
+}
+
+function jiggle() {
+ return (Math.random() - 0.5) * 1e-6;
+}
+
+function tree_add(d) {
+ var x = +this._x.call(null, d),
+ y = +this._y.call(null, d);
+ return add(this.cover(x, y), x, y, d);
+}
+
+function add(tree, x, y, d) {
+ if (isNaN(x) || isNaN(y)) return tree; // ignore invalid points
+
+ var parent,
+ node = tree._root,
+ leaf = {data: d},
+ x0 = tree._x0,
+ y0 = tree._y0,
+ x1 = tree._x1,
+ y1 = tree._y1,
+ xm,
+ ym,
+ xp,
+ yp,
+ right,
+ bottom,
+ i,
+ j;
+
+ // If the tree is empty, initialize the root as a leaf.
+ if (!node) return tree._root = leaf, tree;
+
+ // Find the existing leaf for the new point, or add it.
+ while (node.length) {
+ if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;
+ if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;
+ if (parent = node, !(node = node[i = bottom << 1 | right])) return parent[i] = leaf, tree;
+ }
+
+ // Is the new point is exactly coincident with the existing point?
+ xp = +tree._x.call(null, node.data);
+ yp = +tree._y.call(null, node.data);
+ if (x === xp && y === yp) return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree;
+
+ // Otherwise, split the leaf node until the old and new point are separated.
+ do {
+ parent = parent ? parent[i] = new Array(4) : tree._root = new Array(4);
+ if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;
+ if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;
+ } while ((i = bottom << 1 | right) === (j = (yp >= ym) << 1 | (xp >= xm)));
+ return parent[j] = node, parent[i] = leaf, tree;
+}
+
+function addAll(data) {
+ var d, i, n = data.length,
+ x,
+ y,
+ xz = new Array(n),
+ yz = new Array(n),
+ x0 = Infinity,
+ y0 = Infinity,
+ x1 = -Infinity,
+ y1 = -Infinity;
+
+ // Compute the points and their extent.
+ for (i = 0; i < n; ++i) {
+ if (isNaN(x = +this._x.call(null, d = data[i])) || isNaN(y = +this._y.call(null, d))) continue;
+ xz[i] = x;
+ yz[i] = y;
+ if (x < x0) x0 = x;
+ if (x > x1) x1 = x;
+ if (y < y0) y0 = y;
+ if (y > y1) y1 = y;
+ }
+
+ // If there were no (valid) points, abort.
+ if (x0 > x1 || y0 > y1) return this;
+
+ // Expand the tree to cover the new points.
+ this.cover(x0, y0).cover(x1, y1);
+
+ // Add the new points.
+ for (i = 0; i < n; ++i) {
+ add(this, xz[i], yz[i], data[i]);
+ }
+
+ return this;
+}
+
+function tree_cover(x, y) {
+ if (isNaN(x = +x) || isNaN(y = +y)) return this; // ignore invalid points
+
+ var x0 = this._x0,
+ y0 = this._y0,
+ x1 = this._x1,
+ y1 = this._y1;
+
+ // If the quadtree has no extent, initialize them.
+ // Integer extent are necessary so that if we later double the extent,
+ // the existing quadrant boundaries don’t change due to floating point error!
+ if (isNaN(x0)) {
+ x1 = (x0 = Math.floor(x)) + 1;
+ y1 = (y0 = Math.floor(y)) + 1;
+ }
+
+ // Otherwise, double repeatedly to cover.
+ else {
+ var z = x1 - x0,
+ node = this._root,
+ parent,
+ i;
+
+ while (x0 > x || x >= x1 || y0 > y || y >= y1) {
+ i = (y < y0) << 1 | (x < x0);
+ parent = new Array(4), parent[i] = node, node = parent, z *= 2;
+ switch (i) {
+ case 0: x1 = x0 + z, y1 = y0 + z; break;
+ case 1: x0 = x1 - z, y1 = y0 + z; break;
+ case 2: x1 = x0 + z, y0 = y1 - z; break;
+ case 3: x0 = x1 - z, y0 = y1 - z; break;
+ }
+ }
+
+ if (this._root && this._root.length) this._root = node;
+ }
+
+ this._x0 = x0;
+ this._y0 = y0;
+ this._x1 = x1;
+ this._y1 = y1;
+ return this;
+}
+
+function tree_data() {
+ var data = [];
+ this.visit(function(node) {
+ if (!node.length) do data.push(node.data); while (node = node.next)
+ });
+ return data;
+}
+
+function tree_extent(_) {
+ return arguments.length
+ ? this.cover(+_[0][0], +_[0][1]).cover(+_[1][0], +_[1][1])
+ : isNaN(this._x0) ? undefined : [[this._x0, this._y0], [this._x1, this._y1]];
+}
+
+function Quad(node, x0, y0, x1, y1) {
+ this.node = node;
+ this.x0 = x0;
+ this.y0 = y0;
+ this.x1 = x1;
+ this.y1 = y1;
+}
+
+function tree_find(x, y, radius) {
+ var data,
+ x0 = this._x0,
+ y0 = this._y0,
+ x1,
+ y1,
+ x2,
+ y2,
+ x3 = this._x1,
+ y3 = this._y1,
+ quads = [],
+ node = this._root,
+ q,
+ i;
+
+ if (node) quads.push(new Quad(node, x0, y0, x3, y3));
+ if (radius == null) radius = Infinity;
+ else {
+ x0 = x - radius, y0 = y - radius;
+ x3 = x + radius, y3 = y + radius;
+ radius *= radius;
+ }
+
+ while (q = quads.pop()) {
+
+ // Stop searching if this quadrant can’t contain a closer node.
+ if (!(node = q.node)
+ || (x1 = q.x0) > x3
+ || (y1 = q.y0) > y3
+ || (x2 = q.x1) < x0
+ || (y2 = q.y1) < y0) continue;
+
+ // Bisect the current quadrant.
+ if (node.length) {
+ var xm = (x1 + x2) / 2,
+ ym = (y1 + y2) / 2;
+
+ quads.push(
+ new Quad(node[3], xm, ym, x2, y2),
+ new Quad(node[2], x1, ym, xm, y2),
+ new Quad(node[1], xm, y1, x2, ym),
+ new Quad(node[0], x1, y1, xm, ym)
+ );
+
+ // Visit the closest quadrant first.
+ if (i = (y >= ym) << 1 | (x >= xm)) {
+ q = quads[quads.length - 1];
+ quads[quads.length - 1] = quads[quads.length - 1 - i];
+ quads[quads.length - 1 - i] = q;
+ }
+ }
+
+ // Visit this point. (Visiting coincident points isn’t necessary!)
+ else {
+ var dx = x - +this._x.call(null, node.data),
+ dy = y - +this._y.call(null, node.data),
+ d2 = dx * dx + dy * dy;
+ if (d2 < radius) {
+ var d = Math.sqrt(radius = d2);
+ x0 = x - d, y0 = y - d;
+ x3 = x + d, y3 = y + d;
+ data = node.data;
+ }
+ }
+ }
+
+ return data;
+}
+
+function tree_remove(d) {
+ if (isNaN(x = +this._x.call(null, d)) || isNaN(y = +this._y.call(null, d))) return this; // ignore invalid points
+
+ var parent,
+ node = this._root,
+ retainer,
+ previous,
+ next,
+ x0 = this._x0,
+ y0 = this._y0,
+ x1 = this._x1,
+ y1 = this._y1,
+ x,
+ y,
+ xm,
+ ym,
+ right,
+ bottom,
+ i,
+ j;
+
+ // If the tree is empty, initialize the root as a leaf.
+ if (!node) return this;
+
+ // Find the leaf node for the point.
+ // While descending, also retain the deepest parent with a non-removed sibling.
+ if (node.length) while (true) {
+ if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;
+ if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;
+ if (!(parent = node, node = node[i = bottom << 1 | right])) return this;
+ if (!node.length) break;
+ if (parent[(i + 1) & 3] || parent[(i + 2) & 3] || parent[(i + 3) & 3]) retainer = parent, j = i;
+ }
+
+ // Find the point to remove.
+ while (node.data !== d) if (!(previous = node, node = node.next)) return this;
+ if (next = node.next) delete node.next;
+
+ // If there are multiple coincident points, remove just the point.
+ if (previous) return (next ? previous.next = next : delete previous.next), this;
+
+ // If this is the root point, remove it.
+ if (!parent) return this._root = next, this;
+
+ // Remove this leaf.
+ next ? parent[i] = next : delete parent[i];
+
+ // If the parent now contains exactly one leaf, collapse superfluous parents.
+ if ((node = parent[0] || parent[1] || parent[2] || parent[3])
+ && node === (parent[3] || parent[2] || parent[1] || parent[0])
+ && !node.length) {
+ if (retainer) retainer[j] = node;
+ else this._root = node;
+ }
+
+ return this;
+}
+
+function removeAll(data) {
+ for (var i = 0, n = data.length; i < n; ++i) this.remove(data[i]);
+ return this;
+}
+
+function tree_root() {
+ return this._root;
+}
+
+function tree_size() {
+ var size = 0;
+ this.visit(function(node) {
+ if (!node.length) do ++size; while (node = node.next)
+ });
+ return size;
+}
+
+function tree_visit(callback) {
+ var quads = [], q, node = this._root, child, x0, y0, x1, y1;
+ if (node) quads.push(new Quad(node, this._x0, this._y0, this._x1, this._y1));
+ while (q = quads.pop()) {
+ if (!callback(node = q.node, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1) && node.length) {
+ var xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;
+ if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));
+ if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));
+ if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));
+ if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));
+ }
+ }
+ return this;
+}
+
+function tree_visitAfter(callback) {
+ var quads = [], next = [], q;
+ if (this._root) quads.push(new Quad(this._root, this._x0, this._y0, this._x1, this._y1));
+ while (q = quads.pop()) {
+ var node = q.node;
+ if (node.length) {
+ var child, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1, xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;
+ if (child = node[0]) quads.push(new Quad(child, x0, y0, xm, ym));
+ if (child = node[1]) quads.push(new Quad(child, xm, y0, x1, ym));
+ if (child = node[2]) quads.push(new Quad(child, x0, ym, xm, y1));
+ if (child = node[3]) quads.push(new Quad(child, xm, ym, x1, y1));
+ }
+ next.push(q);
+ }
+ while (q = next.pop()) {
+ callback(q.node, q.x0, q.y0, q.x1, q.y1);
+ }
+ return this;
+}
+
+function defaultX$1(d) {
+ return d[0];
+}
+
+function tree_x(_) {
+ return arguments.length ? (this._x = _, this) : this._x;
+}
+
+function defaultY$1(d) {
+ return d[1];
+}
+
+function tree_y(_) {
+ return arguments.length ? (this._y = _, this) : this._y;
+}
+
+function quadtree(nodes, x, y) {
+ var tree = new Quadtree(x == null ? defaultX$1 : x, y == null ? defaultY$1 : y, NaN, NaN, NaN, NaN);
+ return nodes == null ? tree : tree.addAll(nodes);
+}
+
+function Quadtree(x, y, x0, y0, x1, y1) {
+ this._x = x;
+ this._y = y;
+ this._x0 = x0;
+ this._y0 = y0;
+ this._x1 = x1;
+ this._y1 = y1;
+ this._root = undefined;
+}
+
+function leaf_copy(leaf) {
+ var copy = {data: leaf.data}, next = copy;
+ while (leaf = leaf.next) next = next.next = {data: leaf.data};
+ return copy;
+}
+
+var treeProto = quadtree.prototype = Quadtree.prototype;
+
+treeProto.copy = function() {
+ var copy = new Quadtree(this._x, this._y, this._x0, this._y0, this._x1, this._y1),
+ node = this._root,
+ nodes,
+ child;
+
+ if (!node) return copy;
+
+ if (!node.length) return copy._root = leaf_copy(node), copy;
+
+ nodes = [{source: node, target: copy._root = new Array(4)}];
+ while (node = nodes.pop()) {
+ for (var i = 0; i < 4; ++i) {
+ if (child = node.source[i]) {
+ if (child.length) nodes.push({source: child, target: node.target[i] = new Array(4)});
+ else node.target[i] = leaf_copy(child);
+ }
+ }
+ }
+
+ return copy;
+};
+
+treeProto.add = tree_add;
+treeProto.addAll = addAll;
+treeProto.cover = tree_cover;
+treeProto.data = tree_data;
+treeProto.extent = tree_extent;
+treeProto.find = tree_find;
+treeProto.remove = tree_remove;
+treeProto.removeAll = removeAll;
+treeProto.root = tree_root;
+treeProto.size = tree_size;
+treeProto.visit = tree_visit;
+treeProto.visitAfter = tree_visitAfter;
+treeProto.x = tree_x;
+treeProto.y = tree_y;
+
+function x(d) {
+ return d.x + d.vx;
+}
+
+function y(d) {
+ return d.y + d.vy;
+}
+
+function collide(radius) {
+ var nodes,
+ radii,
+ strength = 1,
+ iterations = 1;
+
+ if (typeof radius !== "function") radius = constant$7(radius == null ? 1 : +radius);
+
+ function force() {
+ var i, n = nodes.length,
+ tree,
+ node,
+ xi,
+ yi,
+ ri,
+ ri2;
+
+ for (var k = 0; k < iterations; ++k) {
+ tree = quadtree(nodes, x, y).visitAfter(prepare);
+ for (i = 0; i < n; ++i) {
+ node = nodes[i];
+ ri = radii[node.index], ri2 = ri * ri;
+ xi = node.x + node.vx;
+ yi = node.y + node.vy;
+ tree.visit(apply);
+ }
+ }
+
+ function apply(quad, x0, y0, x1, y1) {
+ var data = quad.data, rj = quad.r, r = ri + rj;
+ if (data) {
+ if (data.index > node.index) {
+ var x = xi - data.x - data.vx,
+ y = yi - data.y - data.vy,
+ l = x * x + y * y;
+ if (l < r * r) {
+ if (x === 0) x = jiggle(), l += x * x;
+ if (y === 0) y = jiggle(), l += y * y;
+ l = (r - (l = Math.sqrt(l))) / l * strength;
+ node.vx += (x *= l) * (r = (rj *= rj) / (ri2 + rj));
+ node.vy += (y *= l) * r;
+ data.vx -= x * (r = 1 - r);
+ data.vy -= y * r;
+ }
+ }
+ return;
+ }
+ return x0 > xi + r || x1 < xi - r || y0 > yi + r || y1 < yi - r;
+ }
+ }
+
+ function prepare(quad) {
+ if (quad.data) return quad.r = radii[quad.data.index];
+ for (var i = quad.r = 0; i < 4; ++i) {
+ if (quad[i] && quad[i].r > quad.r) {
+ quad.r = quad[i].r;
+ }
+ }
+ }
+
+ function initialize() {
+ if (!nodes) return;
+ var i, n = nodes.length, node;
+ radii = new Array(n);
+ for (i = 0; i < n; ++i) node = nodes[i], radii[node.index] = +radius(node, i, nodes);
+ }
+
+ force.initialize = function(_) {
+ nodes = _;
+ initialize();
+ };
+
+ force.iterations = function(_) {
+ return arguments.length ? (iterations = +_, force) : iterations;
+ };
+
+ force.strength = function(_) {
+ return arguments.length ? (strength = +_, force) : strength;
+ };
+
+ force.radius = function(_) {
+ return arguments.length ? (radius = typeof _ === "function" ? _ : constant$7(+_), initialize(), force) : radius;
+ };
+
+ return force;
+}
+
+function index(d) {
+ return d.index;
+}
+
+function find(nodeById, nodeId) {
+ var node = nodeById.get(nodeId);
+ if (!node) throw new Error("missing: " + nodeId);
+ return node;
+}
+
+function link(links) {
+ var id = index,
+ strength = defaultStrength,
+ strengths,
+ distance = constant$7(30),
+ distances,
+ nodes,
+ count,
+ bias,
+ iterations = 1;
+
+ if (links == null) links = [];
+
+ function defaultStrength(link) {
+ return 1 / Math.min(count[link.source.index], count[link.target.index]);
+ }
+
+ function force(alpha) {
+ for (var k = 0, n = links.length; k < iterations; ++k) {
+ for (var i = 0, link, source, target, x, y, l, b; i < n; ++i) {
+ link = links[i], source = link.source, target = link.target;
+ x = target.x + target.vx - source.x - source.vx || jiggle();
+ y = target.y + target.vy - source.y - source.vy || jiggle();
+ l = Math.sqrt(x * x + y * y);
+ l = (l - distances[i]) / l * alpha * strengths[i];
+ x *= l, y *= l;
+ target.vx -= x * (b = bias[i]);
+ target.vy -= y * b;
+ source.vx += x * (b = 1 - b);
+ source.vy += y * b;
+ }
+ }
+ }
+
+ function initialize() {
+ if (!nodes) return;
+
+ var i,
+ n = nodes.length,
+ m = links.length,
+ nodeById = map$1(nodes, id),
+ link;
+
+ for (i = 0, count = new Array(n); i < m; ++i) {
+ link = links[i], link.index = i;
+ if (typeof link.source !== "object") link.source = find(nodeById, link.source);
+ if (typeof link.target !== "object") link.target = find(nodeById, link.target);
+ count[link.source.index] = (count[link.source.index] || 0) + 1;
+ count[link.target.index] = (count[link.target.index] || 0) + 1;
+ }
+
+ for (i = 0, bias = new Array(m); i < m; ++i) {
+ link = links[i], bias[i] = count[link.source.index] / (count[link.source.index] + count[link.target.index]);
+ }
+
+ strengths = new Array(m), initializeStrength();
+ distances = new Array(m), initializeDistance();
+ }
+
+ function initializeStrength() {
+ if (!nodes) return;
+
+ for (var i = 0, n = links.length; i < n; ++i) {
+ strengths[i] = +strength(links[i], i, links);
+ }
+ }
+
+ function initializeDistance() {
+ if (!nodes) return;
+
+ for (var i = 0, n = links.length; i < n; ++i) {
+ distances[i] = +distance(links[i], i, links);
+ }
+ }
+
+ force.initialize = function(_) {
+ nodes = _;
+ initialize();
+ };
+
+ force.links = function(_) {
+ return arguments.length ? (links = _, initialize(), force) : links;
+ };
+
+ force.id = function(_) {
+ return arguments.length ? (id = _, force) : id;
+ };
+
+ force.iterations = function(_) {
+ return arguments.length ? (iterations = +_, force) : iterations;
+ };
+
+ force.strength = function(_) {
+ return arguments.length ? (strength = typeof _ === "function" ? _ : constant$7(+_), initializeStrength(), force) : strength;
+ };
+
+ force.distance = function(_) {
+ return arguments.length ? (distance = typeof _ === "function" ? _ : constant$7(+_), initializeDistance(), force) : distance;
+ };
+
+ return force;
+}
+
+function x$1(d) {
+ return d.x;
+}
+
+function y$1(d) {
+ return d.y;
+}
+
+var initialRadius = 10,
+ initialAngle = Math.PI * (3 - Math.sqrt(5));
+
+function simulation(nodes) {
+ var simulation,
+ alpha = 1,
+ alphaMin = 0.001,
+ alphaDecay = 1 - Math.pow(alphaMin, 1 / 300),
+ alphaTarget = 0,
+ velocityDecay = 0.6,
+ forces = map$1(),
+ stepper = timer(step),
+ event = dispatch("tick", "end");
+
+ if (nodes == null) nodes = [];
+
+ function step() {
+ tick();
+ event.call("tick", simulation);
+ if (alpha < alphaMin) {
+ stepper.stop();
+ event.call("end", simulation);
+ }
+ }
+
+ function tick(iterations) {
+ var i, n = nodes.length, node;
+
+ if (iterations === undefined) iterations = 1;
+
+ for (var k = 0; k < iterations; ++k) {
+ alpha += (alphaTarget - alpha) * alphaDecay;
+
+ forces.each(function (force) {
+ force(alpha);
+ });
+
+ for (i = 0; i < n; ++i) {
+ node = nodes[i];
+ if (node.fx == null) node.x += node.vx *= velocityDecay;
+ else node.x = node.fx, node.vx = 0;
+ if (node.fy == null) node.y += node.vy *= velocityDecay;
+ else node.y = node.fy, node.vy = 0;
+ }
+ }
+
+ return simulation;
+ }
+
+ function initializeNodes() {
+ for (var i = 0, n = nodes.length, node; i < n; ++i) {
+ node = nodes[i], node.index = i;
+ if (node.fx != null) node.x = node.fx;
+ if (node.fy != null) node.y = node.fy;
+ if (isNaN(node.x) || isNaN(node.y)) {
+ var radius = initialRadius * Math.sqrt(i), angle = i * initialAngle;
+ node.x = radius * Math.cos(angle);
+ node.y = radius * Math.sin(angle);
+ }
+ if (isNaN(node.vx) || isNaN(node.vy)) {
+ node.vx = node.vy = 0;
+ }
+ }
+ }
+
+ function initializeForce(force) {
+ if (force.initialize) force.initialize(nodes);
+ return force;
+ }
+
+ initializeNodes();
+
+ return simulation = {
+ tick: tick,
+
+ restart: function() {
+ return stepper.restart(step), simulation;
+ },
+
+ stop: function() {
+ return stepper.stop(), simulation;
+ },
+
+ nodes: function(_) {
+ return arguments.length ? (nodes = _, initializeNodes(), forces.each(initializeForce), simulation) : nodes;
+ },
+
+ alpha: function(_) {
+ return arguments.length ? (alpha = +_, simulation) : alpha;
+ },
+
+ alphaMin: function(_) {
+ return arguments.length ? (alphaMin = +_, simulation) : alphaMin;
+ },
+
+ alphaDecay: function(_) {
+ return arguments.length ? (alphaDecay = +_, simulation) : +alphaDecay;
+ },
+
+ alphaTarget: function(_) {
+ return arguments.length ? (alphaTarget = +_, simulation) : alphaTarget;
+ },
+
+ velocityDecay: function(_) {
+ return arguments.length ? (velocityDecay = 1 - _, simulation) : 1 - velocityDecay;
+ },
+
+ force: function(name, _) {
+ return arguments.length > 1 ? ((_ == null ? forces.remove(name) : forces.set(name, initializeForce(_))), simulation) : forces.get(name);
+ },
+
+ find: function(x, y, radius) {
+ var i = 0,
+ n = nodes.length,
+ dx,
+ dy,
+ d2,
+ node,
+ closest;
+
+ if (radius == null) radius = Infinity;
+ else radius *= radius;
+
+ for (i = 0; i < n; ++i) {
+ node = nodes[i];
+ dx = x - node.x;
+ dy = y - node.y;
+ d2 = dx * dx + dy * dy;
+ if (d2 < radius) closest = node, radius = d2;
+ }
+
+ return closest;
+ },
+
+ on: function(name, _) {
+ return arguments.length > 1 ? (event.on(name, _), simulation) : event.on(name);
+ }
+ };
+}
+
+function manyBody() {
+ var nodes,
+ node,
+ alpha,
+ strength = constant$7(-30),
+ strengths,
+ distanceMin2 = 1,
+ distanceMax2 = Infinity,
+ theta2 = 0.81;
+
+ function force(_) {
+ var i, n = nodes.length, tree = quadtree(nodes, x$1, y$1).visitAfter(accumulate);
+ for (alpha = _, i = 0; i < n; ++i) node = nodes[i], tree.visit(apply);
+ }
+
+ function initialize() {
+ if (!nodes) return;
+ var i, n = nodes.length, node;
+ strengths = new Array(n);
+ for (i = 0; i < n; ++i) node = nodes[i], strengths[node.index] = +strength(node, i, nodes);
+ }
+
+ function accumulate(quad) {
+ var strength = 0, q, c, weight = 0, x, y, i;
+
+ // For internal nodes, accumulate forces from child quadrants.
+ if (quad.length) {
+ for (x = y = i = 0; i < 4; ++i) {
+ if ((q = quad[i]) && (c = Math.abs(q.value))) {
+ strength += q.value, weight += c, x += c * q.x, y += c * q.y;
+ }
+ }
+ quad.x = x / weight;
+ quad.y = y / weight;
+ }
+
+ // For leaf nodes, accumulate forces from coincident quadrants.
+ else {
+ q = quad;
+ q.x = q.data.x;
+ q.y = q.data.y;
+ do strength += strengths[q.data.index];
+ while (q = q.next);
+ }
+
+ quad.value = strength;
+ }
+
+ function apply(quad, x1, _, x2) {
+ if (!quad.value) return true;
+
+ var x = quad.x - node.x,
+ y = quad.y - node.y,
+ w = x2 - x1,
+ l = x * x + y * y;
+
+ // Apply the Barnes-Hut approximation if possible.
+ // Limit forces for very close nodes; randomize direction if coincident.
+ if (w * w / theta2 < l) {
+ if (l < distanceMax2) {
+ if (x === 0) x = jiggle(), l += x * x;
+ if (y === 0) y = jiggle(), l += y * y;
+ if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);
+ node.vx += x * quad.value * alpha / l;
+ node.vy += y * quad.value * alpha / l;
+ }
+ return true;
+ }
+
+ // Otherwise, process points directly.
+ else if (quad.length || l >= distanceMax2) return;
+
+ // Limit forces for very close nodes; randomize direction if coincident.
+ if (quad.data !== node || quad.next) {
+ if (x === 0) x = jiggle(), l += x * x;
+ if (y === 0) y = jiggle(), l += y * y;
+ if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);
+ }
+
+ do if (quad.data !== node) {
+ w = strengths[quad.data.index] * alpha / l;
+ node.vx += x * w;
+ node.vy += y * w;
+ } while (quad = quad.next);
+ }
+
+ force.initialize = function(_) {
+ nodes = _;
+ initialize();
+ };
+
+ force.strength = function(_) {
+ return arguments.length ? (strength = typeof _ === "function" ? _ : constant$7(+_), initialize(), force) : strength;
+ };
+
+ force.distanceMin = function(_) {
+ return arguments.length ? (distanceMin2 = _ * _, force) : Math.sqrt(distanceMin2);
+ };
+
+ force.distanceMax = function(_) {
+ return arguments.length ? (distanceMax2 = _ * _, force) : Math.sqrt(distanceMax2);
+ };
+
+ force.theta = function(_) {
+ return arguments.length ? (theta2 = _ * _, force) : Math.sqrt(theta2);
+ };
+
+ return force;
+}
+
+function radial(radius, x, y) {
+ var nodes,
+ strength = constant$7(0.1),
+ strengths,
+ radiuses;
+
+ if (typeof radius !== "function") radius = constant$7(+radius);
+ if (x == null) x = 0;
+ if (y == null) y = 0;
+
+ function force(alpha) {
+ for (var i = 0, n = nodes.length; i < n; ++i) {
+ var node = nodes[i],
+ dx = node.x - x || 1e-6,
+ dy = node.y - y || 1e-6,
+ r = Math.sqrt(dx * dx + dy * dy),
+ k = (radiuses[i] - r) * strengths[i] * alpha / r;
+ node.vx += dx * k;
+ node.vy += dy * k;
+ }
+ }
+
+ function initialize() {
+ if (!nodes) return;
+ var i, n = nodes.length;
+ strengths = new Array(n);
+ radiuses = new Array(n);
+ for (i = 0; i < n; ++i) {
+ radiuses[i] = +radius(nodes[i], i, nodes);
+ strengths[i] = isNaN(radiuses[i]) ? 0 : +strength(nodes[i], i, nodes);
+ }
+ }
+
+ force.initialize = function(_) {
+ nodes = _, initialize();
+ };
+
+ force.strength = function(_) {
+ return arguments.length ? (strength = typeof _ === "function" ? _ : constant$7(+_), initialize(), force) : strength;
+ };
+
+ force.radius = function(_) {
+ return arguments.length ? (radius = typeof _ === "function" ? _ : constant$7(+_), initialize(), force) : radius;
+ };
+
+ force.x = function(_) {
+ return arguments.length ? (x = +_, force) : x;
+ };
+
+ force.y = function(_) {
+ return arguments.length ? (y = +_, force) : y;
+ };
+
+ return force;
+}
+
+function x$2(x) {
+ var strength = constant$7(0.1),
+ nodes,
+ strengths,
+ xz;
+
+ if (typeof x !== "function") x = constant$7(x == null ? 0 : +x);
+
+ function force(alpha) {
+ for (var i = 0, n = nodes.length, node; i < n; ++i) {
+ node = nodes[i], node.vx += (xz[i] - node.x) * strengths[i] * alpha;
+ }
+ }
+
+ function initialize() {
+ if (!nodes) return;
+ var i, n = nodes.length;
+ strengths = new Array(n);
+ xz = new Array(n);
+ for (i = 0; i < n; ++i) {
+ strengths[i] = isNaN(xz[i] = +x(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);
+ }
+ }
+
+ force.initialize = function(_) {
+ nodes = _;
+ initialize();
+ };
+
+ force.strength = function(_) {
+ return arguments.length ? (strength = typeof _ === "function" ? _ : constant$7(+_), initialize(), force) : strength;
+ };
+
+ force.x = function(_) {
+ return arguments.length ? (x = typeof _ === "function" ? _ : constant$7(+_), initialize(), force) : x;
+ };
+
+ return force;
+}
+
+function y$2(y) {
+ var strength = constant$7(0.1),
+ nodes,
+ strengths,
+ yz;
+
+ if (typeof y !== "function") y = constant$7(y == null ? 0 : +y);
+
+ function force(alpha) {
+ for (var i = 0, n = nodes.length, node; i < n; ++i) {
+ node = nodes[i], node.vy += (yz[i] - node.y) * strengths[i] * alpha;
+ }
+ }
+
+ function initialize() {
+ if (!nodes) return;
+ var i, n = nodes.length;
+ strengths = new Array(n);
+ yz = new Array(n);
+ for (i = 0; i < n; ++i) {
+ strengths[i] = isNaN(yz[i] = +y(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);
+ }
+ }
+
+ force.initialize = function(_) {
+ nodes = _;
+ initialize();
+ };
+
+ force.strength = function(_) {
+ return arguments.length ? (strength = typeof _ === "function" ? _ : constant$7(+_), initialize(), force) : strength;
+ };
+
+ force.y = function(_) {
+ return arguments.length ? (y = typeof _ === "function" ? _ : constant$7(+_), initialize(), force) : y;
+ };
+
+ return force;
+}
+
+// Computes the decimal coefficient and exponent of the specified number x with
+// significant digits p, where x is positive and p is in [1, 21] or undefined.
+// For example, formatDecimal(1.23) returns ["123", 0].
+function formatDecimal(x, p) {
+ if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity
+ var i, coefficient = x.slice(0, i);
+
+ // The string returned by toExponential either has the form \d\.\d+e[-+]\d+
+ // (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3).
+ return [
+ coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,
+ +x.slice(i + 1)
+ ];
+}
+
+function exponent$1(x) {
+ return x = formatDecimal(Math.abs(x)), x ? x[1] : NaN;
+}
+
+function formatGroup(grouping, thousands) {
+ return function(value, width) {
+ var i = value.length,
+ t = [],
+ j = 0,
+ g = grouping[0],
+ length = 0;
+
+ while (i > 0 && g > 0) {
+ if (length + g + 1 > width) g = Math.max(1, width - length);
+ t.push(value.substring(i -= g, i + g));
+ if ((length += g + 1) > width) break;
+ g = grouping[j = (j + 1) % grouping.length];
+ }
+
+ return t.reverse().join(thousands);
+ };
+}
+
+function formatNumerals(numerals) {
+ return function(value) {
+ return value.replace(/[0-9]/g, function(i) {
+ return numerals[+i];
+ });
+ };
+}
+
+// [[fill]align][sign][symbol][0][width][,][.precision][~][type]
+var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;
+
+function formatSpecifier(specifier) {
+ return new FormatSpecifier(specifier);
+}
+
+formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof
+
+function FormatSpecifier(specifier) {
+ if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier);
+ var match;
+ this.fill = match[1] || " ";
+ this.align = match[2] || ">";
+ this.sign = match[3] || "-";
+ this.symbol = match[4] || "";
+ this.zero = !!match[5];
+ this.width = match[6] && +match[6];
+ this.comma = !!match[7];
+ this.precision = match[8] && +match[8].slice(1);
+ this.trim = !!match[9];
+ this.type = match[10] || "";
+}
+
+FormatSpecifier.prototype.toString = function() {
+ return this.fill
+ + this.align
+ + this.sign
+ + this.symbol
+ + (this.zero ? "0" : "")
+ + (this.width == null ? "" : Math.max(1, this.width | 0))
+ + (this.comma ? "," : "")
+ + (this.precision == null ? "" : "." + Math.max(0, this.precision | 0))
+ + (this.trim ? "~" : "")
+ + this.type;
+};
+
+// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.
+function formatTrim(s) {
+ out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {
+ switch (s[i]) {
+ case ".": i0 = i1 = i; break;
+ case "0": if (i0 === 0) i0 = i; i1 = i; break;
+ default: if (i0 > 0) { if (!+s[i]) break out; i0 = 0; } break;
+ }
+ }
+ return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;
+}
+
+var prefixExponent;
+
+function formatPrefixAuto(x, p) {
+ var d = formatDecimal(x, p);
+ if (!d) return x + "";
+ var coefficient = d[0],
+ exponent = d[1],
+ i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,
+ n = coefficient.length;
+ return i === n ? coefficient
+ : i > n ? coefficient + new Array(i - n + 1).join("0")
+ : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i)
+ : "0." + new Array(1 - i).join("0") + formatDecimal(x, Math.max(0, p + i - 1))[0]; // less than 1y!
+}
+
+function formatRounded(x, p) {
+ var d = formatDecimal(x, p);
+ if (!d) return x + "";
+ var coefficient = d[0],
+ exponent = d[1];
+ return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient
+ : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1)
+ : coefficient + new Array(exponent - coefficient.length + 2).join("0");
+}
+
+var formatTypes = {
+ "%": function(x, p) { return (x * 100).toFixed(p); },
+ "b": function(x) { return Math.round(x).toString(2); },
+ "c": function(x) { return x + ""; },
+ "d": function(x) { return Math.round(x).toString(10); },
+ "e": function(x, p) { return x.toExponential(p); },
+ "f": function(x, p) { return x.toFixed(p); },
+ "g": function(x, p) { return x.toPrecision(p); },
+ "o": function(x) { return Math.round(x).toString(8); },
+ "p": function(x, p) { return formatRounded(x * 100, p); },
+ "r": formatRounded,
+ "s": formatPrefixAuto,
+ "X": function(x) { return Math.round(x).toString(16).toUpperCase(); },
+ "x": function(x) { return Math.round(x).toString(16); }
+};
+
+function identity$3(x) {
+ return x;
+}
+
+var prefixes = ["y","z","a","f","p","n","\xB5","m","","k","M","G","T","P","E","Z","Y"];
+
+function formatLocale(locale) {
+ var group = locale.grouping && locale.thousands ? formatGroup(locale.grouping, locale.thousands) : identity$3,
+ currency = locale.currency,
+ decimal = locale.decimal,
+ numerals = locale.numerals ? formatNumerals(locale.numerals) : identity$3,
+ percent = locale.percent || "%";
+
+ function newFormat(specifier) {
+ specifier = formatSpecifier(specifier);
+
+ var fill = specifier.fill,
+ align = specifier.align,
+ sign = specifier.sign,
+ symbol = specifier.symbol,
+ zero = specifier.zero,
+ width = specifier.width,
+ comma = specifier.comma,
+ precision = specifier.precision,
+ trim = specifier.trim,
+ type = specifier.type;
+
+ // The "n" type is an alias for ",g".
+ if (type === "n") comma = true, type = "g";
+
+ // The "" type, and any invalid type, is an alias for ".12~g".
+ else if (!formatTypes[type]) precision == null && (precision = 12), trim = true, type = "g";
+
+ // If zero fill is specified, padding goes after sign and before digits.
+ if (zero || (fill === "0" && align === "=")) zero = true, fill = "0", align = "=";
+
+ // Compute the prefix and suffix.
+ // For SI-prefix, the suffix is lazily computed.
+ var prefix = symbol === "$" ? currency[0] : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "",
+ suffix = symbol === "$" ? currency[1] : /[%p]/.test(type) ? percent : "";
+
+ // What format function should we use?
+ // Is this an integer type?
+ // Can this type generate exponential notation?
+ var formatType = formatTypes[type],
+ maybeSuffix = /[defgprs%]/.test(type);
+
+ // Set the default precision if not specified,
+ // or clamp the specified precision to the supported range.
+ // For significant precision, it must be in [1, 21].
+ // For fixed precision, it must be in [0, 20].
+ precision = precision == null ? 6
+ : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))
+ : Math.max(0, Math.min(20, precision));
+
+ function format(value) {
+ var valuePrefix = prefix,
+ valueSuffix = suffix,
+ i, n, c;
+
+ if (type === "c") {
+ valueSuffix = formatType(value) + valueSuffix;
+ value = "";
+ } else {
+ value = +value;
+
+ // Perform the initial formatting.
+ var valueNegative = value < 0;
+ value = formatType(Math.abs(value), precision);
+
+ // Trim insignificant zeros.
+ if (trim) value = formatTrim(value);
+
+ // If a negative value rounds to zero during formatting, treat as positive.
+ if (valueNegative && +value === 0) valueNegative = false;
+
+ // Compute the prefix and suffix.
+ valuePrefix = (valueNegative ? (sign === "(" ? sign : "-") : sign === "-" || sign === "(" ? "" : sign) + valuePrefix;
+ valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : "");
+
+ // Break the formatted value into the integer “value†part that can be
+ // grouped, and fractional or exponential “suffix†part that is not.
+ if (maybeSuffix) {
+ i = -1, n = value.length;
+ while (++i < n) {
+ if (c = value.charCodeAt(i), 48 > c || c > 57) {
+ valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;
+ value = value.slice(0, i);
+ break;
+ }
+ }
+ }
+ }
+
+ // If the fill character is not "0", grouping is applied before padding.
+ if (comma && !zero) value = group(value, Infinity);
+
+ // Compute the padding.
+ var length = valuePrefix.length + value.length + valueSuffix.length,
+ padding = length < width ? new Array(width - length + 1).join(fill) : "";
+
+ // If the fill character is "0", grouping is applied after padding.
+ if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = "";
+
+ // Reconstruct the final output based on the desired alignment.
+ switch (align) {
+ case "<": value = valuePrefix + value + valueSuffix + padding; break;
+ case "=": value = valuePrefix + padding + value + valueSuffix; break;
+ case "^": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;
+ default: value = padding + valuePrefix + value + valueSuffix; break;
+ }
+
+ return numerals(value);
+ }
+
+ format.toString = function() {
+ return specifier + "";
+ };
+
+ return format;
+ }
+
+ function formatPrefix(specifier, value) {
+ var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)),
+ e = Math.max(-8, Math.min(8, Math.floor(exponent$1(value) / 3))) * 3,
+ k = Math.pow(10, -e),
+ prefix = prefixes[8 + e / 3];
+ return function(value) {
+ return f(k * value) + prefix;
+ };
+ }
+
+ return {
+ format: newFormat,
+ formatPrefix: formatPrefix
+ };
+}
+
+var locale;
+
+defaultLocale({
+ decimal: ".",
+ thousands: ",",
+ grouping: [3],
+ currency: ["$", ""]
+});
+
+function defaultLocale(definition) {
+ locale = formatLocale(definition);
+ exports.format = locale.format;
+ exports.formatPrefix = locale.formatPrefix;
+ return locale;
+}
+
+function precisionFixed(step) {
+ return Math.max(0, -exponent$1(Math.abs(step)));
+}
+
+function precisionPrefix(step, value) {
+ return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent$1(value) / 3))) * 3 - exponent$1(Math.abs(step)));
+}
+
+function precisionRound(step, max) {
+ step = Math.abs(step), max = Math.abs(max) - step;
+ return Math.max(0, exponent$1(max) - exponent$1(step)) + 1;
+}
+
+// Adds floating point numbers with twice the normal precision.
+// Reference: J. R. Shewchuk, Adaptive Precision Floating-Point Arithmetic and
+// Fast Robust Geometric Predicates, Discrete & Computational Geometry 18(3)
+// 305–363 (1997).
+// Code adapted from GeographicLib by Charles F. F. Karney,
+// http://geographiclib.sourceforge.net/
+
+function adder() {
+ return new Adder;
+}
+
+function Adder() {
+ this.reset();
+}
+
+Adder.prototype = {
+ constructor: Adder,
+ reset: function() {
+ this.s = // rounded value
+ this.t = 0; // exact error
+ },
+ add: function(y) {
+ add$1(temp, y, this.t);
+ add$1(this, temp.s, this.s);
+ if (this.s) this.t += temp.t;
+ else this.s = temp.t;
+ },
+ valueOf: function() {
+ return this.s;
+ }
+};
+
+var temp = new Adder;
+
+function add$1(adder, a, b) {
+ var x = adder.s = a + b,
+ bv = x - a,
+ av = x - bv;
+ adder.t = (a - av) + (b - bv);
+}
+
+var epsilon$2 = 1e-6;
+var epsilon2$1 = 1e-12;
+var pi$3 = Math.PI;
+var halfPi$2 = pi$3 / 2;
+var quarterPi = pi$3 / 4;
+var tau$3 = pi$3 * 2;
+
+var degrees$1 = 180 / pi$3;
+var radians = pi$3 / 180;
+
+var abs = Math.abs;
+var atan = Math.atan;
+var atan2 = Math.atan2;
+var cos$1 = Math.cos;
+var ceil = Math.ceil;
+var exp = Math.exp;
+var log = Math.log;
+var pow = Math.pow;
+var sin$1 = Math.sin;
+var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };
+var sqrt = Math.sqrt;
+var tan = Math.tan;
+
+function acos(x) {
+ return x > 1 ? 0 : x < -1 ? pi$3 : Math.acos(x);
+}
+
+function asin(x) {
+ return x > 1 ? halfPi$2 : x < -1 ? -halfPi$2 : Math.asin(x);
+}
+
+function haversin(x) {
+ return (x = sin$1(x / 2)) * x;
+}
+
+function noop$2() {}
+
+function streamGeometry(geometry, stream) {
+ if (geometry && streamGeometryType.hasOwnProperty(geometry.type)) {
+ streamGeometryType[geometry.type](geometry, stream);
+ }
+}
+
+var streamObjectType = {
+ Feature: function(object, stream) {
+ streamGeometry(object.geometry, stream);
+ },
+ FeatureCollection: function(object, stream) {
+ var features = object.features, i = -1, n = features.length;
+ while (++i < n) streamGeometry(features[i].geometry, stream);
+ }
+};
+
+var streamGeometryType = {
+ Sphere: function(object, stream) {
+ stream.sphere();
+ },
+ Point: function(object, stream) {
+ object = object.coordinates;
+ stream.point(object[0], object[1], object[2]);
+ },
+ MultiPoint: function(object, stream) {
+ var coordinates = object.coordinates, i = -1, n = coordinates.length;
+ while (++i < n) object = coordinates[i], stream.point(object[0], object[1], object[2]);
+ },
+ LineString: function(object, stream) {
+ streamLine(object.coordinates, stream, 0);
+ },
+ MultiLineString: function(object, stream) {
+ var coordinates = object.coordinates, i = -1, n = coordinates.length;
+ while (++i < n) streamLine(coordinates[i], stream, 0);
+ },
+ Polygon: function(object, stream) {
+ streamPolygon(object.coordinates, stream);
+ },
+ MultiPolygon: function(object, stream) {
+ var coordinates = object.coordinates, i = -1, n = coordinates.length;
+ while (++i < n) streamPolygon(coordinates[i], stream);
+ },
+ GeometryCollection: function(object, stream) {
+ var geometries = object.geometries, i = -1, n = geometries.length;
+ while (++i < n) streamGeometry(geometries[i], stream);
+ }
+};
+
+function streamLine(coordinates, stream, closed) {
+ var i = -1, n = coordinates.length - closed, coordinate;
+ stream.lineStart();
+ while (++i < n) coordinate = coordinates[i], stream.point(coordinate[0], coordinate[1], coordinate[2]);
+ stream.lineEnd();
+}
+
+function streamPolygon(coordinates, stream) {
+ var i = -1, n = coordinates.length;
+ stream.polygonStart();
+ while (++i < n) streamLine(coordinates[i], stream, 1);
+ stream.polygonEnd();
+}
+
+function geoStream(object, stream) {
+ if (object && streamObjectType.hasOwnProperty(object.type)) {
+ streamObjectType[object.type](object, stream);
+ } else {
+ streamGeometry(object, stream);
+ }
+}
+
+var areaRingSum = adder();
+
+var areaSum = adder(),
+ lambda00,
+ phi00,
+ lambda0,
+ cosPhi0,
+ sinPhi0;
+
+var areaStream = {
+ point: noop$2,
+ lineStart: noop$2,
+ lineEnd: noop$2,
+ polygonStart: function() {
+ areaRingSum.reset();
+ areaStream.lineStart = areaRingStart;
+ areaStream.lineEnd = areaRingEnd;
+ },
+ polygonEnd: function() {
+ var areaRing = +areaRingSum;
+ areaSum.add(areaRing < 0 ? tau$3 + areaRing : areaRing);
+ this.lineStart = this.lineEnd = this.point = noop$2;
+ },
+ sphere: function() {
+ areaSum.add(tau$3);
+ }
+};
+
+function areaRingStart() {
+ areaStream.point = areaPointFirst;
+}
+
+function areaRingEnd() {
+ areaPoint(lambda00, phi00);
+}
+
+function areaPointFirst(lambda, phi) {
+ areaStream.point = areaPoint;
+ lambda00 = lambda, phi00 = phi;
+ lambda *= radians, phi *= radians;
+ lambda0 = lambda, cosPhi0 = cos$1(phi = phi / 2 + quarterPi), sinPhi0 = sin$1(phi);
+}
+
+function areaPoint(lambda, phi) {
+ lambda *= radians, phi *= radians;
+ phi = phi / 2 + quarterPi; // half the angular distance from south pole
+
+ // Spherical excess E for a spherical triangle with vertices: south pole,
+ // previous point, current point. Uses a formula derived from Cagnoli’s
+ // theorem. See Todhunter, Spherical Trig. (1871), Sec. 103, Eq. (2).
+ var dLambda = lambda - lambda0,
+ sdLambda = dLambda >= 0 ? 1 : -1,
+ adLambda = sdLambda * dLambda,
+ cosPhi = cos$1(phi),
+ sinPhi = sin$1(phi),
+ k = sinPhi0 * sinPhi,
+ u = cosPhi0 * cosPhi + k * cos$1(adLambda),
+ v = k * sdLambda * sin$1(adLambda);
+ areaRingSum.add(atan2(v, u));
+
+ // Advance the previous points.
+ lambda0 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi;
+}
+
+function area$1(object) {
+ areaSum.reset();
+ geoStream(object, areaStream);
+ return areaSum * 2;
+}
+
+function spherical(cartesian) {
+ return [atan2(cartesian[1], cartesian[0]), asin(cartesian[2])];
+}
+
+function cartesian(spherical) {
+ var lambda = spherical[0], phi = spherical[1], cosPhi = cos$1(phi);
+ return [cosPhi * cos$1(lambda), cosPhi * sin$1(lambda), sin$1(phi)];
+}
+
+function cartesianDot(a, b) {
+ return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
+}
+
+function cartesianCross(a, b) {
+ return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];
+}
+
+// TODO return a
+function cartesianAddInPlace(a, b) {
+ a[0] += b[0], a[1] += b[1], a[2] += b[2];
+}
+
+function cartesianScale(vector, k) {
+ return [vector[0] * k, vector[1] * k, vector[2] * k];
+}
+
+// TODO return d
+function cartesianNormalizeInPlace(d) {
+ var l = sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);
+ d[0] /= l, d[1] /= l, d[2] /= l;
+}
+
+var lambda0$1, phi0, lambda1, phi1, // bounds
+ lambda2, // previous lambda-coordinate
+ lambda00$1, phi00$1, // first point
+ p0, // previous 3D point
+ deltaSum = adder(),
+ ranges,
+ range;
+
+var boundsStream = {
+ point: boundsPoint,
+ lineStart: boundsLineStart,
+ lineEnd: boundsLineEnd,
+ polygonStart: function() {
+ boundsStream.point = boundsRingPoint;
+ boundsStream.lineStart = boundsRingStart;
+ boundsStream.lineEnd = boundsRingEnd;
+ deltaSum.reset();
+ areaStream.polygonStart();
+ },
+ polygonEnd: function() {
+ areaStream.polygonEnd();
+ boundsStream.point = boundsPoint;
+ boundsStream.lineStart = boundsLineStart;
+ boundsStream.lineEnd = boundsLineEnd;
+ if (areaRingSum < 0) lambda0$1 = -(lambda1 = 180), phi0 = -(phi1 = 90);
+ else if (deltaSum > epsilon$2) phi1 = 90;
+ else if (deltaSum < -epsilon$2) phi0 = -90;
+ range[0] = lambda0$1, range[1] = lambda1;
+ },
+ sphere: function() {
+ lambda0$1 = -(lambda1 = 180), phi0 = -(phi1 = 90);
+ }
+};
+
+function boundsPoint(lambda, phi) {
+ ranges.push(range = [lambda0$1 = lambda, lambda1 = lambda]);
+ if (phi < phi0) phi0 = phi;
+ if (phi > phi1) phi1 = phi;
+}
+
+function linePoint(lambda, phi) {
+ var p = cartesian([lambda * radians, phi * radians]);
+ if (p0) {
+ var normal = cartesianCross(p0, p),
+ equatorial = [normal[1], -normal[0], 0],
+ inflection = cartesianCross(equatorial, normal);
+ cartesianNormalizeInPlace(inflection);
+ inflection = spherical(inflection);
+ var delta = lambda - lambda2,
+ sign$$1 = delta > 0 ? 1 : -1,
+ lambdai = inflection[0] * degrees$1 * sign$$1,
+ phii,
+ antimeridian = abs(delta) > 180;
+ if (antimeridian ^ (sign$$1 * lambda2 < lambdai && lambdai < sign$$1 * lambda)) {
+ phii = inflection[1] * degrees$1;
+ if (phii > phi1) phi1 = phii;
+ } else if (lambdai = (lambdai + 360) % 360 - 180, antimeridian ^ (sign$$1 * lambda2 < lambdai && lambdai < sign$$1 * lambda)) {
+ phii = -inflection[1] * degrees$1;
+ if (phii < phi0) phi0 = phii;
+ } else {
+ if (phi < phi0) phi0 = phi;
+ if (phi > phi1) phi1 = phi;
+ }
+ if (antimeridian) {
+ if (lambda < lambda2) {
+ if (angle(lambda0$1, lambda) > angle(lambda0$1, lambda1)) lambda1 = lambda;
+ } else {
+ if (angle(lambda, lambda1) > angle(lambda0$1, lambda1)) lambda0$1 = lambda;
+ }
+ } else {
+ if (lambda1 >= lambda0$1) {
+ if (lambda < lambda0$1) lambda0$1 = lambda;
+ if (lambda > lambda1) lambda1 = lambda;
+ } else {
+ if (lambda > lambda2) {
+ if (angle(lambda0$1, lambda) > angle(lambda0$1, lambda1)) lambda1 = lambda;
+ } else {
+ if (angle(lambda, lambda1) > angle(lambda0$1, lambda1)) lambda0$1 = lambda;
+ }
+ }
+ }
+ } else {
+ ranges.push(range = [lambda0$1 = lambda, lambda1 = lambda]);
+ }
+ if (phi < phi0) phi0 = phi;
+ if (phi > phi1) phi1 = phi;
+ p0 = p, lambda2 = lambda;
+}
+
+function boundsLineStart() {
+ boundsStream.point = linePoint;
+}
+
+function boundsLineEnd() {
+ range[0] = lambda0$1, range[1] = lambda1;
+ boundsStream.point = boundsPoint;
+ p0 = null;
+}
+
+function boundsRingPoint(lambda, phi) {
+ if (p0) {
+ var delta = lambda - lambda2;
+ deltaSum.add(abs(delta) > 180 ? delta + (delta > 0 ? 360 : -360) : delta);
+ } else {
+ lambda00$1 = lambda, phi00$1 = phi;
+ }
+ areaStream.point(lambda, phi);
+ linePoint(lambda, phi);
+}
+
+function boundsRingStart() {
+ areaStream.lineStart();
+}
+
+function boundsRingEnd() {
+ boundsRingPoint(lambda00$1, phi00$1);
+ areaStream.lineEnd();
+ if (abs(deltaSum) > epsilon$2) lambda0$1 = -(lambda1 = 180);
+ range[0] = lambda0$1, range[1] = lambda1;
+ p0 = null;
+}
+
+// Finds the left-right distance between two longitudes.
+// This is almost the same as (lambda1 - lambda0 + 360°) % 360°, except that we want
+// the distance between ±180° to be 360°.
+function angle(lambda0, lambda1) {
+ return (lambda1 -= lambda0) < 0 ? lambda1 + 360 : lambda1;
+}
+
+function rangeCompare(a, b) {
+ return a[0] - b[0];
+}
+
+function rangeContains(range, x) {
+ return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;
+}
+
+function bounds(feature) {
+ var i, n, a, b, merged, deltaMax, delta;
+
+ phi1 = lambda1 = -(lambda0$1 = phi0 = Infinity);
+ ranges = [];
+ geoStream(feature, boundsStream);
+
+ // First, sort ranges by their minimum longitudes.
+ if (n = ranges.length) {
+ ranges.sort(rangeCompare);
+
+ // Then, merge any ranges that overlap.
+ for (i = 1, a = ranges[0], merged = [a]; i < n; ++i) {
+ b = ranges[i];
+ if (rangeContains(a, b[0]) || rangeContains(a, b[1])) {
+ if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1];
+ if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0];
+ } else {
+ merged.push(a = b);
+ }
+ }
+
+ // Finally, find the largest gap between the merged ranges.
+ // The final bounding box will be the inverse of this gap.
+ for (deltaMax = -Infinity, n = merged.length - 1, i = 0, a = merged[n]; i <= n; a = b, ++i) {
+ b = merged[i];
+ if ((delta = angle(a[1], b[0])) > deltaMax) deltaMax = delta, lambda0$1 = b[0], lambda1 = a[1];
+ }
+ }
+
+ ranges = range = null;
+
+ return lambda0$1 === Infinity || phi0 === Infinity
+ ? [[NaN, NaN], [NaN, NaN]]
+ : [[lambda0$1, phi0], [lambda1, phi1]];
+}
+
+var W0, W1,
+ X0, Y0, Z0,
+ X1, Y1, Z1,
+ X2, Y2, Z2,
+ lambda00$2, phi00$2, // first point
+ x0, y0, z0; // previous point
+
+var centroidStream = {
+ sphere: noop$2,
+ point: centroidPoint,
+ lineStart: centroidLineStart,
+ lineEnd: centroidLineEnd,
+ polygonStart: function() {
+ centroidStream.lineStart = centroidRingStart;
+ centroidStream.lineEnd = centroidRingEnd;
+ },
+ polygonEnd: function() {
+ centroidStream.lineStart = centroidLineStart;
+ centroidStream.lineEnd = centroidLineEnd;
+ }
+};
+
+// Arithmetic mean of Cartesian vectors.
+function centroidPoint(lambda, phi) {
+ lambda *= radians, phi *= radians;
+ var cosPhi = cos$1(phi);
+ centroidPointCartesian(cosPhi * cos$1(lambda), cosPhi * sin$1(lambda), sin$1(phi));
+}
+
+function centroidPointCartesian(x, y, z) {
+ ++W0;
+ X0 += (x - X0) / W0;
+ Y0 += (y - Y0) / W0;
+ Z0 += (z - Z0) / W0;
+}
+
+function centroidLineStart() {
+ centroidStream.point = centroidLinePointFirst;
+}
+
+function centroidLinePointFirst(lambda, phi) {
+ lambda *= radians, phi *= radians;
+ var cosPhi = cos$1(phi);
+ x0 = cosPhi * cos$1(lambda);
+ y0 = cosPhi * sin$1(lambda);
+ z0 = sin$1(phi);
+ centroidStream.point = centroidLinePoint;
+ centroidPointCartesian(x0, y0, z0);
+}
+
+function centroidLinePoint(lambda, phi) {
+ lambda *= radians, phi *= radians;
+ var cosPhi = cos$1(phi),
+ x = cosPhi * cos$1(lambda),
+ y = cosPhi * sin$1(lambda),
+ z = sin$1(phi),
+ w = atan2(sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z);
+ W1 += w;
+ X1 += w * (x0 + (x0 = x));
+ Y1 += w * (y0 + (y0 = y));
+ Z1 += w * (z0 + (z0 = z));
+ centroidPointCartesian(x0, y0, z0);
+}
+
+function centroidLineEnd() {
+ centroidStream.point = centroidPoint;
+}
+
+// See J. E. Brock, The Inertia Tensor for a Spherical Triangle,
+// J. Applied Mechanics 42, 239 (1975).
+function centroidRingStart() {
+ centroidStream.point = centroidRingPointFirst;
+}
+
+function centroidRingEnd() {
+ centroidRingPoint(lambda00$2, phi00$2);
+ centroidStream.point = centroidPoint;
+}
+
+function centroidRingPointFirst(lambda, phi) {
+ lambda00$2 = lambda, phi00$2 = phi;
+ lambda *= radians, phi *= radians;
+ centroidStream.point = centroidRingPoint;
+ var cosPhi = cos$1(phi);
+ x0 = cosPhi * cos$1(lambda);
+ y0 = cosPhi * sin$1(lambda);
+ z0 = sin$1(phi);
+ centroidPointCartesian(x0, y0, z0);
+}
+
+function centroidRingPoint(lambda, phi) {
+ lambda *= radians, phi *= radians;
+ var cosPhi = cos$1(phi),
+ x = cosPhi * cos$1(lambda),
+ y = cosPhi * sin$1(lambda),
+ z = sin$1(phi),
+ cx = y0 * z - z0 * y,
+ cy = z0 * x - x0 * z,
+ cz = x0 * y - y0 * x,
+ m = sqrt(cx * cx + cy * cy + cz * cz),
+ w = asin(m), // line weight = angle
+ v = m && -w / m; // area weight multiplier
+ X2 += v * cx;
+ Y2 += v * cy;
+ Z2 += v * cz;
+ W1 += w;
+ X1 += w * (x0 + (x0 = x));
+ Y1 += w * (y0 + (y0 = y));
+ Z1 += w * (z0 + (z0 = z));
+ centroidPointCartesian(x0, y0, z0);
+}
+
+function centroid(object) {
+ W0 = W1 =
+ X0 = Y0 = Z0 =
+ X1 = Y1 = Z1 =
+ X2 = Y2 = Z2 = 0;
+ geoStream(object, centroidStream);
+
+ var x = X2,
+ y = Y2,
+ z = Z2,
+ m = x * x + y * y + z * z;
+
+ // If the area-weighted ccentroid is undefined, fall back to length-weighted ccentroid.
+ if (m < epsilon2$1) {
+ x = X1, y = Y1, z = Z1;
+ // If the feature has zero length, fall back to arithmetic mean of point vectors.
+ if (W1 < epsilon$2) x = X0, y = Y0, z = Z0;
+ m = x * x + y * y + z * z;
+ // If the feature still has an undefined ccentroid, then return.
+ if (m < epsilon2$1) return [NaN, NaN];
+ }
+
+ return [atan2(y, x) * degrees$1, asin(z / sqrt(m)) * degrees$1];
+}
+
+function constant$8(x) {
+ return function() {
+ return x;
+ };
+}
+
+function compose(a, b) {
+
+ function compose(x, y) {
+ return x = a(x, y), b(x[0], x[1]);
+ }
+
+ if (a.invert && b.invert) compose.invert = function(x, y) {
+ return x = b.invert(x, y), x && a.invert(x[0], x[1]);
+ };
+
+ return compose;
+}
+
+function rotationIdentity(lambda, phi) {
+ return [abs(lambda) > pi$3 ? lambda + Math.round(-lambda / tau$3) * tau$3 : lambda, phi];
+}
+
+rotationIdentity.invert = rotationIdentity;
+
+function rotateRadians(deltaLambda, deltaPhi, deltaGamma) {
+ return (deltaLambda %= tau$3) ? (deltaPhi || deltaGamma ? compose(rotationLambda(deltaLambda), rotationPhiGamma(deltaPhi, deltaGamma))
+ : rotationLambda(deltaLambda))
+ : (deltaPhi || deltaGamma ? rotationPhiGamma(deltaPhi, deltaGamma)
+ : rotationIdentity);
+}
+
+function forwardRotationLambda(deltaLambda) {
+ return function(lambda, phi) {
+ return lambda += deltaLambda, [lambda > pi$3 ? lambda - tau$3 : lambda < -pi$3 ? lambda + tau$3 : lambda, phi];
+ };
+}
+
+function rotationLambda(deltaLambda) {
+ var rotation = forwardRotationLambda(deltaLambda);
+ rotation.invert = forwardRotationLambda(-deltaLambda);
+ return rotation;
+}
+
+function rotationPhiGamma(deltaPhi, deltaGamma) {
+ var cosDeltaPhi = cos$1(deltaPhi),
+ sinDeltaPhi = sin$1(deltaPhi),
+ cosDeltaGamma = cos$1(deltaGamma),
+ sinDeltaGamma = sin$1(deltaGamma);
+
+ function rotation(lambda, phi) {
+ var cosPhi = cos$1(phi),
+ x = cos$1(lambda) * cosPhi,
+ y = sin$1(lambda) * cosPhi,
+ z = sin$1(phi),
+ k = z * cosDeltaPhi + x * sinDeltaPhi;
+ return [
+ atan2(y * cosDeltaGamma - k * sinDeltaGamma, x * cosDeltaPhi - z * sinDeltaPhi),
+ asin(k * cosDeltaGamma + y * sinDeltaGamma)
+ ];
+ }
+
+ rotation.invert = function(lambda, phi) {
+ var cosPhi = cos$1(phi),
+ x = cos$1(lambda) * cosPhi,
+ y = sin$1(lambda) * cosPhi,
+ z = sin$1(phi),
+ k = z * cosDeltaGamma - y * sinDeltaGamma;
+ return [
+ atan2(y * cosDeltaGamma + z * sinDeltaGamma, x * cosDeltaPhi + k * sinDeltaPhi),
+ asin(k * cosDeltaPhi - x * sinDeltaPhi)
+ ];
+ };
+
+ return rotation;
+}
+
+function rotation(rotate) {
+ rotate = rotateRadians(rotate[0] * radians, rotate[1] * radians, rotate.length > 2 ? rotate[2] * radians : 0);
+
+ function forward(coordinates) {
+ coordinates = rotate(coordinates[0] * radians, coordinates[1] * radians);
+ return coordinates[0] *= degrees$1, coordinates[1] *= degrees$1, coordinates;
+ }
+
+ forward.invert = function(coordinates) {
+ coordinates = rotate.invert(coordinates[0] * radians, coordinates[1] * radians);
+ return coordinates[0] *= degrees$1, coordinates[1] *= degrees$1, coordinates;
+ };
+
+ return forward;
+}
+
+// Generates a circle centered at [0°, 0°], with a given radius and precision.
+function circleStream(stream, radius, delta, direction, t0, t1) {
+ if (!delta) return;
+ var cosRadius = cos$1(radius),
+ sinRadius = sin$1(radius),
+ step = direction * delta;
+ if (t0 == null) {
+ t0 = radius + direction * tau$3;
+ t1 = radius - step / 2;
+ } else {
+ t0 = circleRadius(cosRadius, t0);
+ t1 = circleRadius(cosRadius, t1);
+ if (direction > 0 ? t0 < t1 : t0 > t1) t0 += direction * tau$3;
+ }
+ for (var point, t = t0; direction > 0 ? t > t1 : t < t1; t -= step) {
+ point = spherical([cosRadius, -sinRadius * cos$1(t), -sinRadius * sin$1(t)]);
+ stream.point(point[0], point[1]);
+ }
+}
+
+// Returns the signed angle of a cartesian point relative to [cosRadius, 0, 0].
+function circleRadius(cosRadius, point) {
+ point = cartesian(point), point[0] -= cosRadius;
+ cartesianNormalizeInPlace(point);
+ var radius = acos(-point[1]);
+ return ((-point[2] < 0 ? -radius : radius) + tau$3 - epsilon$2) % tau$3;
+}
+
+function circle() {
+ var center = constant$8([0, 0]),
+ radius = constant$8(90),
+ precision = constant$8(6),
+ ring,
+ rotate,
+ stream = {point: point};
+
+ function point(x, y) {
+ ring.push(x = rotate(x, y));
+ x[0] *= degrees$1, x[1] *= degrees$1;
+ }
+
+ function circle() {
+ var c = center.apply(this, arguments),
+ r = radius.apply(this, arguments) * radians,
+ p = precision.apply(this, arguments) * radians;
+ ring = [];
+ rotate = rotateRadians(-c[0] * radians, -c[1] * radians, 0).invert;
+ circleStream(stream, r, p, 1);
+ c = {type: "Polygon", coordinates: [ring]};
+ ring = rotate = null;
+ return c;
+ }
+
+ circle.center = function(_) {
+ return arguments.length ? (center = typeof _ === "function" ? _ : constant$8([+_[0], +_[1]]), circle) : center;
+ };
+
+ circle.radius = function(_) {
+ return arguments.length ? (radius = typeof _ === "function" ? _ : constant$8(+_), circle) : radius;
+ };
+
+ circle.precision = function(_) {
+ return arguments.length ? (precision = typeof _ === "function" ? _ : constant$8(+_), circle) : precision;
+ };
+
+ return circle;
+}
+
+function clipBuffer() {
+ var lines = [],
+ line;
+ return {
+ point: function(x, y) {
+ line.push([x, y]);
+ },
+ lineStart: function() {
+ lines.push(line = []);
+ },
+ lineEnd: noop$2,
+ rejoin: function() {
+ if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));
+ },
+ result: function() {
+ var result = lines;
+ lines = [];
+ line = null;
+ return result;
+ }
+ };
+}
+
+function pointEqual(a, b) {
+ return abs(a[0] - b[0]) < epsilon$2 && abs(a[1] - b[1]) < epsilon$2;
+}
+
+function Intersection(point, points, other, entry) {
+ this.x = point;
+ this.z = points;
+ this.o = other; // another intersection
+ this.e = entry; // is an entry?
+ this.v = false; // visited
+ this.n = this.p = null; // next & previous
+}
+
+// A generalized polygon clipping algorithm: given a polygon that has been cut
+// into its visible line segments, and rejoins the segments by interpolating
+// along the clip edge.
+function clipRejoin(segments, compareIntersection, startInside, interpolate, stream) {
+ var subject = [],
+ clip = [],
+ i,
+ n;
+
+ segments.forEach(function(segment) {
+ if ((n = segment.length - 1) <= 0) return;
+ var n, p0 = segment[0], p1 = segment[n], x;
+
+ // If the first and last points of a segment are coincident, then treat as a
+ // closed ring. TODO if all rings are closed, then the winding order of the
+ // exterior ring should be checked.
+ if (pointEqual(p0, p1)) {
+ stream.lineStart();
+ for (i = 0; i < n; ++i) stream.point((p0 = segment[i])[0], p0[1]);
+ stream.lineEnd();
+ return;
+ }
+
+ subject.push(x = new Intersection(p0, segment, null, true));
+ clip.push(x.o = new Intersection(p0, null, x, false));
+ subject.push(x = new Intersection(p1, segment, null, false));
+ clip.push(x.o = new Intersection(p1, null, x, true));
+ });
+
+ if (!subject.length) return;
+
+ clip.sort(compareIntersection);
+ link$1(subject);
+ link$1(clip);
+
+ for (i = 0, n = clip.length; i < n; ++i) {
+ clip[i].e = startInside = !startInside;
+ }
+
+ var start = subject[0],
+ points,
+ point;
+
+ while (1) {
+ // Find first unvisited intersection.
+ var current = start,
+ isSubject = true;
+ while (current.v) if ((current = current.n) === start) return;
+ points = current.z;
+ stream.lineStart();
+ do {
+ current.v = current.o.v = true;
+ if (current.e) {
+ if (isSubject) {
+ for (i = 0, n = points.length; i < n; ++i) stream.point((point = points[i])[0], point[1]);
+ } else {
+ interpolate(current.x, current.n.x, 1, stream);
+ }
+ current = current.n;
+ } else {
+ if (isSubject) {
+ points = current.p.z;
+ for (i = points.length - 1; i >= 0; --i) stream.point((point = points[i])[0], point[1]);
+ } else {
+ interpolate(current.x, current.p.x, -1, stream);
+ }
+ current = current.p;
+ }
+ current = current.o;
+ points = current.z;
+ isSubject = !isSubject;
+ } while (!current.v);
+ stream.lineEnd();
+ }
+}
+
+function link$1(array) {
+ if (!(n = array.length)) return;
+ var n,
+ i = 0,
+ a = array[0],
+ b;
+ while (++i < n) {
+ a.n = b = array[i];
+ b.p = a;
+ a = b;
+ }
+ a.n = b = array[0];
+ b.p = a;
+}
+
+var sum$1 = adder();
+
+function longitude(point) {
+ if (abs(point[0]) <= pi$3)
+ return point[0];
+ else
+ return sign(point[0]) * ((abs(point[0]) + pi$3) % tau$3 - pi$3);
+}
+
+function polygonContains(polygon, point) {
+ var lambda = longitude(point),
+ phi = point[1],
+ sinPhi = sin$1(phi),
+ normal = [sin$1(lambda), -cos$1(lambda), 0],
+ angle = 0,
+ winding = 0;
+
+ sum$1.reset();
+
+ if (sinPhi === 1) phi = halfPi$2 + epsilon$2;
+ else if (sinPhi === -1) phi = -halfPi$2 - epsilon$2;
+
+ for (var i = 0, n = polygon.length; i < n; ++i) {
+ if (!(m = (ring = polygon[i]).length)) continue;
+ var ring,
+ m,
+ point0 = ring[m - 1],
+ lambda0 = longitude(point0),
+ phi0 = point0[1] / 2 + quarterPi,
+ sinPhi0 = sin$1(phi0),
+ cosPhi0 = cos$1(phi0);
+
+ for (var j = 0; j < m; ++j, lambda0 = lambda1, sinPhi0 = sinPhi1, cosPhi0 = cosPhi1, point0 = point1) {
+ var point1 = ring[j],
+ lambda1 = longitude(point1),
+ phi1 = point1[1] / 2 + quarterPi,
+ sinPhi1 = sin$1(phi1),
+ cosPhi1 = cos$1(phi1),
+ delta = lambda1 - lambda0,
+ sign$$1 = delta >= 0 ? 1 : -1,
+ absDelta = sign$$1 * delta,
+ antimeridian = absDelta > pi$3,
+ k = sinPhi0 * sinPhi1;
+
+ sum$1.add(atan2(k * sign$$1 * sin$1(absDelta), cosPhi0 * cosPhi1 + k * cos$1(absDelta)));
+ angle += antimeridian ? delta + sign$$1 * tau$3 : delta;
+
+ // Are the longitudes either side of the point’s meridian (lambda),
+ // and are the latitudes smaller than the parallel (phi)?
+ if (antimeridian ^ lambda0 >= lambda ^ lambda1 >= lambda) {
+ var arc = cartesianCross(cartesian(point0), cartesian(point1));
+ cartesianNormalizeInPlace(arc);
+ var intersection = cartesianCross(normal, arc);
+ cartesianNormalizeInPlace(intersection);
+ var phiArc = (antimeridian ^ delta >= 0 ? -1 : 1) * asin(intersection[2]);
+ if (phi > phiArc || phi === phiArc && (arc[0] || arc[1])) {
+ winding += antimeridian ^ delta >= 0 ? 1 : -1;
+ }
+ }
+ }
+ }
+
+ // First, determine whether the South pole is inside or outside:
+ //
+ // It is inside if:
+ // * the polygon winds around it in a clockwise direction.
+ // * the polygon does not (cumulatively) wind around it, but has a negative
+ // (counter-clockwise) area.
+ //
+ // Second, count the (signed) number of times a segment crosses a lambda
+ // from the point to the South pole. If it is zero, then the point is the
+ // same side as the South pole.
+
+ return (angle < -epsilon$2 || angle < epsilon$2 && sum$1 < -epsilon$2) ^ (winding & 1);
+}
+
+function clip(pointVisible, clipLine, interpolate, start) {
+ return function(sink) {
+ var line = clipLine(sink),
+ ringBuffer = clipBuffer(),
+ ringSink = clipLine(ringBuffer),
+ polygonStarted = false,
+ polygon,
+ segments,
+ ring;
+
+ var clip = {
+ point: point,
+ lineStart: lineStart,
+ lineEnd: lineEnd,
+ polygonStart: function() {
+ clip.point = pointRing;
+ clip.lineStart = ringStart;
+ clip.lineEnd = ringEnd;
+ segments = [];
+ polygon = [];
+ },
+ polygonEnd: function() {
+ clip.point = point;
+ clip.lineStart = lineStart;
+ clip.lineEnd = lineEnd;
+ segments = merge(segments);
+ var startInside = polygonContains(polygon, start);
+ if (segments.length) {
+ if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
+ clipRejoin(segments, compareIntersection, startInside, interpolate, sink);
+ } else if (startInside) {
+ if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
+ sink.lineStart();
+ interpolate(null, null, 1, sink);
+ sink.lineEnd();
+ }
+ if (polygonStarted) sink.polygonEnd(), polygonStarted = false;
+ segments = polygon = null;
+ },
+ sphere: function() {
+ sink.polygonStart();
+ sink.lineStart();
+ interpolate(null, null, 1, sink);
+ sink.lineEnd();
+ sink.polygonEnd();
+ }
+ };
+
+ function point(lambda, phi) {
+ if (pointVisible(lambda, phi)) sink.point(lambda, phi);
+ }
+
+ function pointLine(lambda, phi) {
+ line.point(lambda, phi);
+ }
+
+ function lineStart() {
+ clip.point = pointLine;
+ line.lineStart();
+ }
+
+ function lineEnd() {
+ clip.point = point;
+ line.lineEnd();
+ }
+
+ function pointRing(lambda, phi) {
+ ring.push([lambda, phi]);
+ ringSink.point(lambda, phi);
+ }
+
+ function ringStart() {
+ ringSink.lineStart();
+ ring = [];
+ }
+
+ function ringEnd() {
+ pointRing(ring[0][0], ring[0][1]);
+ ringSink.lineEnd();
+
+ var clean = ringSink.clean(),
+ ringSegments = ringBuffer.result(),
+ i, n = ringSegments.length, m,
+ segment,
+ point;
+
+ ring.pop();
+ polygon.push(ring);
+ ring = null;
+
+ if (!n) return;
+
+ // No intersections.
+ if (clean & 1) {
+ segment = ringSegments[0];
+ if ((m = segment.length - 1) > 0) {
+ if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
+ sink.lineStart();
+ for (i = 0; i < m; ++i) sink.point((point = segment[i])[0], point[1]);
+ sink.lineEnd();
+ }
+ return;
+ }
+
+ // Rejoin connected segments.
+ // TODO reuse ringBuffer.rejoin()?
+ if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));
+
+ segments.push(ringSegments.filter(validSegment));
+ }
+
+ return clip;
+ };
+}
+
+function validSegment(segment) {
+ return segment.length > 1;
+}
+
+// Intersections are sorted along the clip edge. For both antimeridian cutting
+// and circle clipping, the same comparison is used.
+function compareIntersection(a, b) {
+ return ((a = a.x)[0] < 0 ? a[1] - halfPi$2 - epsilon$2 : halfPi$2 - a[1])
+ - ((b = b.x)[0] < 0 ? b[1] - halfPi$2 - epsilon$2 : halfPi$2 - b[1]);
+}
+
+var clipAntimeridian = clip(
+ function() { return true; },
+ clipAntimeridianLine,
+ clipAntimeridianInterpolate,
+ [-pi$3, -halfPi$2]
+);
+
+// Takes a line and cuts into visible segments. Return values: 0 - there were
+// intersections or the line was empty; 1 - no intersections; 2 - there were
+// intersections, and the first and last segments should be rejoined.
+function clipAntimeridianLine(stream) {
+ var lambda0 = NaN,
+ phi0 = NaN,
+ sign0 = NaN,
+ clean; // no intersections
+
+ return {
+ lineStart: function() {
+ stream.lineStart();
+ clean = 1;
+ },
+ point: function(lambda1, phi1) {
+ var sign1 = lambda1 > 0 ? pi$3 : -pi$3,
+ delta = abs(lambda1 - lambda0);
+ if (abs(delta - pi$3) < epsilon$2) { // line crosses a pole
+ stream.point(lambda0, phi0 = (phi0 + phi1) / 2 > 0 ? halfPi$2 : -halfPi$2);
+ stream.point(sign0, phi0);
+ stream.lineEnd();
+ stream.lineStart();
+ stream.point(sign1, phi0);
+ stream.point(lambda1, phi0);
+ clean = 0;
+ } else if (sign0 !== sign1 && delta >= pi$3) { // line crosses antimeridian
+ if (abs(lambda0 - sign0) < epsilon$2) lambda0 -= sign0 * epsilon$2; // handle degeneracies
+ if (abs(lambda1 - sign1) < epsilon$2) lambda1 -= sign1 * epsilon$2;
+ phi0 = clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1);
+ stream.point(sign0, phi0);
+ stream.lineEnd();
+ stream.lineStart();
+ stream.point(sign1, phi0);
+ clean = 0;
+ }
+ stream.point(lambda0 = lambda1, phi0 = phi1);
+ sign0 = sign1;
+ },
+ lineEnd: function() {
+ stream.lineEnd();
+ lambda0 = phi0 = NaN;
+ },
+ clean: function() {
+ return 2 - clean; // if intersections, rejoin first and last segments
+ }
+ };
+}
+
+function clipAntimeridianIntersect(lambda0, phi0, lambda1, phi1) {
+ var cosPhi0,
+ cosPhi1,
+ sinLambda0Lambda1 = sin$1(lambda0 - lambda1);
+ return abs(sinLambda0Lambda1) > epsilon$2
+ ? atan((sin$1(phi0) * (cosPhi1 = cos$1(phi1)) * sin$1(lambda1)
+ - sin$1(phi1) * (cosPhi0 = cos$1(phi0)) * sin$1(lambda0))
+ / (cosPhi0 * cosPhi1 * sinLambda0Lambda1))
+ : (phi0 + phi1) / 2;
+}
+
+function clipAntimeridianInterpolate(from, to, direction, stream) {
+ var phi;
+ if (from == null) {
+ phi = direction * halfPi$2;
+ stream.point(-pi$3, phi);
+ stream.point(0, phi);
+ stream.point(pi$3, phi);
+ stream.point(pi$3, 0);
+ stream.point(pi$3, -phi);
+ stream.point(0, -phi);
+ stream.point(-pi$3, -phi);
+ stream.point(-pi$3, 0);
+ stream.point(-pi$3, phi);
+ } else if (abs(from[0] - to[0]) > epsilon$2) {
+ var lambda = from[0] < to[0] ? pi$3 : -pi$3;
+ phi = direction * lambda / 2;
+ stream.point(-lambda, phi);
+ stream.point(0, phi);
+ stream.point(lambda, phi);
+ } else {
+ stream.point(to[0], to[1]);
+ }
+}
+
+function clipCircle(radius) {
+ var cr = cos$1(radius),
+ delta = 6 * radians,
+ smallRadius = cr > 0,
+ notHemisphere = abs(cr) > epsilon$2; // TODO optimise for this common case
+
+ function interpolate(from, to, direction, stream) {
+ circleStream(stream, radius, delta, direction, from, to);
+ }
+
+ function visible(lambda, phi) {
+ return cos$1(lambda) * cos$1(phi) > cr;
+ }
+
+ // Takes a line and cuts into visible segments. Return values used for polygon
+ // clipping: 0 - there were intersections or the line was empty; 1 - no
+ // intersections 2 - there were intersections, and the first and last segments
+ // should be rejoined.
+ function clipLine(stream) {
+ var point0, // previous point
+ c0, // code for previous point
+ v0, // visibility of previous point
+ v00, // visibility of first point
+ clean; // no intersections
+ return {
+ lineStart: function() {
+ v00 = v0 = false;
+ clean = 1;
+ },
+ point: function(lambda, phi) {
+ var point1 = [lambda, phi],
+ point2,
+ v = visible(lambda, phi),
+ c = smallRadius
+ ? v ? 0 : code(lambda, phi)
+ : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;
+ if (!point0 && (v00 = v0 = v)) stream.lineStart();
+ // Handle degeneracies.
+ // TODO ignore if not clipping polygons.
+ if (v !== v0) {
+ point2 = intersect(point0, point1);
+ if (!point2 || pointEqual(point0, point2) || pointEqual(point1, point2)) {
+ point1[0] += epsilon$2;
+ point1[1] += epsilon$2;
+ v = visible(point1[0], point1[1]);
+ }
+ }
+ if (v !== v0) {
+ clean = 0;
+ if (v) {
+ // outside going in
+ stream.lineStart();
+ point2 = intersect(point1, point0);
+ stream.point(point2[0], point2[1]);
+ } else {
+ // inside going out
+ point2 = intersect(point0, point1);
+ stream.point(point2[0], point2[1]);
+ stream.lineEnd();
+ }
+ point0 = point2;
+ } else if (notHemisphere && point0 && smallRadius ^ v) {
+ var t;
+ // If the codes for two points are different, or are both zero,
+ // and there this segment intersects with the small circle.
+ if (!(c & c0) && (t = intersect(point1, point0, true))) {
+ clean = 0;
+ if (smallRadius) {
+ stream.lineStart();
+ stream.point(t[0][0], t[0][1]);
+ stream.point(t[1][0], t[1][1]);
+ stream.lineEnd();
+ } else {
+ stream.point(t[1][0], t[1][1]);
+ stream.lineEnd();
+ stream.lineStart();
+ stream.point(t[0][0], t[0][1]);
+ }
+ }
+ }
+ if (v && (!point0 || !pointEqual(point0, point1))) {
+ stream.point(point1[0], point1[1]);
+ }
+ point0 = point1, v0 = v, c0 = c;
+ },
+ lineEnd: function() {
+ if (v0) stream.lineEnd();
+ point0 = null;
+ },
+ // Rejoin first and last segments if there were intersections and the first
+ // and last points were visible.
+ clean: function() {
+ return clean | ((v00 && v0) << 1);
+ }
+ };
+ }
+
+ // Intersects the great circle between a and b with the clip circle.
+ function intersect(a, b, two) {
+ var pa = cartesian(a),
+ pb = cartesian(b);
+
+ // We have two planes, n1.p = d1 and n2.p = d2.
+ // Find intersection line p(t) = c1 n1 + c2 n2 + t (n1 ⨯ n2).
+ var n1 = [1, 0, 0], // normal
+ n2 = cartesianCross(pa, pb),
+ n2n2 = cartesianDot(n2, n2),
+ n1n2 = n2[0], // cartesianDot(n1, n2),
+ determinant = n2n2 - n1n2 * n1n2;
+
+ // Two polar points.
+ if (!determinant) return !two && a;
+
+ var c1 = cr * n2n2 / determinant,
+ c2 = -cr * n1n2 / determinant,
+ n1xn2 = cartesianCross(n1, n2),
+ A = cartesianScale(n1, c1),
+ B = cartesianScale(n2, c2);
+ cartesianAddInPlace(A, B);
+
+ // Solve |p(t)|^2 = 1.
+ var u = n1xn2,
+ w = cartesianDot(A, u),
+ uu = cartesianDot(u, u),
+ t2 = w * w - uu * (cartesianDot(A, A) - 1);
+
+ if (t2 < 0) return;
+
+ var t = sqrt(t2),
+ q = cartesianScale(u, (-w - t) / uu);
+ cartesianAddInPlace(q, A);
+ q = spherical(q);
+
+ if (!two) return q;
+
+ // Two intersection points.
+ var lambda0 = a[0],
+ lambda1 = b[0],
+ phi0 = a[1],
+ phi1 = b[1],
+ z;
+
+ if (lambda1 < lambda0) z = lambda0, lambda0 = lambda1, lambda1 = z;
+
+ var delta = lambda1 - lambda0,
+ polar = abs(delta - pi$3) < epsilon$2,
+ meridian = polar || delta < epsilon$2;
+
+ if (!polar && phi1 < phi0) z = phi0, phi0 = phi1, phi1 = z;
+
+ // Check that the first point is between a and b.
+ if (meridian
+ ? polar
+ ? phi0 + phi1 > 0 ^ q[1] < (abs(q[0] - lambda0) < epsilon$2 ? phi0 : phi1)
+ : phi0 <= q[1] && q[1] <= phi1
+ : delta > pi$3 ^ (lambda0 <= q[0] && q[0] <= lambda1)) {
+ var q1 = cartesianScale(u, (-w + t) / uu);
+ cartesianAddInPlace(q1, A);
+ return [q, spherical(q1)];
+ }
+ }
+
+ // Generates a 4-bit vector representing the location of a point relative to
+ // the small circle's bounding box.
+ function code(lambda, phi) {
+ var r = smallRadius ? radius : pi$3 - radius,
+ code = 0;
+ if (lambda < -r) code |= 1; // left
+ else if (lambda > r) code |= 2; // right
+ if (phi < -r) code |= 4; // below
+ else if (phi > r) code |= 8; // above
+ return code;
+ }
+
+ return clip(visible, clipLine, interpolate, smallRadius ? [0, -radius] : [-pi$3, radius - pi$3]);
+}
+
+function clipLine(a, b, x0, y0, x1, y1) {
+ var ax = a[0],
+ ay = a[1],
+ bx = b[0],
+ by = b[1],
+ t0 = 0,
+ t1 = 1,
+ dx = bx - ax,
+ dy = by - ay,
+ r;
+
+ r = x0 - ax;
+ if (!dx && r > 0) return;
+ r /= dx;
+ if (dx < 0) {
+ if (r < t0) return;
+ if (r < t1) t1 = r;
+ } else if (dx > 0) {
+ if (r > t1) return;
+ if (r > t0) t0 = r;
+ }
+
+ r = x1 - ax;
+ if (!dx && r < 0) return;
+ r /= dx;
+ if (dx < 0) {
+ if (r > t1) return;
+ if (r > t0) t0 = r;
+ } else if (dx > 0) {
+ if (r < t0) return;
+ if (r < t1) t1 = r;
+ }
+
+ r = y0 - ay;
+ if (!dy && r > 0) return;
+ r /= dy;
+ if (dy < 0) {
+ if (r < t0) return;
+ if (r < t1) t1 = r;
+ } else if (dy > 0) {
+ if (r > t1) return;
+ if (r > t0) t0 = r;
+ }
+
+ r = y1 - ay;
+ if (!dy && r < 0) return;
+ r /= dy;
+ if (dy < 0) {
+ if (r > t1) return;
+ if (r > t0) t0 = r;
+ } else if (dy > 0) {
+ if (r < t0) return;
+ if (r < t1) t1 = r;
+ }
+
+ if (t0 > 0) a[0] = ax + t0 * dx, a[1] = ay + t0 * dy;
+ if (t1 < 1) b[0] = ax + t1 * dx, b[1] = ay + t1 * dy;
+ return true;
+}
+
+var clipMax = 1e9, clipMin = -clipMax;
+
+// TODO Use d3-polygon’s polygonContains here for the ring check?
+// TODO Eliminate duplicate buffering in clipBuffer and polygon.push?
+
+function clipRectangle(x0, y0, x1, y1) {
+
+ function visible(x, y) {
+ return x0 <= x && x <= x1 && y0 <= y && y <= y1;
+ }
+
+ function interpolate(from, to, direction, stream) {
+ var a = 0, a1 = 0;
+ if (from == null
+ || (a = corner(from, direction)) !== (a1 = corner(to, direction))
+ || comparePoint(from, to) < 0 ^ direction > 0) {
+ do stream.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0);
+ while ((a = (a + direction + 4) % 4) !== a1);
+ } else {
+ stream.point(to[0], to[1]);
+ }
+ }
+
+ function corner(p, direction) {
+ return abs(p[0] - x0) < epsilon$2 ? direction > 0 ? 0 : 3
+ : abs(p[0] - x1) < epsilon$2 ? direction > 0 ? 2 : 1
+ : abs(p[1] - y0) < epsilon$2 ? direction > 0 ? 1 : 0
+ : direction > 0 ? 3 : 2; // abs(p[1] - y1) < epsilon
+ }
+
+ function compareIntersection(a, b) {
+ return comparePoint(a.x, b.x);
+ }
+
+ function comparePoint(a, b) {
+ var ca = corner(a, 1),
+ cb = corner(b, 1);
+ return ca !== cb ? ca - cb
+ : ca === 0 ? b[1] - a[1]
+ : ca === 1 ? a[0] - b[0]
+ : ca === 2 ? a[1] - b[1]
+ : b[0] - a[0];
+ }
+
+ return function(stream) {
+ var activeStream = stream,
+ bufferStream = clipBuffer(),
+ segments,
+ polygon,
+ ring,
+ x__, y__, v__, // first point
+ x_, y_, v_, // previous point
+ first,
+ clean;
+
+ var clipStream = {
+ point: point,
+ lineStart: lineStart,
+ lineEnd: lineEnd,
+ polygonStart: polygonStart,
+ polygonEnd: polygonEnd
+ };
+
+ function point(x, y) {
+ if (visible(x, y)) activeStream.point(x, y);
+ }
+
+ function polygonInside() {
+ var winding = 0;
+
+ for (var i = 0, n = polygon.length; i < n; ++i) {
+ for (var ring = polygon[i], j = 1, m = ring.length, point = ring[0], a0, a1, b0 = point[0], b1 = point[1]; j < m; ++j) {
+ a0 = b0, a1 = b1, point = ring[j], b0 = point[0], b1 = point[1];
+ if (a1 <= y1) { if (b1 > y1 && (b0 - a0) * (y1 - a1) > (b1 - a1) * (x0 - a0)) ++winding; }
+ else { if (b1 <= y1 && (b0 - a0) * (y1 - a1) < (b1 - a1) * (x0 - a0)) --winding; }
+ }
+ }
+
+ return winding;
+ }
+
+ // Buffer geometry within a polygon and then clip it en masse.
+ function polygonStart() {
+ activeStream = bufferStream, segments = [], polygon = [], clean = true;
+ }
+
+ function polygonEnd() {
+ var startInside = polygonInside(),
+ cleanInside = clean && startInside,
+ visible = (segments = merge(segments)).length;
+ if (cleanInside || visible) {
+ stream.polygonStart();
+ if (cleanInside) {
+ stream.lineStart();
+ interpolate(null, null, 1, stream);
+ stream.lineEnd();
+ }
+ if (visible) {
+ clipRejoin(segments, compareIntersection, startInside, interpolate, stream);
+ }
+ stream.polygonEnd();
+ }
+ activeStream = stream, segments = polygon = ring = null;
+ }
+
+ function lineStart() {
+ clipStream.point = linePoint;
+ if (polygon) polygon.push(ring = []);
+ first = true;
+ v_ = false;
+ x_ = y_ = NaN;
+ }
+
+ // TODO rather than special-case polygons, simply handle them separately.
+ // Ideally, coincident intersection points should be jittered to avoid
+ // clipping issues.
+ function lineEnd() {
+ if (segments) {
+ linePoint(x__, y__);
+ if (v__ && v_) bufferStream.rejoin();
+ segments.push(bufferStream.result());
+ }
+ clipStream.point = point;
+ if (v_) activeStream.lineEnd();
+ }
+
+ function linePoint(x, y) {
+ var v = visible(x, y);
+ if (polygon) ring.push([x, y]);
+ if (first) {
+ x__ = x, y__ = y, v__ = v;
+ first = false;
+ if (v) {
+ activeStream.lineStart();
+ activeStream.point(x, y);
+ }
+ } else {
+ if (v && v_) activeStream.point(x, y);
+ else {
+ var a = [x_ = Math.max(clipMin, Math.min(clipMax, x_)), y_ = Math.max(clipMin, Math.min(clipMax, y_))],
+ b = [x = Math.max(clipMin, Math.min(clipMax, x)), y = Math.max(clipMin, Math.min(clipMax, y))];
+ if (clipLine(a, b, x0, y0, x1, y1)) {
+ if (!v_) {
+ activeStream.lineStart();
+ activeStream.point(a[0], a[1]);
+ }
+ activeStream.point(b[0], b[1]);
+ if (!v) activeStream.lineEnd();
+ clean = false;
+ } else if (v) {
+ activeStream.lineStart();
+ activeStream.point(x, y);
+ clean = false;
+ }
+ }
+ }
+ x_ = x, y_ = y, v_ = v;
+ }
+
+ return clipStream;
+ };
+}
+
+function extent$1() {
+ var x0 = 0,
+ y0 = 0,
+ x1 = 960,
+ y1 = 500,
+ cache,
+ cacheStream,
+ clip;
+
+ return clip = {
+ stream: function(stream) {
+ return cache && cacheStream === stream ? cache : cache = clipRectangle(x0, y0, x1, y1)(cacheStream = stream);
+ },
+ extent: function(_) {
+ return arguments.length ? (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1], cache = cacheStream = null, clip) : [[x0, y0], [x1, y1]];
+ }
+ };
+}
+
+var lengthSum = adder(),
+ lambda0$2,
+ sinPhi0$1,
+ cosPhi0$1;
+
+var lengthStream = {
+ sphere: noop$2,
+ point: noop$2,
+ lineStart: lengthLineStart,
+ lineEnd: noop$2,
+ polygonStart: noop$2,
+ polygonEnd: noop$2
+};
+
+function lengthLineStart() {
+ lengthStream.point = lengthPointFirst;
+ lengthStream.lineEnd = lengthLineEnd;
+}
+
+function lengthLineEnd() {
+ lengthStream.point = lengthStream.lineEnd = noop$2;
+}
+
+function lengthPointFirst(lambda, phi) {
+ lambda *= radians, phi *= radians;
+ lambda0$2 = lambda, sinPhi0$1 = sin$1(phi), cosPhi0$1 = cos$1(phi);
+ lengthStream.point = lengthPoint;
+}
+
+function lengthPoint(lambda, phi) {
+ lambda *= radians, phi *= radians;
+ var sinPhi = sin$1(phi),
+ cosPhi = cos$1(phi),
+ delta = abs(lambda - lambda0$2),
+ cosDelta = cos$1(delta),
+ sinDelta = sin$1(delta),
+ x = cosPhi * sinDelta,
+ y = cosPhi0$1 * sinPhi - sinPhi0$1 * cosPhi * cosDelta,
+ z = sinPhi0$1 * sinPhi + cosPhi0$1 * cosPhi * cosDelta;
+ lengthSum.add(atan2(sqrt(x * x + y * y), z));
+ lambda0$2 = lambda, sinPhi0$1 = sinPhi, cosPhi0$1 = cosPhi;
+}
+
+function length$1(object) {
+ lengthSum.reset();
+ geoStream(object, lengthStream);
+ return +lengthSum;
+}
+
+var coordinates = [null, null],
+ object$1 = {type: "LineString", coordinates: coordinates};
+
+function distance(a, b) {
+ coordinates[0] = a;
+ coordinates[1] = b;
+ return length$1(object$1);
+}
+
+var containsObjectType = {
+ Feature: function(object, point) {
+ return containsGeometry(object.geometry, point);
+ },
+ FeatureCollection: function(object, point) {
+ var features = object.features, i = -1, n = features.length;
+ while (++i < n) if (containsGeometry(features[i].geometry, point)) return true;
+ return false;
+ }
+};
+
+var containsGeometryType = {
+ Sphere: function() {
+ return true;
+ },
+ Point: function(object, point) {
+ return containsPoint(object.coordinates, point);
+ },
+ MultiPoint: function(object, point) {
+ var coordinates = object.coordinates, i = -1, n = coordinates.length;
+ while (++i < n) if (containsPoint(coordinates[i], point)) return true;
+ return false;
+ },
+ LineString: function(object, point) {
+ return containsLine(object.coordinates, point);
+ },
+ MultiLineString: function(object, point) {
+ var coordinates = object.coordinates, i = -1, n = coordinates.length;
+ while (++i < n) if (containsLine(coordinates[i], point)) return true;
+ return false;
+ },
+ Polygon: function(object, point) {
+ return containsPolygon(object.coordinates, point);
+ },
+ MultiPolygon: function(object, point) {
+ var coordinates = object.coordinates, i = -1, n = coordinates.length;
+ while (++i < n) if (containsPolygon(coordinates[i], point)) return true;
+ return false;
+ },
+ GeometryCollection: function(object, point) {
+ var geometries = object.geometries, i = -1, n = geometries.length;
+ while (++i < n) if (containsGeometry(geometries[i], point)) return true;
+ return false;
+ }
+};
+
+function containsGeometry(geometry, point) {
+ return geometry && containsGeometryType.hasOwnProperty(geometry.type)
+ ? containsGeometryType[geometry.type](geometry, point)
+ : false;
+}
+
+function containsPoint(coordinates, point) {
+ return distance(coordinates, point) === 0;
+}
+
+function containsLine(coordinates, point) {
+ var ao, bo, ab;
+ for (var i = 0, n = coordinates.length; i < n; i++) {
+ bo = distance(coordinates[i], point);
+ if (bo === 0) return true;
+ if (i > 0) {
+ ab = distance(coordinates[i], coordinates[i - 1]);
+ if (
+ ab > 0 &&
+ ao <= ab &&
+ bo <= ab &&
+ (ao + bo - ab) * (1 - Math.pow((ao - bo) / ab, 2)) < epsilon2$1 * ab
+ )
+ return true;
+ }
+ ao = bo;
+ }
+ return false;
+}
+
+function containsPolygon(coordinates, point) {
+ return !!polygonContains(coordinates.map(ringRadians), pointRadians(point));
+}
+
+function ringRadians(ring) {
+ return ring = ring.map(pointRadians), ring.pop(), ring;
+}
+
+function pointRadians(point) {
+ return [point[0] * radians, point[1] * radians];
+}
+
+function contains$1(object, point) {
+ return (object && containsObjectType.hasOwnProperty(object.type)
+ ? containsObjectType[object.type]
+ : containsGeometry)(object, point);
+}
+
+function graticuleX(y0, y1, dy) {
+ var y = sequence(y0, y1 - epsilon$2, dy).concat(y1);
+ return function(x) { return y.map(function(y) { return [x, y]; }); };
+}
+
+function graticuleY(x0, x1, dx) {
+ var x = sequence(x0, x1 - epsilon$2, dx).concat(x1);
+ return function(y) { return x.map(function(x) { return [x, y]; }); };
+}
+
+function graticule() {
+ var x1, x0, X1, X0,
+ y1, y0, Y1, Y0,
+ dx = 10, dy = dx, DX = 90, DY = 360,
+ x, y, X, Y,
+ precision = 2.5;
+
+ function graticule() {
+ return {type: "MultiLineString", coordinates: lines()};
+ }
+
+ function lines() {
+ return sequence(ceil(X0 / DX) * DX, X1, DX).map(X)
+ .concat(sequence(ceil(Y0 / DY) * DY, Y1, DY).map(Y))
+ .concat(sequence(ceil(x0 / dx) * dx, x1, dx).filter(function(x) { return abs(x % DX) > epsilon$2; }).map(x))
+ .concat(sequence(ceil(y0 / dy) * dy, y1, dy).filter(function(y) { return abs(y % DY) > epsilon$2; }).map(y));
+ }
+
+ graticule.lines = function() {
+ return lines().map(function(coordinates) { return {type: "LineString", coordinates: coordinates}; });
+ };
+
+ graticule.outline = function() {
+ return {
+ type: "Polygon",
+ coordinates: [
+ X(X0).concat(
+ Y(Y1).slice(1),
+ X(X1).reverse().slice(1),
+ Y(Y0).reverse().slice(1))
+ ]
+ };
+ };
+
+ graticule.extent = function(_) {
+ if (!arguments.length) return graticule.extentMinor();
+ return graticule.extentMajor(_).extentMinor(_);
+ };
+
+ graticule.extentMajor = function(_) {
+ if (!arguments.length) return [[X0, Y0], [X1, Y1]];
+ X0 = +_[0][0], X1 = +_[1][0];
+ Y0 = +_[0][1], Y1 = +_[1][1];
+ if (X0 > X1) _ = X0, X0 = X1, X1 = _;
+ if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _;
+ return graticule.precision(precision);
+ };
+
+ graticule.extentMinor = function(_) {
+ if (!arguments.length) return [[x0, y0], [x1, y1]];
+ x0 = +_[0][0], x1 = +_[1][0];
+ y0 = +_[0][1], y1 = +_[1][1];
+ if (x0 > x1) _ = x0, x0 = x1, x1 = _;
+ if (y0 > y1) _ = y0, y0 = y1, y1 = _;
+ return graticule.precision(precision);
+ };
+
+ graticule.step = function(_) {
+ if (!arguments.length) return graticule.stepMinor();
+ return graticule.stepMajor(_).stepMinor(_);
+ };
+
+ graticule.stepMajor = function(_) {
+ if (!arguments.length) return [DX, DY];
+ DX = +_[0], DY = +_[1];
+ return graticule;
+ };
+
+ graticule.stepMinor = function(_) {
+ if (!arguments.length) return [dx, dy];
+ dx = +_[0], dy = +_[1];
+ return graticule;
+ };
+
+ graticule.precision = function(_) {
+ if (!arguments.length) return precision;
+ precision = +_;
+ x = graticuleX(y0, y1, 90);
+ y = graticuleY(x0, x1, precision);
+ X = graticuleX(Y0, Y1, 90);
+ Y = graticuleY(X0, X1, precision);
+ return graticule;
+ };
+
+ return graticule
+ .extentMajor([[-180, -90 + epsilon$2], [180, 90 - epsilon$2]])
+ .extentMinor([[-180, -80 - epsilon$2], [180, 80 + epsilon$2]]);
+}
+
+function graticule10() {
+ return graticule()();
+}
+
+function interpolate$1(a, b) {
+ var x0 = a[0] * radians,
+ y0 = a[1] * radians,
+ x1 = b[0] * radians,
+ y1 = b[1] * radians,
+ cy0 = cos$1(y0),
+ sy0 = sin$1(y0),
+ cy1 = cos$1(y1),
+ sy1 = sin$1(y1),
+ kx0 = cy0 * cos$1(x0),
+ ky0 = cy0 * sin$1(x0),
+ kx1 = cy1 * cos$1(x1),
+ ky1 = cy1 * sin$1(x1),
+ d = 2 * asin(sqrt(haversin(y1 - y0) + cy0 * cy1 * haversin(x1 - x0))),
+ k = sin$1(d);
+
+ var interpolate = d ? function(t) {
+ var B = sin$1(t *= d) / k,
+ A = sin$1(d - t) / k,
+ x = A * kx0 + B * kx1,
+ y = A * ky0 + B * ky1,
+ z = A * sy0 + B * sy1;
+ return [
+ atan2(y, x) * degrees$1,
+ atan2(z, sqrt(x * x + y * y)) * degrees$1
+ ];
+ } : function() {
+ return [x0 * degrees$1, y0 * degrees$1];
+ };
+
+ interpolate.distance = d;
+
+ return interpolate;
+}
+
+function identity$4(x) {
+ return x;
+}
+
+var areaSum$1 = adder(),
+ areaRingSum$1 = adder(),
+ x00,
+ y00,
+ x0$1,
+ y0$1;
+
+var areaStream$1 = {
+ point: noop$2,
+ lineStart: noop$2,
+ lineEnd: noop$2,
+ polygonStart: function() {
+ areaStream$1.lineStart = areaRingStart$1;
+ areaStream$1.lineEnd = areaRingEnd$1;
+ },
+ polygonEnd: function() {
+ areaStream$1.lineStart = areaStream$1.lineEnd = areaStream$1.point = noop$2;
+ areaSum$1.add(abs(areaRingSum$1));
+ areaRingSum$1.reset();
+ },
+ result: function() {
+ var area = areaSum$1 / 2;
+ areaSum$1.reset();
+ return area;
+ }
+};
+
+function areaRingStart$1() {
+ areaStream$1.point = areaPointFirst$1;
+}
+
+function areaPointFirst$1(x, y) {
+ areaStream$1.point = areaPoint$1;
+ x00 = x0$1 = x, y00 = y0$1 = y;
+}
+
+function areaPoint$1(x, y) {
+ areaRingSum$1.add(y0$1 * x - x0$1 * y);
+ x0$1 = x, y0$1 = y;
+}
+
+function areaRingEnd$1() {
+ areaPoint$1(x00, y00);
+}
+
+var x0$2 = Infinity,
+ y0$2 = x0$2,
+ x1 = -x0$2,
+ y1 = x1;
+
+var boundsStream$1 = {
+ point: boundsPoint$1,
+ lineStart: noop$2,
+ lineEnd: noop$2,
+ polygonStart: noop$2,
+ polygonEnd: noop$2,
+ result: function() {
+ var bounds = [[x0$2, y0$2], [x1, y1]];
+ x1 = y1 = -(y0$2 = x0$2 = Infinity);
+ return bounds;
+ }
+};
+
+function boundsPoint$1(x, y) {
+ if (x < x0$2) x0$2 = x;
+ if (x > x1) x1 = x;
+ if (y < y0$2) y0$2 = y;
+ if (y > y1) y1 = y;
+}
+
+// TODO Enforce positive area for exterior, negative area for interior?
+
+var X0$1 = 0,
+ Y0$1 = 0,
+ Z0$1 = 0,
+ X1$1 = 0,
+ Y1$1 = 0,
+ Z1$1 = 0,
+ X2$1 = 0,
+ Y2$1 = 0,
+ Z2$1 = 0,
+ x00$1,
+ y00$1,
+ x0$3,
+ y0$3;
+
+var centroidStream$1 = {
+ point: centroidPoint$1,
+ lineStart: centroidLineStart$1,
+ lineEnd: centroidLineEnd$1,
+ polygonStart: function() {
+ centroidStream$1.lineStart = centroidRingStart$1;
+ centroidStream$1.lineEnd = centroidRingEnd$1;
+ },
+ polygonEnd: function() {
+ centroidStream$1.point = centroidPoint$1;
+ centroidStream$1.lineStart = centroidLineStart$1;
+ centroidStream$1.lineEnd = centroidLineEnd$1;
+ },
+ result: function() {
+ var centroid = Z2$1 ? [X2$1 / Z2$1, Y2$1 / Z2$1]
+ : Z1$1 ? [X1$1 / Z1$1, Y1$1 / Z1$1]
+ : Z0$1 ? [X0$1 / Z0$1, Y0$1 / Z0$1]
+ : [NaN, NaN];
+ X0$1 = Y0$1 = Z0$1 =
+ X1$1 = Y1$1 = Z1$1 =
+ X2$1 = Y2$1 = Z2$1 = 0;
+ return centroid;
+ }
+};
+
+function centroidPoint$1(x, y) {
+ X0$1 += x;
+ Y0$1 += y;
+ ++Z0$1;
+}
+
+function centroidLineStart$1() {
+ centroidStream$1.point = centroidPointFirstLine;
+}
+
+function centroidPointFirstLine(x, y) {
+ centroidStream$1.point = centroidPointLine;
+ centroidPoint$1(x0$3 = x, y0$3 = y);
+}
+
+function centroidPointLine(x, y) {
+ var dx = x - x0$3, dy = y - y0$3, z = sqrt(dx * dx + dy * dy);
+ X1$1 += z * (x0$3 + x) / 2;
+ Y1$1 += z * (y0$3 + y) / 2;
+ Z1$1 += z;
+ centroidPoint$1(x0$3 = x, y0$3 = y);
+}
+
+function centroidLineEnd$1() {
+ centroidStream$1.point = centroidPoint$1;
+}
+
+function centroidRingStart$1() {
+ centroidStream$1.point = centroidPointFirstRing;
+}
+
+function centroidRingEnd$1() {
+ centroidPointRing(x00$1, y00$1);
+}
+
+function centroidPointFirstRing(x, y) {
+ centroidStream$1.point = centroidPointRing;
+ centroidPoint$1(x00$1 = x0$3 = x, y00$1 = y0$3 = y);
+}
+
+function centroidPointRing(x, y) {
+ var dx = x - x0$3,
+ dy = y - y0$3,
+ z = sqrt(dx * dx + dy * dy);
+
+ X1$1 += z * (x0$3 + x) / 2;
+ Y1$1 += z * (y0$3 + y) / 2;
+ Z1$1 += z;
+
+ z = y0$3 * x - x0$3 * y;
+ X2$1 += z * (x0$3 + x);
+ Y2$1 += z * (y0$3 + y);
+ Z2$1 += z * 3;
+ centroidPoint$1(x0$3 = x, y0$3 = y);
+}
+
+function PathContext(context) {
+ this._context = context;
+}
+
+PathContext.prototype = {
+ _radius: 4.5,
+ pointRadius: function(_) {
+ return this._radius = _, this;
+ },
+ polygonStart: function() {
+ this._line = 0;
+ },
+ polygonEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._point = 0;
+ },
+ lineEnd: function() {
+ if (this._line === 0) this._context.closePath();
+ this._point = NaN;
+ },
+ point: function(x, y) {
+ switch (this._point) {
+ case 0: {
+ this._context.moveTo(x, y);
+ this._point = 1;
+ break;
+ }
+ case 1: {
+ this._context.lineTo(x, y);
+ break;
+ }
+ default: {
+ this._context.moveTo(x + this._radius, y);
+ this._context.arc(x, y, this._radius, 0, tau$3);
+ break;
+ }
+ }
+ },
+ result: noop$2
+};
+
+var lengthSum$1 = adder(),
+ lengthRing,
+ x00$2,
+ y00$2,
+ x0$4,
+ y0$4;
+
+var lengthStream$1 = {
+ point: noop$2,
+ lineStart: function() {
+ lengthStream$1.point = lengthPointFirst$1;
+ },
+ lineEnd: function() {
+ if (lengthRing) lengthPoint$1(x00$2, y00$2);
+ lengthStream$1.point = noop$2;
+ },
+ polygonStart: function() {
+ lengthRing = true;
+ },
+ polygonEnd: function() {
+ lengthRing = null;
+ },
+ result: function() {
+ var length = +lengthSum$1;
+ lengthSum$1.reset();
+ return length;
+ }
+};
+
+function lengthPointFirst$1(x, y) {
+ lengthStream$1.point = lengthPoint$1;
+ x00$2 = x0$4 = x, y00$2 = y0$4 = y;
+}
+
+function lengthPoint$1(x, y) {
+ x0$4 -= x, y0$4 -= y;
+ lengthSum$1.add(sqrt(x0$4 * x0$4 + y0$4 * y0$4));
+ x0$4 = x, y0$4 = y;
+}
+
+function PathString() {
+ this._string = [];
+}
+
+PathString.prototype = {
+ _radius: 4.5,
+ _circle: circle$1(4.5),
+ pointRadius: function(_) {
+ if ((_ = +_) !== this._radius) this._radius = _, this._circle = null;
+ return this;
+ },
+ polygonStart: function() {
+ this._line = 0;
+ },
+ polygonEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._point = 0;
+ },
+ lineEnd: function() {
+ if (this._line === 0) this._string.push("Z");
+ this._point = NaN;
+ },
+ point: function(x, y) {
+ switch (this._point) {
+ case 0: {
+ this._string.push("M", x, ",", y);
+ this._point = 1;
+ break;
+ }
+ case 1: {
+ this._string.push("L", x, ",", y);
+ break;
+ }
+ default: {
+ if (this._circle == null) this._circle = circle$1(this._radius);
+ this._string.push("M", x, ",", y, this._circle);
+ break;
+ }
+ }
+ },
+ result: function() {
+ if (this._string.length) {
+ var result = this._string.join("");
+ this._string = [];
+ return result;
+ } else {
+ return null;
+ }
+ }
+};
+
+function circle$1(radius) {
+ return "m0," + radius
+ + "a" + radius + "," + radius + " 0 1,1 0," + -2 * radius
+ + "a" + radius + "," + radius + " 0 1,1 0," + 2 * radius
+ + "z";
+}
+
+function index$1(projection, context) {
+ var pointRadius = 4.5,
+ projectionStream,
+ contextStream;
+
+ function path(object) {
+ if (object) {
+ if (typeof pointRadius === "function") contextStream.pointRadius(+pointRadius.apply(this, arguments));
+ geoStream(object, projectionStream(contextStream));
+ }
+ return contextStream.result();
+ }
+
+ path.area = function(object) {
+ geoStream(object, projectionStream(areaStream$1));
+ return areaStream$1.result();
+ };
+
+ path.measure = function(object) {
+ geoStream(object, projectionStream(lengthStream$1));
+ return lengthStream$1.result();
+ };
+
+ path.bounds = function(object) {
+ geoStream(object, projectionStream(boundsStream$1));
+ return boundsStream$1.result();
+ };
+
+ path.centroid = function(object) {
+ geoStream(object, projectionStream(centroidStream$1));
+ return centroidStream$1.result();
+ };
+
+ path.projection = function(_) {
+ return arguments.length ? (projectionStream = _ == null ? (projection = null, identity$4) : (projection = _).stream, path) : projection;
+ };
+
+ path.context = function(_) {
+ if (!arguments.length) return context;
+ contextStream = _ == null ? (context = null, new PathString) : new PathContext(context = _);
+ if (typeof pointRadius !== "function") contextStream.pointRadius(pointRadius);
+ return path;
+ };
+
+ path.pointRadius = function(_) {
+ if (!arguments.length) return pointRadius;
+ pointRadius = typeof _ === "function" ? _ : (contextStream.pointRadius(+_), +_);
+ return path;
+ };
+
+ return path.projection(projection).context(context);
+}
+
+function transform(methods) {
+ return {
+ stream: transformer(methods)
+ };
+}
+
+function transformer(methods) {
+ return function(stream) {
+ var s = new TransformStream;
+ for (var key in methods) s[key] = methods[key];
+ s.stream = stream;
+ return s;
+ };
+}
+
+function TransformStream() {}
+
+TransformStream.prototype = {
+ constructor: TransformStream,
+ point: function(x, y) { this.stream.point(x, y); },
+ sphere: function() { this.stream.sphere(); },
+ lineStart: function() { this.stream.lineStart(); },
+ lineEnd: function() { this.stream.lineEnd(); },
+ polygonStart: function() { this.stream.polygonStart(); },
+ polygonEnd: function() { this.stream.polygonEnd(); }
+};
+
+function fit(projection, fitBounds, object) {
+ var clip = projection.clipExtent && projection.clipExtent();
+ projection.scale(150).translate([0, 0]);
+ if (clip != null) projection.clipExtent(null);
+ geoStream(object, projection.stream(boundsStream$1));
+ fitBounds(boundsStream$1.result());
+ if (clip != null) projection.clipExtent(clip);
+ return projection;
+}
+
+function fitExtent(projection, extent, object) {
+ return fit(projection, function(b) {
+ var w = extent[1][0] - extent[0][0],
+ h = extent[1][1] - extent[0][1],
+ k = Math.min(w / (b[1][0] - b[0][0]), h / (b[1][1] - b[0][1])),
+ x = +extent[0][0] + (w - k * (b[1][0] + b[0][0])) / 2,
+ y = +extent[0][1] + (h - k * (b[1][1] + b[0][1])) / 2;
+ projection.scale(150 * k).translate([x, y]);
+ }, object);
+}
+
+function fitSize(projection, size, object) {
+ return fitExtent(projection, [[0, 0], size], object);
+}
+
+function fitWidth(projection, width, object) {
+ return fit(projection, function(b) {
+ var w = +width,
+ k = w / (b[1][0] - b[0][0]),
+ x = (w - k * (b[1][0] + b[0][0])) / 2,
+ y = -k * b[0][1];
+ projection.scale(150 * k).translate([x, y]);
+ }, object);
+}
+
+function fitHeight(projection, height, object) {
+ return fit(projection, function(b) {
+ var h = +height,
+ k = h / (b[1][1] - b[0][1]),
+ x = -k * b[0][0],
+ y = (h - k * (b[1][1] + b[0][1])) / 2;
+ projection.scale(150 * k).translate([x, y]);
+ }, object);
+}
+
+var maxDepth = 16, // maximum depth of subdivision
+ cosMinDistance = cos$1(30 * radians); // cos(minimum angular distance)
+
+function resample(project, delta2) {
+ return +delta2 ? resample$1(project, delta2) : resampleNone(project);
+}
+
+function resampleNone(project) {
+ return transformer({
+ point: function(x, y) {
+ x = project(x, y);
+ this.stream.point(x[0], x[1]);
+ }
+ });
+}
+
+function resample$1(project, delta2) {
+
+ function resampleLineTo(x0, y0, lambda0, a0, b0, c0, x1, y1, lambda1, a1, b1, c1, depth, stream) {
+ var dx = x1 - x0,
+ dy = y1 - y0,
+ d2 = dx * dx + dy * dy;
+ if (d2 > 4 * delta2 && depth--) {
+ var a = a0 + a1,
+ b = b0 + b1,
+ c = c0 + c1,
+ m = sqrt(a * a + b * b + c * c),
+ phi2 = asin(c /= m),
+ lambda2 = abs(abs(c) - 1) < epsilon$2 || abs(lambda0 - lambda1) < epsilon$2 ? (lambda0 + lambda1) / 2 : atan2(b, a),
+ p = project(lambda2, phi2),
+ x2 = p[0],
+ y2 = p[1],
+ dx2 = x2 - x0,
+ dy2 = y2 - y0,
+ dz = dy * dx2 - dx * dy2;
+ if (dz * dz / d2 > delta2 // perpendicular projected distance
+ || abs((dx * dx2 + dy * dy2) / d2 - 0.5) > 0.3 // midpoint close to an end
+ || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) { // angular distance
+ resampleLineTo(x0, y0, lambda0, a0, b0, c0, x2, y2, lambda2, a /= m, b /= m, c, depth, stream);
+ stream.point(x2, y2);
+ resampleLineTo(x2, y2, lambda2, a, b, c, x1, y1, lambda1, a1, b1, c1, depth, stream);
+ }
+ }
+ }
+ return function(stream) {
+ var lambda00, x00, y00, a00, b00, c00, // first point
+ lambda0, x0, y0, a0, b0, c0; // previous point
+
+ var resampleStream = {
+ point: point,
+ lineStart: lineStart,
+ lineEnd: lineEnd,
+ polygonStart: function() { stream.polygonStart(); resampleStream.lineStart = ringStart; },
+ polygonEnd: function() { stream.polygonEnd(); resampleStream.lineStart = lineStart; }
+ };
+
+ function point(x, y) {
+ x = project(x, y);
+ stream.point(x[0], x[1]);
+ }
+
+ function lineStart() {
+ x0 = NaN;
+ resampleStream.point = linePoint;
+ stream.lineStart();
+ }
+
+ function linePoint(lambda, phi) {
+ var c = cartesian([lambda, phi]), p = project(lambda, phi);
+ resampleLineTo(x0, y0, lambda0, a0, b0, c0, x0 = p[0], y0 = p[1], lambda0 = lambda, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);
+ stream.point(x0, y0);
+ }
+
+ function lineEnd() {
+ resampleStream.point = point;
+ stream.lineEnd();
+ }
+
+ function ringStart() {
+ lineStart();
+ resampleStream.point = ringPoint;
+ resampleStream.lineEnd = ringEnd;
+ }
+
+ function ringPoint(lambda, phi) {
+ linePoint(lambda00 = lambda, phi), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0;
+ resampleStream.point = linePoint;
+ }
+
+ function ringEnd() {
+ resampleLineTo(x0, y0, lambda0, a0, b0, c0, x00, y00, lambda00, a00, b00, c00, maxDepth, stream);
+ resampleStream.lineEnd = lineEnd;
+ lineEnd();
+ }
+
+ return resampleStream;
+ };
+}
+
+var transformRadians = transformer({
+ point: function(x, y) {
+ this.stream.point(x * radians, y * radians);
+ }
+});
+
+function transformRotate(rotate) {
+ return transformer({
+ point: function(x, y) {
+ var r = rotate(x, y);
+ return this.stream.point(r[0], r[1]);
+ }
+ });
+}
+
+function scaleTranslate(k, dx, dy) {
+ function transform$$1(x, y) {
+ return [dx + k * x, dy - k * y];
+ }
+ transform$$1.invert = function(x, y) {
+ return [(x - dx) / k, (dy - y) / k];
+ };
+ return transform$$1;
+}
+
+function scaleTranslateRotate(k, dx, dy, alpha) {
+ var cosAlpha = cos$1(alpha),
+ sinAlpha = sin$1(alpha),
+ a = cosAlpha * k,
+ b = sinAlpha * k,
+ ai = cosAlpha / k,
+ bi = sinAlpha / k,
+ ci = (sinAlpha * dy - cosAlpha * dx) / k,
+ fi = (sinAlpha * dx + cosAlpha * dy) / k;
+ function transform$$1(x, y) {
+ return [a * x - b * y + dx, dy - b * x - a * y];
+ }
+ transform$$1.invert = function(x, y) {
+ return [ai * x - bi * y + ci, fi - bi * x - ai * y];
+ };
+ return transform$$1;
+}
+
+function projection(project) {
+ return projectionMutator(function() { return project; })();
+}
+
+function projectionMutator(projectAt) {
+ var project,
+ k = 150, // scale
+ x = 480, y = 250, // translate
+ lambda = 0, phi = 0, // center
+ deltaLambda = 0, deltaPhi = 0, deltaGamma = 0, rotate, // pre-rotate
+ alpha = 0, // post-rotate
+ theta = null, preclip = clipAntimeridian, // pre-clip angle
+ x0 = null, y0, x1, y1, postclip = identity$4, // post-clip extent
+ delta2 = 0.5, // precision
+ projectResample,
+ projectTransform,
+ projectRotateTransform,
+ cache,
+ cacheStream;
+
+ function projection(point) {
+ return projectRotateTransform(point[0] * radians, point[1] * radians);
+ }
+
+ function invert(point) {
+ point = projectRotateTransform.invert(point[0], point[1]);
+ return point && [point[0] * degrees$1, point[1] * degrees$1];
+ }
+
+ projection.stream = function(stream) {
+ return cache && cacheStream === stream ? cache : cache = transformRadians(transformRotate(rotate)(preclip(projectResample(postclip(cacheStream = stream)))));
+ };
+
+ projection.preclip = function(_) {
+ return arguments.length ? (preclip = _, theta = undefined, reset()) : preclip;
+ };
+
+ projection.postclip = function(_) {
+ return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip;
+ };
+
+ projection.clipAngle = function(_) {
+ return arguments.length ? (preclip = +_ ? clipCircle(theta = _ * radians) : (theta = null, clipAntimeridian), reset()) : theta * degrees$1;
+ };
+
+ projection.clipExtent = function(_) {
+ return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity$4) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];
+ };
+
+ projection.scale = function(_) {
+ return arguments.length ? (k = +_, recenter()) : k;
+ };
+
+ projection.translate = function(_) {
+ return arguments.length ? (x = +_[0], y = +_[1], recenter()) : [x, y];
+ };
+
+ projection.center = function(_) {
+ return arguments.length ? (lambda = _[0] % 360 * radians, phi = _[1] % 360 * radians, recenter()) : [lambda * degrees$1, phi * degrees$1];
+ };
+
+ projection.rotate = function(_) {
+ return arguments.length ? (deltaLambda = _[0] % 360 * radians, deltaPhi = _[1] % 360 * radians, deltaGamma = _.length > 2 ? _[2] % 360 * radians : 0, recenter()) : [deltaLambda * degrees$1, deltaPhi * degrees$1, deltaGamma * degrees$1];
+ };
+
+ projection.angle = function(_) {
+ return arguments.length ? (alpha = _ % 360 * radians, recenter()) : alpha * degrees$1;
+ };
+
+ projection.precision = function(_) {
+ return arguments.length ? (projectResample = resample(projectTransform, delta2 = _ * _), reset()) : sqrt(delta2);
+ };
+
+ projection.fitExtent = function(extent, object) {
+ return fitExtent(projection, extent, object);
+ };
+
+ projection.fitSize = function(size, object) {
+ return fitSize(projection, size, object);
+ };
+
+ projection.fitWidth = function(width, object) {
+ return fitWidth(projection, width, object);
+ };
+
+ projection.fitHeight = function(height, object) {
+ return fitHeight(projection, height, object);
+ };
+
+ function recenter() {
+ var center = scaleTranslateRotate(k, 0, 0, alpha).apply(null, project(lambda, phi)),
+ transform$$1 = (alpha ? scaleTranslateRotate : scaleTranslate)(k, x - center[0], y - center[1], alpha);
+ rotate = rotateRadians(deltaLambda, deltaPhi, deltaGamma);
+ projectTransform = compose(project, transform$$1);
+ projectRotateTransform = compose(rotate, projectTransform);
+ projectResample = resample(projectTransform, delta2);
+ return reset();
+ }
+
+ function reset() {
+ cache = cacheStream = null;
+ return projection;
+ }
+
+ return function() {
+ project = projectAt.apply(this, arguments);
+ projection.invert = project.invert && invert;
+ return recenter();
+ };
+}
+
+function conicProjection(projectAt) {
+ var phi0 = 0,
+ phi1 = pi$3 / 3,
+ m = projectionMutator(projectAt),
+ p = m(phi0, phi1);
+
+ p.parallels = function(_) {
+ return arguments.length ? m(phi0 = _[0] * radians, phi1 = _[1] * radians) : [phi0 * degrees$1, phi1 * degrees$1];
+ };
+
+ return p;
+}
+
+function cylindricalEqualAreaRaw(phi0) {
+ var cosPhi0 = cos$1(phi0);
+
+ function forward(lambda, phi) {
+ return [lambda * cosPhi0, sin$1(phi) / cosPhi0];
+ }
+
+ forward.invert = function(x, y) {
+ return [x / cosPhi0, asin(y * cosPhi0)];
+ };
+
+ return forward;
+}
+
+function conicEqualAreaRaw(y0, y1) {
+ var sy0 = sin$1(y0), n = (sy0 + sin$1(y1)) / 2;
+
+ // Are the parallels symmetrical around the Equator?
+ if (abs(n) < epsilon$2) return cylindricalEqualAreaRaw(y0);
+
+ var c = 1 + sy0 * (2 * n - sy0), r0 = sqrt(c) / n;
+
+ function project(x, y) {
+ var r = sqrt(c - 2 * n * sin$1(y)) / n;
+ return [r * sin$1(x *= n), r0 - r * cos$1(x)];
+ }
+
+ project.invert = function(x, y) {
+ var r0y = r0 - y;
+ return [atan2(x, abs(r0y)) / n * sign(r0y), asin((c - (x * x + r0y * r0y) * n * n) / (2 * n))];
+ };
+
+ return project;
+}
+
+function conicEqualArea() {
+ return conicProjection(conicEqualAreaRaw)
+ .scale(155.424)
+ .center([0, 33.6442]);
+}
+
+function albers() {
+ return conicEqualArea()
+ .parallels([29.5, 45.5])
+ .scale(1070)
+ .translate([480, 250])
+ .rotate([96, 0])
+ .center([-0.6, 38.7]);
+}
+
+// The projections must have mutually exclusive clip regions on the sphere,
+// as this will avoid emitting interleaving lines and polygons.
+function multiplex(streams) {
+ var n = streams.length;
+ return {
+ point: function(x, y) { var i = -1; while (++i < n) streams[i].point(x, y); },
+ sphere: function() { var i = -1; while (++i < n) streams[i].sphere(); },
+ lineStart: function() { var i = -1; while (++i < n) streams[i].lineStart(); },
+ lineEnd: function() { var i = -1; while (++i < n) streams[i].lineEnd(); },
+ polygonStart: function() { var i = -1; while (++i < n) streams[i].polygonStart(); },
+ polygonEnd: function() { var i = -1; while (++i < n) streams[i].polygonEnd(); }
+ };
+}
+
+// A composite projection for the United States, configured by default for
+// 960×500. The projection also works quite well at 960×600 if you change the
+// scale to 1285 and adjust the translate accordingly. The set of standard
+// parallels for each region comes from USGS, which is published here:
+// http://egsc.usgs.gov/isb/pubs/MapProjections/projections.html#albers
+function albersUsa() {
+ var cache,
+ cacheStream,
+ lower48 = albers(), lower48Point,
+ alaska = conicEqualArea().rotate([154, 0]).center([-2, 58.5]).parallels([55, 65]), alaskaPoint, // EPSG:3338
+ hawaii = conicEqualArea().rotate([157, 0]).center([-3, 19.9]).parallels([8, 18]), hawaiiPoint, // ESRI:102007
+ point, pointStream = {point: function(x, y) { point = [x, y]; }};
+
+ function albersUsa(coordinates) {
+ var x = coordinates[0], y = coordinates[1];
+ return point = null,
+ (lower48Point.point(x, y), point)
+ || (alaskaPoint.point(x, y), point)
+ || (hawaiiPoint.point(x, y), point);
+ }
+
+ albersUsa.invert = function(coordinates) {
+ var k = lower48.scale(),
+ t = lower48.translate(),
+ x = (coordinates[0] - t[0]) / k,
+ y = (coordinates[1] - t[1]) / k;
+ return (y >= 0.120 && y < 0.234 && x >= -0.425 && x < -0.214 ? alaska
+ : y >= 0.166 && y < 0.234 && x >= -0.214 && x < -0.115 ? hawaii
+ : lower48).invert(coordinates);
+ };
+
+ albersUsa.stream = function(stream) {
+ return cache && cacheStream === stream ? cache : cache = multiplex([lower48.stream(cacheStream = stream), alaska.stream(stream), hawaii.stream(stream)]);
+ };
+
+ albersUsa.precision = function(_) {
+ if (!arguments.length) return lower48.precision();
+ lower48.precision(_), alaska.precision(_), hawaii.precision(_);
+ return reset();
+ };
+
+ albersUsa.scale = function(_) {
+ if (!arguments.length) return lower48.scale();
+ lower48.scale(_), alaska.scale(_ * 0.35), hawaii.scale(_);
+ return albersUsa.translate(lower48.translate());
+ };
+
+ albersUsa.translate = function(_) {
+ if (!arguments.length) return lower48.translate();
+ var k = lower48.scale(), x = +_[0], y = +_[1];
+
+ lower48Point = lower48
+ .translate(_)
+ .clipExtent([[x - 0.455 * k, y - 0.238 * k], [x + 0.455 * k, y + 0.238 * k]])
+ .stream(pointStream);
+
+ alaskaPoint = alaska
+ .translate([x - 0.307 * k, y + 0.201 * k])
+ .clipExtent([[x - 0.425 * k + epsilon$2, y + 0.120 * k + epsilon$2], [x - 0.214 * k - epsilon$2, y + 0.234 * k - epsilon$2]])
+ .stream(pointStream);
+
+ hawaiiPoint = hawaii
+ .translate([x - 0.205 * k, y + 0.212 * k])
+ .clipExtent([[x - 0.214 * k + epsilon$2, y + 0.166 * k + epsilon$2], [x - 0.115 * k - epsilon$2, y + 0.234 * k - epsilon$2]])
+ .stream(pointStream);
+
+ return reset();
+ };
+
+ albersUsa.fitExtent = function(extent, object) {
+ return fitExtent(albersUsa, extent, object);
+ };
+
+ albersUsa.fitSize = function(size, object) {
+ return fitSize(albersUsa, size, object);
+ };
+
+ albersUsa.fitWidth = function(width, object) {
+ return fitWidth(albersUsa, width, object);
+ };
+
+ albersUsa.fitHeight = function(height, object) {
+ return fitHeight(albersUsa, height, object);
+ };
+
+ function reset() {
+ cache = cacheStream = null;
+ return albersUsa;
+ }
+
+ return albersUsa.scale(1070);
+}
+
+function azimuthalRaw(scale) {
+ return function(x, y) {
+ var cx = cos$1(x),
+ cy = cos$1(y),
+ k = scale(cx * cy);
+ return [
+ k * cy * sin$1(x),
+ k * sin$1(y)
+ ];
+ }
+}
+
+function azimuthalInvert(angle) {
+ return function(x, y) {
+ var z = sqrt(x * x + y * y),
+ c = angle(z),
+ sc = sin$1(c),
+ cc = cos$1(c);
+ return [
+ atan2(x * sc, z * cc),
+ asin(z && y * sc / z)
+ ];
+ }
+}
+
+var azimuthalEqualAreaRaw = azimuthalRaw(function(cxcy) {
+ return sqrt(2 / (1 + cxcy));
+});
+
+azimuthalEqualAreaRaw.invert = azimuthalInvert(function(z) {
+ return 2 * asin(z / 2);
+});
+
+function azimuthalEqualArea() {
+ return projection(azimuthalEqualAreaRaw)
+ .scale(124.75)
+ .clipAngle(180 - 1e-3);
+}
+
+var azimuthalEquidistantRaw = azimuthalRaw(function(c) {
+ return (c = acos(c)) && c / sin$1(c);
+});
+
+azimuthalEquidistantRaw.invert = azimuthalInvert(function(z) {
+ return z;
+});
+
+function azimuthalEquidistant() {
+ return projection(azimuthalEquidistantRaw)
+ .scale(79.4188)
+ .clipAngle(180 - 1e-3);
+}
+
+function mercatorRaw(lambda, phi) {
+ return [lambda, log(tan((halfPi$2 + phi) / 2))];
+}
+
+mercatorRaw.invert = function(x, y) {
+ return [x, 2 * atan(exp(y)) - halfPi$2];
+};
+
+function mercator() {
+ return mercatorProjection(mercatorRaw)
+ .scale(961 / tau$3);
+}
+
+function mercatorProjection(project) {
+ var m = projection(project),
+ center = m.center,
+ scale = m.scale,
+ translate = m.translate,
+ clipExtent = m.clipExtent,
+ x0 = null, y0, x1, y1; // clip extent
+
+ m.scale = function(_) {
+ return arguments.length ? (scale(_), reclip()) : scale();
+ };
+
+ m.translate = function(_) {
+ return arguments.length ? (translate(_), reclip()) : translate();
+ };
+
+ m.center = function(_) {
+ return arguments.length ? (center(_), reclip()) : center();
+ };
+
+ m.clipExtent = function(_) {
+ return arguments.length ? ((_ == null ? x0 = y0 = x1 = y1 = null : (x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1])), reclip()) : x0 == null ? null : [[x0, y0], [x1, y1]];
+ };
+
+ function reclip() {
+ var k = pi$3 * scale(),
+ t = m(rotation(m.rotate()).invert([0, 0]));
+ return clipExtent(x0 == null
+ ? [[t[0] - k, t[1] - k], [t[0] + k, t[1] + k]] : project === mercatorRaw
+ ? [[Math.max(t[0] - k, x0), y0], [Math.min(t[0] + k, x1), y1]]
+ : [[x0, Math.max(t[1] - k, y0)], [x1, Math.min(t[1] + k, y1)]]);
+ }
+
+ return reclip();
+}
+
+function tany(y) {
+ return tan((halfPi$2 + y) / 2);
+}
+
+function conicConformalRaw(y0, y1) {
+ var cy0 = cos$1(y0),
+ n = y0 === y1 ? sin$1(y0) : log(cy0 / cos$1(y1)) / log(tany(y1) / tany(y0)),
+ f = cy0 * pow(tany(y0), n) / n;
+
+ if (!n) return mercatorRaw;
+
+ function project(x, y) {
+ if (f > 0) { if (y < -halfPi$2 + epsilon$2) y = -halfPi$2 + epsilon$2; }
+ else { if (y > halfPi$2 - epsilon$2) y = halfPi$2 - epsilon$2; }
+ var r = f / pow(tany(y), n);
+ return [r * sin$1(n * x), f - r * cos$1(n * x)];
+ }
+
+ project.invert = function(x, y) {
+ var fy = f - y, r = sign(n) * sqrt(x * x + fy * fy);
+ return [atan2(x, abs(fy)) / n * sign(fy), 2 * atan(pow(f / r, 1 / n)) - halfPi$2];
+ };
+
+ return project;
+}
+
+function conicConformal() {
+ return conicProjection(conicConformalRaw)
+ .scale(109.5)
+ .parallels([30, 30]);
+}
+
+function equirectangularRaw(lambda, phi) {
+ return [lambda, phi];
+}
+
+equirectangularRaw.invert = equirectangularRaw;
+
+function equirectangular() {
+ return projection(equirectangularRaw)
+ .scale(152.63);
+}
+
+function conicEquidistantRaw(y0, y1) {
+ var cy0 = cos$1(y0),
+ n = y0 === y1 ? sin$1(y0) : (cy0 - cos$1(y1)) / (y1 - y0),
+ g = cy0 / n + y0;
+
+ if (abs(n) < epsilon$2) return equirectangularRaw;
+
+ function project(x, y) {
+ var gy = g - y, nx = n * x;
+ return [gy * sin$1(nx), g - gy * cos$1(nx)];
+ }
+
+ project.invert = function(x, y) {
+ var gy = g - y;
+ return [atan2(x, abs(gy)) / n * sign(gy), g - sign(n) * sqrt(x * x + gy * gy)];
+ };
+
+ return project;
+}
+
+function conicEquidistant() {
+ return conicProjection(conicEquidistantRaw)
+ .scale(131.154)
+ .center([0, 13.9389]);
+}
+
+var A1 = 1.340264,
+ A2 = -0.081106,
+ A3 = 0.000893,
+ A4 = 0.003796,
+ M = sqrt(3) / 2,
+ iterations = 12;
+
+function equalEarthRaw(lambda, phi) {
+ var l = asin(M * sin$1(phi)), l2 = l * l, l6 = l2 * l2 * l2;
+ return [
+ lambda * cos$1(l) / (M * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2))),
+ l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2))
+ ];
+}
+
+equalEarthRaw.invert = function(x, y) {
+ var l = y, l2 = l * l, l6 = l2 * l2 * l2;
+ for (var i = 0, delta, fy, fpy; i < iterations; ++i) {
+ fy = l * (A1 + A2 * l2 + l6 * (A3 + A4 * l2)) - y;
+ fpy = A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2);
+ l -= delta = fy / fpy, l2 = l * l, l6 = l2 * l2 * l2;
+ if (abs(delta) < epsilon2$1) break;
+ }
+ return [
+ M * x * (A1 + 3 * A2 * l2 + l6 * (7 * A3 + 9 * A4 * l2)) / cos$1(l),
+ asin(sin$1(l) / M)
+ ];
+};
+
+function equalEarth() {
+ return projection(equalEarthRaw)
+ .scale(177.158);
+}
+
+function gnomonicRaw(x, y) {
+ var cy = cos$1(y), k = cos$1(x) * cy;
+ return [cy * sin$1(x) / k, sin$1(y) / k];
+}
+
+gnomonicRaw.invert = azimuthalInvert(atan);
+
+function gnomonic() {
+ return projection(gnomonicRaw)
+ .scale(144.049)
+ .clipAngle(60);
+}
+
+function scaleTranslate$1(kx, ky, tx, ty) {
+ return kx === 1 && ky === 1 && tx === 0 && ty === 0 ? identity$4 : transformer({
+ point: function(x, y) {
+ this.stream.point(x * kx + tx, y * ky + ty);
+ }
+ });
+}
+
+function identity$5() {
+ var k = 1, tx = 0, ty = 0, sx = 1, sy = 1, transform$$1 = identity$4, // scale, translate and reflect
+ x0 = null, y0, x1, y1, // clip extent
+ postclip = identity$4,
+ cache,
+ cacheStream,
+ projection;
+
+ function reset() {
+ cache = cacheStream = null;
+ return projection;
+ }
+
+ return projection = {
+ stream: function(stream) {
+ return cache && cacheStream === stream ? cache : cache = transform$$1(postclip(cacheStream = stream));
+ },
+ postclip: function(_) {
+ return arguments.length ? (postclip = _, x0 = y0 = x1 = y1 = null, reset()) : postclip;
+ },
+ clipExtent: function(_) {
+ return arguments.length ? (postclip = _ == null ? (x0 = y0 = x1 = y1 = null, identity$4) : clipRectangle(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]), reset()) : x0 == null ? null : [[x0, y0], [x1, y1]];
+ },
+ scale: function(_) {
+ return arguments.length ? (transform$$1 = scaleTranslate$1((k = +_) * sx, k * sy, tx, ty), reset()) : k;
+ },
+ translate: function(_) {
+ return arguments.length ? (transform$$1 = scaleTranslate$1(k * sx, k * sy, tx = +_[0], ty = +_[1]), reset()) : [tx, ty];
+ },
+ reflectX: function(_) {
+ return arguments.length ? (transform$$1 = scaleTranslate$1(k * (sx = _ ? -1 : 1), k * sy, tx, ty), reset()) : sx < 0;
+ },
+ reflectY: function(_) {
+ return arguments.length ? (transform$$1 = scaleTranslate$1(k * sx, k * (sy = _ ? -1 : 1), tx, ty), reset()) : sy < 0;
+ },
+ fitExtent: function(extent, object) {
+ return fitExtent(projection, extent, object);
+ },
+ fitSize: function(size, object) {
+ return fitSize(projection, size, object);
+ },
+ fitWidth: function(width, object) {
+ return fitWidth(projection, width, object);
+ },
+ fitHeight: function(height, object) {
+ return fitHeight(projection, height, object);
+ }
+ };
+}
+
+function naturalEarth1Raw(lambda, phi) {
+ var phi2 = phi * phi, phi4 = phi2 * phi2;
+ return [
+ lambda * (0.8707 - 0.131979 * phi2 + phi4 * (-0.013791 + phi4 * (0.003971 * phi2 - 0.001529 * phi4))),
+ phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4)))
+ ];
+}
+
+naturalEarth1Raw.invert = function(x, y) {
+ var phi = y, i = 25, delta;
+ do {
+ var phi2 = phi * phi, phi4 = phi2 * phi2;
+ phi -= delta = (phi * (1.007226 + phi2 * (0.015085 + phi4 * (-0.044475 + 0.028874 * phi2 - 0.005916 * phi4))) - y) /
+ (1.007226 + phi2 * (0.015085 * 3 + phi4 * (-0.044475 * 7 + 0.028874 * 9 * phi2 - 0.005916 * 11 * phi4)));
+ } while (abs(delta) > epsilon$2 && --i > 0);
+ return [
+ x / (0.8707 + (phi2 = phi * phi) * (-0.131979 + phi2 * (-0.013791 + phi2 * phi2 * phi2 * (0.003971 - 0.001529 * phi2)))),
+ phi
+ ];
+};
+
+function naturalEarth1() {
+ return projection(naturalEarth1Raw)
+ .scale(175.295);
+}
+
+function orthographicRaw(x, y) {
+ return [cos$1(y) * sin$1(x), sin$1(y)];
+}
+
+orthographicRaw.invert = azimuthalInvert(asin);
+
+function orthographic() {
+ return projection(orthographicRaw)
+ .scale(249.5)
+ .clipAngle(90 + epsilon$2);
+}
+
+function stereographicRaw(x, y) {
+ var cy = cos$1(y), k = 1 + cos$1(x) * cy;
+ return [cy * sin$1(x) / k, sin$1(y) / k];
+}
+
+stereographicRaw.invert = azimuthalInvert(function(z) {
+ return 2 * atan(z);
+});
+
+function stereographic() {
+ return projection(stereographicRaw)
+ .scale(250)
+ .clipAngle(142);
+}
+
+function transverseMercatorRaw(lambda, phi) {
+ return [log(tan((halfPi$2 + phi) / 2)), -lambda];
+}
+
+transverseMercatorRaw.invert = function(x, y) {
+ return [-y, 2 * atan(exp(x)) - halfPi$2];
+};
+
+function transverseMercator() {
+ var m = mercatorProjection(transverseMercatorRaw),
+ center = m.center,
+ rotate = m.rotate;
+
+ m.center = function(_) {
+ return arguments.length ? center([-_[1], _[0]]) : (_ = center(), [_[1], -_[0]]);
+ };
+
+ m.rotate = function(_) {
+ return arguments.length ? rotate([_[0], _[1], _.length > 2 ? _[2] + 90 : 90]) : (_ = rotate(), [_[0], _[1], _[2] - 90]);
+ };
+
+ return rotate([0, 0, 90])
+ .scale(159.155);
+}
+
+function defaultSeparation(a, b) {
+ return a.parent === b.parent ? 1 : 2;
+}
+
+function meanX(children) {
+ return children.reduce(meanXReduce, 0) / children.length;
+}
+
+function meanXReduce(x, c) {
+ return x + c.x;
+}
+
+function maxY(children) {
+ return 1 + children.reduce(maxYReduce, 0);
+}
+
+function maxYReduce(y, c) {
+ return Math.max(y, c.y);
+}
+
+function leafLeft(node) {
+ var children;
+ while (children = node.children) node = children[0];
+ return node;
+}
+
+function leafRight(node) {
+ var children;
+ while (children = node.children) node = children[children.length - 1];
+ return node;
+}
+
+function cluster() {
+ var separation = defaultSeparation,
+ dx = 1,
+ dy = 1,
+ nodeSize = false;
+
+ function cluster(root) {
+ var previousNode,
+ x = 0;
+
+ // First walk, computing the initial x & y values.
+ root.eachAfter(function(node) {
+ var children = node.children;
+ if (children) {
+ node.x = meanX(children);
+ node.y = maxY(children);
+ } else {
+ node.x = previousNode ? x += separation(node, previousNode) : 0;
+ node.y = 0;
+ previousNode = node;
+ }
+ });
+
+ var left = leafLeft(root),
+ right = leafRight(root),
+ x0 = left.x - separation(left, right) / 2,
+ x1 = right.x + separation(right, left) / 2;
+
+ // Second walk, normalizing x & y to the desired size.
+ return root.eachAfter(nodeSize ? function(node) {
+ node.x = (node.x - root.x) * dx;
+ node.y = (root.y - node.y) * dy;
+ } : function(node) {
+ node.x = (node.x - x0) / (x1 - x0) * dx;
+ node.y = (1 - (root.y ? node.y / root.y : 1)) * dy;
+ });
+ }
+
+ cluster.separation = function(x) {
+ return arguments.length ? (separation = x, cluster) : separation;
+ };
+
+ cluster.size = function(x) {
+ return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? null : [dx, dy]);
+ };
+
+ cluster.nodeSize = function(x) {
+ return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], cluster) : (nodeSize ? [dx, dy] : null);
+ };
+
+ return cluster;
+}
+
+function count(node) {
+ var sum = 0,
+ children = node.children,
+ i = children && children.length;
+ if (!i) sum = 1;
+ else while (--i >= 0) sum += children[i].value;
+ node.value = sum;
+}
+
+function node_count() {
+ return this.eachAfter(count);
+}
+
+function node_each(callback) {
+ var node = this, current, next = [node], children, i, n;
+ do {
+ current = next.reverse(), next = [];
+ while (node = current.pop()) {
+ callback(node), children = node.children;
+ if (children) for (i = 0, n = children.length; i < n; ++i) {
+ next.push(children[i]);
+ }
+ }
+ } while (next.length);
+ return this;
+}
+
+function node_eachBefore(callback) {
+ var node = this, nodes = [node], children, i;
+ while (node = nodes.pop()) {
+ callback(node), children = node.children;
+ if (children) for (i = children.length - 1; i >= 0; --i) {
+ nodes.push(children[i]);
+ }
+ }
+ return this;
+}
+
+function node_eachAfter(callback) {
+ var node = this, nodes = [node], next = [], children, i, n;
+ while (node = nodes.pop()) {
+ next.push(node), children = node.children;
+ if (children) for (i = 0, n = children.length; i < n; ++i) {
+ nodes.push(children[i]);
+ }
+ }
+ while (node = next.pop()) {
+ callback(node);
+ }
+ return this;
+}
+
+function node_sum(value) {
+ return this.eachAfter(function(node) {
+ var sum = +value(node.data) || 0,
+ children = node.children,
+ i = children && children.length;
+ while (--i >= 0) sum += children[i].value;
+ node.value = sum;
+ });
+}
+
+function node_sort(compare) {
+ return this.eachBefore(function(node) {
+ if (node.children) {
+ node.children.sort(compare);
+ }
+ });
+}
+
+function node_path(end) {
+ var start = this,
+ ancestor = leastCommonAncestor(start, end),
+ nodes = [start];
+ while (start !== ancestor) {
+ start = start.parent;
+ nodes.push(start);
+ }
+ var k = nodes.length;
+ while (end !== ancestor) {
+ nodes.splice(k, 0, end);
+ end = end.parent;
+ }
+ return nodes;
+}
+
+function leastCommonAncestor(a, b) {
+ if (a === b) return a;
+ var aNodes = a.ancestors(),
+ bNodes = b.ancestors(),
+ c = null;
+ a = aNodes.pop();
+ b = bNodes.pop();
+ while (a === b) {
+ c = a;
+ a = aNodes.pop();
+ b = bNodes.pop();
+ }
+ return c;
+}
+
+function node_ancestors() {
+ var node = this, nodes = [node];
+ while (node = node.parent) {
+ nodes.push(node);
+ }
+ return nodes;
+}
+
+function node_descendants() {
+ var nodes = [];
+ this.each(function(node) {
+ nodes.push(node);
+ });
+ return nodes;
+}
+
+function node_leaves() {
+ var leaves = [];
+ this.eachBefore(function(node) {
+ if (!node.children) {
+ leaves.push(node);
+ }
+ });
+ return leaves;
+}
+
+function node_links() {
+ var root = this, links = [];
+ root.each(function(node) {
+ if (node !== root) { // Don’t include the root’s parent, if any.
+ links.push({source: node.parent, target: node});
+ }
+ });
+ return links;
+}
+
+function hierarchy(data, children) {
+ var root = new Node(data),
+ valued = +data.value && (root.value = data.value),
+ node,
+ nodes = [root],
+ child,
+ childs,
+ i,
+ n;
+
+ if (children == null) children = defaultChildren;
+
+ while (node = nodes.pop()) {
+ if (valued) node.value = +node.data.value;
+ if ((childs = children(node.data)) && (n = childs.length)) {
+ node.children = new Array(n);
+ for (i = n - 1; i >= 0; --i) {
+ nodes.push(child = node.children[i] = new Node(childs[i]));
+ child.parent = node;
+ child.depth = node.depth + 1;
+ }
+ }
+ }
+
+ return root.eachBefore(computeHeight);
+}
+
+function node_copy() {
+ return hierarchy(this).eachBefore(copyData);
+}
+
+function defaultChildren(d) {
+ return d.children;
+}
+
+function copyData(node) {
+ node.data = node.data.data;
+}
+
+function computeHeight(node) {
+ var height = 0;
+ do node.height = height;
+ while ((node = node.parent) && (node.height < ++height));
+}
+
+function Node(data) {
+ this.data = data;
+ this.depth =
+ this.height = 0;
+ this.parent = null;
+}
+
+Node.prototype = hierarchy.prototype = {
+ constructor: Node,
+ count: node_count,
+ each: node_each,
+ eachAfter: node_eachAfter,
+ eachBefore: node_eachBefore,
+ sum: node_sum,
+ sort: node_sort,
+ path: node_path,
+ ancestors: node_ancestors,
+ descendants: node_descendants,
+ leaves: node_leaves,
+ links: node_links,
+ copy: node_copy
+};
+
+var slice$4 = Array.prototype.slice;
+
+function shuffle$1(array) {
+ var m = array.length,
+ t,
+ i;
+
+ while (m) {
+ i = Math.random() * m-- | 0;
+ t = array[m];
+ array[m] = array[i];
+ array[i] = t;
+ }
+
+ return array;
+}
+
+function enclose(circles) {
+ var i = 0, n = (circles = shuffle$1(slice$4.call(circles))).length, B = [], p, e;
+
+ while (i < n) {
+ p = circles[i];
+ if (e && enclosesWeak(e, p)) ++i;
+ else e = encloseBasis(B = extendBasis(B, p)), i = 0;
+ }
+
+ return e;
+}
+
+function extendBasis(B, p) {
+ var i, j;
+
+ if (enclosesWeakAll(p, B)) return [p];
+
+ // If we get here then B must have at least one element.
+ for (i = 0; i < B.length; ++i) {
+ if (enclosesNot(p, B[i])
+ && enclosesWeakAll(encloseBasis2(B[i], p), B)) {
+ return [B[i], p];
+ }
+ }
+
+ // If we get here then B must have at least two elements.
+ for (i = 0; i < B.length - 1; ++i) {
+ for (j = i + 1; j < B.length; ++j) {
+ if (enclosesNot(encloseBasis2(B[i], B[j]), p)
+ && enclosesNot(encloseBasis2(B[i], p), B[j])
+ && enclosesNot(encloseBasis2(B[j], p), B[i])
+ && enclosesWeakAll(encloseBasis3(B[i], B[j], p), B)) {
+ return [B[i], B[j], p];
+ }
+ }
+ }
+
+ // If we get here then something is very wrong.
+ throw new Error;
+}
+
+function enclosesNot(a, b) {
+ var dr = a.r - b.r, dx = b.x - a.x, dy = b.y - a.y;
+ return dr < 0 || dr * dr < dx * dx + dy * dy;
+}
+
+function enclosesWeak(a, b) {
+ var dr = a.r - b.r + 1e-6, dx = b.x - a.x, dy = b.y - a.y;
+ return dr > 0 && dr * dr > dx * dx + dy * dy;
+}
+
+function enclosesWeakAll(a, B) {
+ for (var i = 0; i < B.length; ++i) {
+ if (!enclosesWeak(a, B[i])) {
+ return false;
+ }
+ }
+ return true;
+}
+
+function encloseBasis(B) {
+ switch (B.length) {
+ case 1: return encloseBasis1(B[0]);
+ case 2: return encloseBasis2(B[0], B[1]);
+ case 3: return encloseBasis3(B[0], B[1], B[2]);
+ }
+}
+
+function encloseBasis1(a) {
+ return {
+ x: a.x,
+ y: a.y,
+ r: a.r
+ };
+}
+
+function encloseBasis2(a, b) {
+ var x1 = a.x, y1 = a.y, r1 = a.r,
+ x2 = b.x, y2 = b.y, r2 = b.r,
+ x21 = x2 - x1, y21 = y2 - y1, r21 = r2 - r1,
+ l = Math.sqrt(x21 * x21 + y21 * y21);
+ return {
+ x: (x1 + x2 + x21 / l * r21) / 2,
+ y: (y1 + y2 + y21 / l * r21) / 2,
+ r: (l + r1 + r2) / 2
+ };
+}
+
+function encloseBasis3(a, b, c) {
+ var x1 = a.x, y1 = a.y, r1 = a.r,
+ x2 = b.x, y2 = b.y, r2 = b.r,
+ x3 = c.x, y3 = c.y, r3 = c.r,
+ a2 = x1 - x2,
+ a3 = x1 - x3,
+ b2 = y1 - y2,
+ b3 = y1 - y3,
+ c2 = r2 - r1,
+ c3 = r3 - r1,
+ d1 = x1 * x1 + y1 * y1 - r1 * r1,
+ d2 = d1 - x2 * x2 - y2 * y2 + r2 * r2,
+ d3 = d1 - x3 * x3 - y3 * y3 + r3 * r3,
+ ab = a3 * b2 - a2 * b3,
+ xa = (b2 * d3 - b3 * d2) / (ab * 2) - x1,
+ xb = (b3 * c2 - b2 * c3) / ab,
+ ya = (a3 * d2 - a2 * d3) / (ab * 2) - y1,
+ yb = (a2 * c3 - a3 * c2) / ab,
+ A = xb * xb + yb * yb - 1,
+ B = 2 * (r1 + xa * xb + ya * yb),
+ C = xa * xa + ya * ya - r1 * r1,
+ r = -(A ? (B + Math.sqrt(B * B - 4 * A * C)) / (2 * A) : C / B);
+ return {
+ x: x1 + xa + xb * r,
+ y: y1 + ya + yb * r,
+ r: r
+ };
+}
+
+function place(b, a, c) {
+ var dx = b.x - a.x, x, a2,
+ dy = b.y - a.y, y, b2,
+ d2 = dx * dx + dy * dy;
+ if (d2) {
+ a2 = a.r + c.r, a2 *= a2;
+ b2 = b.r + c.r, b2 *= b2;
+ if (a2 > b2) {
+ x = (d2 + b2 - a2) / (2 * d2);
+ y = Math.sqrt(Math.max(0, b2 / d2 - x * x));
+ c.x = b.x - x * dx - y * dy;
+ c.y = b.y - x * dy + y * dx;
+ } else {
+ x = (d2 + a2 - b2) / (2 * d2);
+ y = Math.sqrt(Math.max(0, a2 / d2 - x * x));
+ c.x = a.x + x * dx - y * dy;
+ c.y = a.y + x * dy + y * dx;
+ }
+ } else {
+ c.x = a.x + c.r;
+ c.y = a.y;
+ }
+}
+
+function intersects(a, b) {
+ var dr = a.r + b.r - 1e-6, dx = b.x - a.x, dy = b.y - a.y;
+ return dr > 0 && dr * dr > dx * dx + dy * dy;
+}
+
+function score(node) {
+ var a = node._,
+ b = node.next._,
+ ab = a.r + b.r,
+ dx = (a.x * b.r + b.x * a.r) / ab,
+ dy = (a.y * b.r + b.y * a.r) / ab;
+ return dx * dx + dy * dy;
+}
+
+function Node$1(circle) {
+ this._ = circle;
+ this.next = null;
+ this.previous = null;
+}
+
+function packEnclose(circles) {
+ if (!(n = circles.length)) return 0;
+
+ var a, b, c, n, aa, ca, i, j, k, sj, sk;
+
+ // Place the first circle.
+ a = circles[0], a.x = 0, a.y = 0;
+ if (!(n > 1)) return a.r;
+
+ // Place the second circle.
+ b = circles[1], a.x = -b.r, b.x = a.r, b.y = 0;
+ if (!(n > 2)) return a.r + b.r;
+
+ // Place the third circle.
+ place(b, a, c = circles[2]);
+
+ // Initialize the front-chain using the first three circles a, b and c.
+ a = new Node$1(a), b = new Node$1(b), c = new Node$1(c);
+ a.next = c.previous = b;
+ b.next = a.previous = c;
+ c.next = b.previous = a;
+
+ // Attempt to place each remaining circle…
+ pack: for (i = 3; i < n; ++i) {
+ place(a._, b._, c = circles[i]), c = new Node$1(c);
+
+ // Find the closest intersecting circle on the front-chain, if any.
+ // “Closeness†is determined by linear distance along the front-chain.
+ // “Ahead†or “behind†is likewise determined by linear distance.
+ j = b.next, k = a.previous, sj = b._.r, sk = a._.r;
+ do {
+ if (sj <= sk) {
+ if (intersects(j._, c._)) {
+ b = j, a.next = b, b.previous = a, --i;
+ continue pack;
+ }
+ sj += j._.r, j = j.next;
+ } else {
+ if (intersects(k._, c._)) {
+ a = k, a.next = b, b.previous = a, --i;
+ continue pack;
+ }
+ sk += k._.r, k = k.previous;
+ }
+ } while (j !== k.next);
+
+ // Success! Insert the new circle c between a and b.
+ c.previous = a, c.next = b, a.next = b.previous = b = c;
+
+ // Compute the new closest circle pair to the centroid.
+ aa = score(a);
+ while ((c = c.next) !== b) {
+ if ((ca = score(c)) < aa) {
+ a = c, aa = ca;
+ }
+ }
+ b = a.next;
+ }
+
+ // Compute the enclosing circle of the front chain.
+ a = [b._], c = b; while ((c = c.next) !== b) a.push(c._); c = enclose(a);
+
+ // Translate the circles to put the enclosing circle around the origin.
+ for (i = 0; i < n; ++i) a = circles[i], a.x -= c.x, a.y -= c.y;
+
+ return c.r;
+}
+
+function siblings(circles) {
+ packEnclose(circles);
+ return circles;
+}
+
+function optional(f) {
+ return f == null ? null : required(f);
+}
+
+function required(f) {
+ if (typeof f !== "function") throw new Error;
+ return f;
+}
+
+function constantZero() {
+ return 0;
+}
+
+function constant$9(x) {
+ return function() {
+ return x;
+ };
+}
+
+function defaultRadius$1(d) {
+ return Math.sqrt(d.value);
+}
+
+function index$2() {
+ var radius = null,
+ dx = 1,
+ dy = 1,
+ padding = constantZero;
+
+ function pack(root) {
+ root.x = dx / 2, root.y = dy / 2;
+ if (radius) {
+ root.eachBefore(radiusLeaf(radius))
+ .eachAfter(packChildren(padding, 0.5))
+ .eachBefore(translateChild(1));
+ } else {
+ root.eachBefore(radiusLeaf(defaultRadius$1))
+ .eachAfter(packChildren(constantZero, 1))
+ .eachAfter(packChildren(padding, root.r / Math.min(dx, dy)))
+ .eachBefore(translateChild(Math.min(dx, dy) / (2 * root.r)));
+ }
+ return root;
+ }
+
+ pack.radius = function(x) {
+ return arguments.length ? (radius = optional(x), pack) : radius;
+ };
+
+ pack.size = function(x) {
+ return arguments.length ? (dx = +x[0], dy = +x[1], pack) : [dx, dy];
+ };
+
+ pack.padding = function(x) {
+ return arguments.length ? (padding = typeof x === "function" ? x : constant$9(+x), pack) : padding;
+ };
+
+ return pack;
+}
+
+function radiusLeaf(radius) {
+ return function(node) {
+ if (!node.children) {
+ node.r = Math.max(0, +radius(node) || 0);
+ }
+ };
+}
+
+function packChildren(padding, k) {
+ return function(node) {
+ if (children = node.children) {
+ var children,
+ i,
+ n = children.length,
+ r = padding(node) * k || 0,
+ e;
+
+ if (r) for (i = 0; i < n; ++i) children[i].r += r;
+ e = packEnclose(children);
+ if (r) for (i = 0; i < n; ++i) children[i].r -= r;
+ node.r = e + r;
+ }
+ };
+}
+
+function translateChild(k) {
+ return function(node) {
+ var parent = node.parent;
+ node.r *= k;
+ if (parent) {
+ node.x = parent.x + k * node.x;
+ node.y = parent.y + k * node.y;
+ }
+ };
+}
+
+function roundNode(node) {
+ node.x0 = Math.round(node.x0);
+ node.y0 = Math.round(node.y0);
+ node.x1 = Math.round(node.x1);
+ node.y1 = Math.round(node.y1);
+}
+
+function treemapDice(parent, x0, y0, x1, y1) {
+ var nodes = parent.children,
+ node,
+ i = -1,
+ n = nodes.length,
+ k = parent.value && (x1 - x0) / parent.value;
+
+ while (++i < n) {
+ node = nodes[i], node.y0 = y0, node.y1 = y1;
+ node.x0 = x0, node.x1 = x0 += node.value * k;
+ }
+}
+
+function partition() {
+ var dx = 1,
+ dy = 1,
+ padding = 0,
+ round = false;
+
+ function partition(root) {
+ var n = root.height + 1;
+ root.x0 =
+ root.y0 = padding;
+ root.x1 = dx;
+ root.y1 = dy / n;
+ root.eachBefore(positionNode(dy, n));
+ if (round) root.eachBefore(roundNode);
+ return root;
+ }
+
+ function positionNode(dy, n) {
+ return function(node) {
+ if (node.children) {
+ treemapDice(node, node.x0, dy * (node.depth + 1) / n, node.x1, dy * (node.depth + 2) / n);
+ }
+ var x0 = node.x0,
+ y0 = node.y0,
+ x1 = node.x1 - padding,
+ y1 = node.y1 - padding;
+ if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
+ if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
+ node.x0 = x0;
+ node.y0 = y0;
+ node.x1 = x1;
+ node.y1 = y1;
+ };
+ }
+
+ partition.round = function(x) {
+ return arguments.length ? (round = !!x, partition) : round;
+ };
+
+ partition.size = function(x) {
+ return arguments.length ? (dx = +x[0], dy = +x[1], partition) : [dx, dy];
+ };
+
+ partition.padding = function(x) {
+ return arguments.length ? (padding = +x, partition) : padding;
+ };
+
+ return partition;
+}
+
+var keyPrefix$1 = "$", // Protect against keys like “__proto__â€.
+ preroot = {depth: -1},
+ ambiguous = {};
+
+function defaultId(d) {
+ return d.id;
+}
+
+function defaultParentId(d) {
+ return d.parentId;
+}
+
+function stratify() {
+ var id = defaultId,
+ parentId = defaultParentId;
+
+ function stratify(data) {
+ var d,
+ i,
+ n = data.length,
+ root,
+ parent,
+ node,
+ nodes = new Array(n),
+ nodeId,
+ nodeKey,
+ nodeByKey = {};
+
+ for (i = 0; i < n; ++i) {
+ d = data[i], node = nodes[i] = new Node(d);
+ if ((nodeId = id(d, i, data)) != null && (nodeId += "")) {
+ nodeKey = keyPrefix$1 + (node.id = nodeId);
+ nodeByKey[nodeKey] = nodeKey in nodeByKey ? ambiguous : node;
+ }
+ }
+
+ for (i = 0; i < n; ++i) {
+ node = nodes[i], nodeId = parentId(data[i], i, data);
+ if (nodeId == null || !(nodeId += "")) {
+ if (root) throw new Error("multiple roots");
+ root = node;
+ } else {
+ parent = nodeByKey[keyPrefix$1 + nodeId];
+ if (!parent) throw new Error("missing: " + nodeId);
+ if (parent === ambiguous) throw new Error("ambiguous: " + nodeId);
+ if (parent.children) parent.children.push(node);
+ else parent.children = [node];
+ node.parent = parent;
+ }
+ }
+
+ if (!root) throw new Error("no root");
+ root.parent = preroot;
+ root.eachBefore(function(node) { node.depth = node.parent.depth + 1; --n; }).eachBefore(computeHeight);
+ root.parent = null;
+ if (n > 0) throw new Error("cycle");
+
+ return root;
+ }
+
+ stratify.id = function(x) {
+ return arguments.length ? (id = required(x), stratify) : id;
+ };
+
+ stratify.parentId = function(x) {
+ return arguments.length ? (parentId = required(x), stratify) : parentId;
+ };
+
+ return stratify;
+}
+
+function defaultSeparation$1(a, b) {
+ return a.parent === b.parent ? 1 : 2;
+}
+
+// function radialSeparation(a, b) {
+// return (a.parent === b.parent ? 1 : 2) / a.depth;
+// }
+
+// This function is used to traverse the left contour of a subtree (or
+// subforest). It returns the successor of v on this contour. This successor is
+// either given by the leftmost child of v or by the thread of v. The function
+// returns null if and only if v is on the highest level of its subtree.
+function nextLeft(v) {
+ var children = v.children;
+ return children ? children[0] : v.t;
+}
+
+// This function works analogously to nextLeft.
+function nextRight(v) {
+ var children = v.children;
+ return children ? children[children.length - 1] : v.t;
+}
+
+// Shifts the current subtree rooted at w+. This is done by increasing
+// prelim(w+) and mod(w+) by shift.
+function moveSubtree(wm, wp, shift) {
+ var change = shift / (wp.i - wm.i);
+ wp.c -= change;
+ wp.s += shift;
+ wm.c += change;
+ wp.z += shift;
+ wp.m += shift;
+}
+
+// All other shifts, applied to the smaller subtrees between w- and w+, are
+// performed by this function. To prepare the shifts, we have to adjust
+// change(w+), shift(w+), and change(w-).
+function executeShifts(v) {
+ var shift = 0,
+ change = 0,
+ children = v.children,
+ i = children.length,
+ w;
+ while (--i >= 0) {
+ w = children[i];
+ w.z += shift;
+ w.m += shift;
+ shift += w.s + (change += w.c);
+ }
+}
+
+// If vi-’s ancestor is a sibling of v, returns vi-’s ancestor. Otherwise,
+// returns the specified (default) ancestor.
+function nextAncestor(vim, v, ancestor) {
+ return vim.a.parent === v.parent ? vim.a : ancestor;
+}
+
+function TreeNode(node, i) {
+ this._ = node;
+ this.parent = null;
+ this.children = null;
+ this.A = null; // default ancestor
+ this.a = this; // ancestor
+ this.z = 0; // prelim
+ this.m = 0; // mod
+ this.c = 0; // change
+ this.s = 0; // shift
+ this.t = null; // thread
+ this.i = i; // number
+}
+
+TreeNode.prototype = Object.create(Node.prototype);
+
+function treeRoot(root) {
+ var tree = new TreeNode(root, 0),
+ node,
+ nodes = [tree],
+ child,
+ children,
+ i,
+ n;
+
+ while (node = nodes.pop()) {
+ if (children = node._.children) {
+ node.children = new Array(n = children.length);
+ for (i = n - 1; i >= 0; --i) {
+ nodes.push(child = node.children[i] = new TreeNode(children[i], i));
+ child.parent = node;
+ }
+ }
+ }
+
+ (tree.parent = new TreeNode(null, 0)).children = [tree];
+ return tree;
+}
+
+// Node-link tree diagram using the Reingold-Tilford "tidy" algorithm
+function tree() {
+ var separation = defaultSeparation$1,
+ dx = 1,
+ dy = 1,
+ nodeSize = null;
+
+ function tree(root) {
+ var t = treeRoot(root);
+
+ // Compute the layout using Buchheim et al.’s algorithm.
+ t.eachAfter(firstWalk), t.parent.m = -t.z;
+ t.eachBefore(secondWalk);
+
+ // If a fixed node size is specified, scale x and y.
+ if (nodeSize) root.eachBefore(sizeNode);
+
+ // If a fixed tree size is specified, scale x and y based on the extent.
+ // Compute the left-most, right-most, and depth-most nodes for extents.
+ else {
+ var left = root,
+ right = root,
+ bottom = root;
+ root.eachBefore(function(node) {
+ if (node.x < left.x) left = node;
+ if (node.x > right.x) right = node;
+ if (node.depth > bottom.depth) bottom = node;
+ });
+ var s = left === right ? 1 : separation(left, right) / 2,
+ tx = s - left.x,
+ kx = dx / (right.x + s + tx),
+ ky = dy / (bottom.depth || 1);
+ root.eachBefore(function(node) {
+ node.x = (node.x + tx) * kx;
+ node.y = node.depth * ky;
+ });
+ }
+
+ return root;
+ }
+
+ // Computes a preliminary x-coordinate for v. Before that, FIRST WALK is
+ // applied recursively to the children of v, as well as the function
+ // APPORTION. After spacing out the children by calling EXECUTE SHIFTS, the
+ // node v is placed to the midpoint of its outermost children.
+ function firstWalk(v) {
+ var children = v.children,
+ siblings = v.parent.children,
+ w = v.i ? siblings[v.i - 1] : null;
+ if (children) {
+ executeShifts(v);
+ var midpoint = (children[0].z + children[children.length - 1].z) / 2;
+ if (w) {
+ v.z = w.z + separation(v._, w._);
+ v.m = v.z - midpoint;
+ } else {
+ v.z = midpoint;
+ }
+ } else if (w) {
+ v.z = w.z + separation(v._, w._);
+ }
+ v.parent.A = apportion(v, w, v.parent.A || siblings[0]);
+ }
+
+ // Computes all real x-coordinates by summing up the modifiers recursively.
+ function secondWalk(v) {
+ v._.x = v.z + v.parent.m;
+ v.m += v.parent.m;
+ }
+
+ // The core of the algorithm. Here, a new subtree is combined with the
+ // previous subtrees. Threads are used to traverse the inside and outside
+ // contours of the left and right subtree up to the highest common level. The
+ // vertices used for the traversals are vi+, vi-, vo-, and vo+, where the
+ // superscript o means outside and i means inside, the subscript - means left
+ // subtree and + means right subtree. For summing up the modifiers along the
+ // contour, we use respective variables si+, si-, so-, and so+. Whenever two
+ // nodes of the inside contours conflict, we compute the left one of the
+ // greatest uncommon ancestors using the function ANCESTOR and call MOVE
+ // SUBTREE to shift the subtree and prepare the shifts of smaller subtrees.
+ // Finally, we add a new thread (if necessary).
+ function apportion(v, w, ancestor) {
+ if (w) {
+ var vip = v,
+ vop = v,
+ vim = w,
+ vom = vip.parent.children[0],
+ sip = vip.m,
+ sop = vop.m,
+ sim = vim.m,
+ som = vom.m,
+ shift;
+ while (vim = nextRight(vim), vip = nextLeft(vip), vim && vip) {
+ vom = nextLeft(vom);
+ vop = nextRight(vop);
+ vop.a = v;
+ shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);
+ if (shift > 0) {
+ moveSubtree(nextAncestor(vim, v, ancestor), v, shift);
+ sip += shift;
+ sop += shift;
+ }
+ sim += vim.m;
+ sip += vip.m;
+ som += vom.m;
+ sop += vop.m;
+ }
+ if (vim && !nextRight(vop)) {
+ vop.t = vim;
+ vop.m += sim - sop;
+ }
+ if (vip && !nextLeft(vom)) {
+ vom.t = vip;
+ vom.m += sip - som;
+ ancestor = v;
+ }
+ }
+ return ancestor;
+ }
+
+ function sizeNode(node) {
+ node.x *= dx;
+ node.y = node.depth * dy;
+ }
+
+ tree.separation = function(x) {
+ return arguments.length ? (separation = x, tree) : separation;
+ };
+
+ tree.size = function(x) {
+ return arguments.length ? (nodeSize = false, dx = +x[0], dy = +x[1], tree) : (nodeSize ? null : [dx, dy]);
+ };
+
+ tree.nodeSize = function(x) {
+ return arguments.length ? (nodeSize = true, dx = +x[0], dy = +x[1], tree) : (nodeSize ? [dx, dy] : null);
+ };
+
+ return tree;
+}
+
+function treemapSlice(parent, x0, y0, x1, y1) {
+ var nodes = parent.children,
+ node,
+ i = -1,
+ n = nodes.length,
+ k = parent.value && (y1 - y0) / parent.value;
+
+ while (++i < n) {
+ node = nodes[i], node.x0 = x0, node.x1 = x1;
+ node.y0 = y0, node.y1 = y0 += node.value * k;
+ }
+}
+
+var phi = (1 + Math.sqrt(5)) / 2;
+
+function squarifyRatio(ratio, parent, x0, y0, x1, y1) {
+ var rows = [],
+ nodes = parent.children,
+ row,
+ nodeValue,
+ i0 = 0,
+ i1 = 0,
+ n = nodes.length,
+ dx, dy,
+ value = parent.value,
+ sumValue,
+ minValue,
+ maxValue,
+ newRatio,
+ minRatio,
+ alpha,
+ beta;
+
+ while (i0 < n) {
+ dx = x1 - x0, dy = y1 - y0;
+
+ // Find the next non-empty node.
+ do sumValue = nodes[i1++].value; while (!sumValue && i1 < n);
+ minValue = maxValue = sumValue;
+ alpha = Math.max(dy / dx, dx / dy) / (value * ratio);
+ beta = sumValue * sumValue * alpha;
+ minRatio = Math.max(maxValue / beta, beta / minValue);
+
+ // Keep adding nodes while the aspect ratio maintains or improves.
+ for (; i1 < n; ++i1) {
+ sumValue += nodeValue = nodes[i1].value;
+ if (nodeValue < minValue) minValue = nodeValue;
+ if (nodeValue > maxValue) maxValue = nodeValue;
+ beta = sumValue * sumValue * alpha;
+ newRatio = Math.max(maxValue / beta, beta / minValue);
+ if (newRatio > minRatio) { sumValue -= nodeValue; break; }
+ minRatio = newRatio;
+ }
+
+ // Position and record the row orientation.
+ rows.push(row = {value: sumValue, dice: dx < dy, children: nodes.slice(i0, i1)});
+ if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += dy * sumValue / value : y1);
+ else treemapSlice(row, x0, y0, value ? x0 += dx * sumValue / value : x1, y1);
+ value -= sumValue, i0 = i1;
+ }
+
+ return rows;
+}
+
+var squarify = (function custom(ratio) {
+
+ function squarify(parent, x0, y0, x1, y1) {
+ squarifyRatio(ratio, parent, x0, y0, x1, y1);
+ }
+
+ squarify.ratio = function(x) {
+ return custom((x = +x) > 1 ? x : 1);
+ };
+
+ return squarify;
+})(phi);
+
+function index$3() {
+ var tile = squarify,
+ round = false,
+ dx = 1,
+ dy = 1,
+ paddingStack = [0],
+ paddingInner = constantZero,
+ paddingTop = constantZero,
+ paddingRight = constantZero,
+ paddingBottom = constantZero,
+ paddingLeft = constantZero;
+
+ function treemap(root) {
+ root.x0 =
+ root.y0 = 0;
+ root.x1 = dx;
+ root.y1 = dy;
+ root.eachBefore(positionNode);
+ paddingStack = [0];
+ if (round) root.eachBefore(roundNode);
+ return root;
+ }
+
+ function positionNode(node) {
+ var p = paddingStack[node.depth],
+ x0 = node.x0 + p,
+ y0 = node.y0 + p,
+ x1 = node.x1 - p,
+ y1 = node.y1 - p;
+ if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
+ if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
+ node.x0 = x0;
+ node.y0 = y0;
+ node.x1 = x1;
+ node.y1 = y1;
+ if (node.children) {
+ p = paddingStack[node.depth + 1] = paddingInner(node) / 2;
+ x0 += paddingLeft(node) - p;
+ y0 += paddingTop(node) - p;
+ x1 -= paddingRight(node) - p;
+ y1 -= paddingBottom(node) - p;
+ if (x1 < x0) x0 = x1 = (x0 + x1) / 2;
+ if (y1 < y0) y0 = y1 = (y0 + y1) / 2;
+ tile(node, x0, y0, x1, y1);
+ }
+ }
+
+ treemap.round = function(x) {
+ return arguments.length ? (round = !!x, treemap) : round;
+ };
+
+ treemap.size = function(x) {
+ return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];
+ };
+
+ treemap.tile = function(x) {
+ return arguments.length ? (tile = required(x), treemap) : tile;
+ };
+
+ treemap.padding = function(x) {
+ return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();
+ };
+
+ treemap.paddingInner = function(x) {
+ return arguments.length ? (paddingInner = typeof x === "function" ? x : constant$9(+x), treemap) : paddingInner;
+ };
+
+ treemap.paddingOuter = function(x) {
+ return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();
+ };
+
+ treemap.paddingTop = function(x) {
+ return arguments.length ? (paddingTop = typeof x === "function" ? x : constant$9(+x), treemap) : paddingTop;
+ };
+
+ treemap.paddingRight = function(x) {
+ return arguments.length ? (paddingRight = typeof x === "function" ? x : constant$9(+x), treemap) : paddingRight;
+ };
+
+ treemap.paddingBottom = function(x) {
+ return arguments.length ? (paddingBottom = typeof x === "function" ? x : constant$9(+x), treemap) : paddingBottom;
+ };
+
+ treemap.paddingLeft = function(x) {
+ return arguments.length ? (paddingLeft = typeof x === "function" ? x : constant$9(+x), treemap) : paddingLeft;
+ };
+
+ return treemap;
+}
+
+function binary(parent, x0, y0, x1, y1) {
+ var nodes = parent.children,
+ i, n = nodes.length,
+ sum, sums = new Array(n + 1);
+
+ for (sums[0] = sum = i = 0; i < n; ++i) {
+ sums[i + 1] = sum += nodes[i].value;
+ }
+
+ partition(0, n, parent.value, x0, y0, x1, y1);
+
+ function partition(i, j, value, x0, y0, x1, y1) {
+ if (i >= j - 1) {
+ var node = nodes[i];
+ node.x0 = x0, node.y0 = y0;
+ node.x1 = x1, node.y1 = y1;
+ return;
+ }
+
+ var valueOffset = sums[i],
+ valueTarget = (value / 2) + valueOffset,
+ k = i + 1,
+ hi = j - 1;
+
+ while (k < hi) {
+ var mid = k + hi >>> 1;
+ if (sums[mid] < valueTarget) k = mid + 1;
+ else hi = mid;
+ }
+
+ if ((valueTarget - sums[k - 1]) < (sums[k] - valueTarget) && i + 1 < k) --k;
+
+ var valueLeft = sums[k] - valueOffset,
+ valueRight = value - valueLeft;
+
+ if ((x1 - x0) > (y1 - y0)) {
+ var xk = (x0 * valueRight + x1 * valueLeft) / value;
+ partition(i, k, valueLeft, x0, y0, xk, y1);
+ partition(k, j, valueRight, xk, y0, x1, y1);
+ } else {
+ var yk = (y0 * valueRight + y1 * valueLeft) / value;
+ partition(i, k, valueLeft, x0, y0, x1, yk);
+ partition(k, j, valueRight, x0, yk, x1, y1);
+ }
+ }
+}
+
+function sliceDice(parent, x0, y0, x1, y1) {
+ (parent.depth & 1 ? treemapSlice : treemapDice)(parent, x0, y0, x1, y1);
+}
+
+var resquarify = (function custom(ratio) {
+
+ function resquarify(parent, x0, y0, x1, y1) {
+ if ((rows = parent._squarify) && (rows.ratio === ratio)) {
+ var rows,
+ row,
+ nodes,
+ i,
+ j = -1,
+ n,
+ m = rows.length,
+ value = parent.value;
+
+ while (++j < m) {
+ row = rows[j], nodes = row.children;
+ for (i = row.value = 0, n = nodes.length; i < n; ++i) row.value += nodes[i].value;
+ if (row.dice) treemapDice(row, x0, y0, x1, y0 += (y1 - y0) * row.value / value);
+ else treemapSlice(row, x0, y0, x0 += (x1 - x0) * row.value / value, y1);
+ value -= row.value;
+ }
+ } else {
+ parent._squarify = rows = squarifyRatio(ratio, parent, x0, y0, x1, y1);
+ rows.ratio = ratio;
+ }
+ }
+
+ resquarify.ratio = function(x) {
+ return custom((x = +x) > 1 ? x : 1);
+ };
+
+ return resquarify;
+})(phi);
+
+function area$2(polygon) {
+ var i = -1,
+ n = polygon.length,
+ a,
+ b = polygon[n - 1],
+ area = 0;
+
+ while (++i < n) {
+ a = b;
+ b = polygon[i];
+ area += a[1] * b[0] - a[0] * b[1];
+ }
+
+ return area / 2;
+}
+
+function centroid$1(polygon) {
+ var i = -1,
+ n = polygon.length,
+ x = 0,
+ y = 0,
+ a,
+ b = polygon[n - 1],
+ c,
+ k = 0;
+
+ while (++i < n) {
+ a = b;
+ b = polygon[i];
+ k += c = a[0] * b[1] - b[0] * a[1];
+ x += (a[0] + b[0]) * c;
+ y += (a[1] + b[1]) * c;
+ }
+
+ return k *= 3, [x / k, y / k];
+}
+
+// Returns the 2D cross product of AB and AC vectors, i.e., the z-component of
+// the 3D cross product in a quadrant I Cartesian coordinate system (+x is
+// right, +y is up). Returns a positive value if ABC is counter-clockwise,
+// negative if clockwise, and zero if the points are collinear.
+function cross$1(a, b, c) {
+ return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]);
+}
+
+function lexicographicOrder(a, b) {
+ return a[0] - b[0] || a[1] - b[1];
+}
+
+// Computes the upper convex hull per the monotone chain algorithm.
+// Assumes points.length >= 3, is sorted by x, unique in y.
+// Returns an array of indices into points in left-to-right order.
+function computeUpperHullIndexes(points) {
+ var n = points.length,
+ indexes = [0, 1],
+ size = 2;
+
+ for (var i = 2; i < n; ++i) {
+ while (size > 1 && cross$1(points[indexes[size - 2]], points[indexes[size - 1]], points[i]) <= 0) --size;
+ indexes[size++] = i;
+ }
+
+ return indexes.slice(0, size); // remove popped points
+}
+
+function hull(points) {
+ if ((n = points.length) < 3) return null;
+
+ var i,
+ n,
+ sortedPoints = new Array(n),
+ flippedPoints = new Array(n);
+
+ for (i = 0; i < n; ++i) sortedPoints[i] = [+points[i][0], +points[i][1], i];
+ sortedPoints.sort(lexicographicOrder);
+ for (i = 0; i < n; ++i) flippedPoints[i] = [sortedPoints[i][0], -sortedPoints[i][1]];
+
+ var upperIndexes = computeUpperHullIndexes(sortedPoints),
+ lowerIndexes = computeUpperHullIndexes(flippedPoints);
+
+ // Construct the hull polygon, removing possible duplicate endpoints.
+ var skipLeft = lowerIndexes[0] === upperIndexes[0],
+ skipRight = lowerIndexes[lowerIndexes.length - 1] === upperIndexes[upperIndexes.length - 1],
+ hull = [];
+
+ // Add upper hull in right-to-l order.
+ // Then add lower hull in left-to-right order.
+ for (i = upperIndexes.length - 1; i >= 0; --i) hull.push(points[sortedPoints[upperIndexes[i]][2]]);
+ for (i = +skipLeft; i < lowerIndexes.length - skipRight; ++i) hull.push(points[sortedPoints[lowerIndexes[i]][2]]);
+
+ return hull;
+}
+
+function contains$2(polygon, point) {
+ var n = polygon.length,
+ p = polygon[n - 1],
+ x = point[0], y = point[1],
+ x0 = p[0], y0 = p[1],
+ x1, y1,
+ inside = false;
+
+ for (var i = 0; i < n; ++i) {
+ p = polygon[i], x1 = p[0], y1 = p[1];
+ if (((y1 > y) !== (y0 > y)) && (x < (x0 - x1) * (y - y1) / (y0 - y1) + x1)) inside = !inside;
+ x0 = x1, y0 = y1;
+ }
+
+ return inside;
+}
+
+function length$2(polygon) {
+ var i = -1,
+ n = polygon.length,
+ b = polygon[n - 1],
+ xa,
+ ya,
+ xb = b[0],
+ yb = b[1],
+ perimeter = 0;
+
+ while (++i < n) {
+ xa = xb;
+ ya = yb;
+ b = polygon[i];
+ xb = b[0];
+ yb = b[1];
+ xa -= xb;
+ ya -= yb;
+ perimeter += Math.sqrt(xa * xa + ya * ya);
+ }
+
+ return perimeter;
+}
+
+function defaultSource$1() {
+ return Math.random();
+}
+
+var uniform = (function sourceRandomUniform(source) {
+ function randomUniform(min, max) {
+ min = min == null ? 0 : +min;
+ max = max == null ? 1 : +max;
+ if (arguments.length === 1) max = min, min = 0;
+ else max -= min;
+ return function() {
+ return source() * max + min;
+ };
+ }
+
+ randomUniform.source = sourceRandomUniform;
+
+ return randomUniform;
+})(defaultSource$1);
+
+var normal = (function sourceRandomNormal(source) {
+ function randomNormal(mu, sigma) {
+ var x, r;
+ mu = mu == null ? 0 : +mu;
+ sigma = sigma == null ? 1 : +sigma;
+ return function() {
+ var y;
+
+ // If available, use the second previously-generated uniform random.
+ if (x != null) y = x, x = null;
+
+ // Otherwise, generate a new x and y.
+ else do {
+ x = source() * 2 - 1;
+ y = source() * 2 - 1;
+ r = x * x + y * y;
+ } while (!r || r > 1);
+
+ return mu + sigma * y * Math.sqrt(-2 * Math.log(r) / r);
+ };
+ }
+
+ randomNormal.source = sourceRandomNormal;
+
+ return randomNormal;
+})(defaultSource$1);
+
+var logNormal = (function sourceRandomLogNormal(source) {
+ function randomLogNormal() {
+ var randomNormal = normal.source(source).apply(this, arguments);
+ return function() {
+ return Math.exp(randomNormal());
+ };
+ }
+
+ randomLogNormal.source = sourceRandomLogNormal;
+
+ return randomLogNormal;
+})(defaultSource$1);
+
+var irwinHall = (function sourceRandomIrwinHall(source) {
+ function randomIrwinHall(n) {
+ return function() {
+ for (var sum = 0, i = 0; i < n; ++i) sum += source();
+ return sum;
+ };
+ }
+
+ randomIrwinHall.source = sourceRandomIrwinHall;
+
+ return randomIrwinHall;
+})(defaultSource$1);
+
+var bates = (function sourceRandomBates(source) {
+ function randomBates(n) {
+ var randomIrwinHall = irwinHall.source(source)(n);
+ return function() {
+ return randomIrwinHall() / n;
+ };
+ }
+
+ randomBates.source = sourceRandomBates;
+
+ return randomBates;
+})(defaultSource$1);
+
+var exponential$1 = (function sourceRandomExponential(source) {
+ function randomExponential(lambda) {
+ return function() {
+ return -Math.log(1 - source()) / lambda;
+ };
+ }
+
+ randomExponential.source = sourceRandomExponential;
+
+ return randomExponential;
+})(defaultSource$1);
+
+function initRange(domain, range) {
+ switch (arguments.length) {
+ case 0: break;
+ case 1: this.range(domain); break;
+ default: this.range(range).domain(domain); break;
+ }
+ return this;
+}
+
+function initInterpolator(domain, interpolator) {
+ switch (arguments.length) {
+ case 0: break;
+ case 1: this.interpolator(domain); break;
+ default: this.interpolator(interpolator).domain(domain); break;
+ }
+ return this;
+}
+
+var array$3 = Array.prototype;
+
+var map$2 = array$3.map;
+var slice$5 = array$3.slice;
+
+var implicit = {name: "implicit"};
+
+function ordinal() {
+ var index = map$1(),
+ domain = [],
+ range = [],
+ unknown = implicit;
+
+ function scale(d) {
+ var key = d + "", i = index.get(key);
+ if (!i) {
+ if (unknown !== implicit) return unknown;
+ index.set(key, i = domain.push(d));
+ }
+ return range[(i - 1) % range.length];
+ }
+
+ scale.domain = function(_) {
+ if (!arguments.length) return domain.slice();
+ domain = [], index = map$1();
+ var i = -1, n = _.length, d, key;
+ while (++i < n) if (!index.has(key = (d = _[i]) + "")) index.set(key, domain.push(d));
+ return scale;
+ };
+
+ scale.range = function(_) {
+ return arguments.length ? (range = slice$5.call(_), scale) : range.slice();
+ };
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+
+ scale.copy = function() {
+ return ordinal(domain, range).unknown(unknown);
+ };
+
+ initRange.apply(scale, arguments);
+
+ return scale;
+}
+
+function band() {
+ var scale = ordinal().unknown(undefined),
+ domain = scale.domain,
+ ordinalRange = scale.range,
+ range$$1 = [0, 1],
+ step,
+ bandwidth,
+ round = false,
+ paddingInner = 0,
+ paddingOuter = 0,
+ align = 0.5;
+
+ delete scale.unknown;
+
+ function rescale() {
+ var n = domain().length,
+ reverse = range$$1[1] < range$$1[0],
+ start = range$$1[reverse - 0],
+ stop = range$$1[1 - reverse];
+ step = (stop - start) / Math.max(1, n - paddingInner + paddingOuter * 2);
+ if (round) step = Math.floor(step);
+ start += (stop - start - step * (n - paddingInner)) * align;
+ bandwidth = step * (1 - paddingInner);
+ if (round) start = Math.round(start), bandwidth = Math.round(bandwidth);
+ var values = sequence(n).map(function(i) { return start + step * i; });
+ return ordinalRange(reverse ? values.reverse() : values);
+ }
+
+ scale.domain = function(_) {
+ return arguments.length ? (domain(_), rescale()) : domain();
+ };
+
+ scale.range = function(_) {
+ return arguments.length ? (range$$1 = [+_[0], +_[1]], rescale()) : range$$1.slice();
+ };
+
+ scale.rangeRound = function(_) {
+ return range$$1 = [+_[0], +_[1]], round = true, rescale();
+ };
+
+ scale.bandwidth = function() {
+ return bandwidth;
+ };
+
+ scale.step = function() {
+ return step;
+ };
+
+ scale.round = function(_) {
+ return arguments.length ? (round = !!_, rescale()) : round;
+ };
+
+ scale.padding = function(_) {
+ return arguments.length ? (paddingInner = Math.min(1, paddingOuter = +_), rescale()) : paddingInner;
+ };
+
+ scale.paddingInner = function(_) {
+ return arguments.length ? (paddingInner = Math.min(1, _), rescale()) : paddingInner;
+ };
+
+ scale.paddingOuter = function(_) {
+ return arguments.length ? (paddingOuter = +_, rescale()) : paddingOuter;
+ };
+
+ scale.align = function(_) {
+ return arguments.length ? (align = Math.max(0, Math.min(1, _)), rescale()) : align;
+ };
+
+ scale.copy = function() {
+ return band(domain(), range$$1)
+ .round(round)
+ .paddingInner(paddingInner)
+ .paddingOuter(paddingOuter)
+ .align(align);
+ };
+
+ return initRange.apply(rescale(), arguments);
+}
+
+function pointish(scale) {
+ var copy = scale.copy;
+
+ scale.padding = scale.paddingOuter;
+ delete scale.paddingInner;
+ delete scale.paddingOuter;
+
+ scale.copy = function() {
+ return pointish(copy());
+ };
+
+ return scale;
+}
+
+function point$1() {
+ return pointish(band.apply(null, arguments).paddingInner(1));
+}
+
+function constant$a(x) {
+ return function() {
+ return x;
+ };
+}
+
+function number$2(x) {
+ return +x;
+}
+
+var unit = [0, 1];
+
+function identity$6(x) {
+ return x;
+}
+
+function normalize(a, b) {
+ return (b -= (a = +a))
+ ? function(x) { return (x - a) / b; }
+ : constant$a(isNaN(b) ? NaN : 0.5);
+}
+
+function clamper(domain) {
+ var a = domain[0], b = domain[domain.length - 1], t;
+ if (a > b) t = a, a = b, b = t;
+ return function(x) { return Math.max(a, Math.min(b, x)); };
+}
+
+// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].
+// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].
+function bimap(domain, range, interpolate$$1) {
+ var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];
+ if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate$$1(r1, r0);
+ else d0 = normalize(d0, d1), r0 = interpolate$$1(r0, r1);
+ return function(x) { return r0(d0(x)); };
+}
+
+function polymap(domain, range, interpolate$$1) {
+ var j = Math.min(domain.length, range.length) - 1,
+ d = new Array(j),
+ r = new Array(j),
+ i = -1;
+
+ // Reverse descending domains.
+ if (domain[j] < domain[0]) {
+ domain = domain.slice().reverse();
+ range = range.slice().reverse();
+ }
+
+ while (++i < j) {
+ d[i] = normalize(domain[i], domain[i + 1]);
+ r[i] = interpolate$$1(range[i], range[i + 1]);
+ }
+
+ return function(x) {
+ var i = bisectRight(domain, x, 1, j) - 1;
+ return r[i](d[i](x));
+ };
+}
+
+function copy(source, target) {
+ return target
+ .domain(source.domain())
+ .range(source.range())
+ .interpolate(source.interpolate())
+ .clamp(source.clamp())
+ .unknown(source.unknown());
+}
+
+function transformer$1() {
+ var domain = unit,
+ range = unit,
+ interpolate$$1 = interpolateValue,
+ transform,
+ untransform,
+ unknown,
+ clamp = identity$6,
+ piecewise$$1,
+ output,
+ input;
+
+ function rescale() {
+ piecewise$$1 = Math.min(domain.length, range.length) > 2 ? polymap : bimap;
+ output = input = null;
+ return scale;
+ }
+
+ function scale(x) {
+ return isNaN(x = +x) ? unknown : (output || (output = piecewise$$1(domain.map(transform), range, interpolate$$1)))(transform(clamp(x)));
+ }
+
+ scale.invert = function(y) {
+ return clamp(untransform((input || (input = piecewise$$1(range, domain.map(transform), interpolateNumber)))(y)));
+ };
+
+ scale.domain = function(_) {
+ return arguments.length ? (domain = map$2.call(_, number$2), clamp === identity$6 || (clamp = clamper(domain)), rescale()) : domain.slice();
+ };
+
+ scale.range = function(_) {
+ return arguments.length ? (range = slice$5.call(_), rescale()) : range.slice();
+ };
+
+ scale.rangeRound = function(_) {
+ return range = slice$5.call(_), interpolate$$1 = interpolateRound, rescale();
+ };
+
+ scale.clamp = function(_) {
+ return arguments.length ? (clamp = _ ? clamper(domain) : identity$6, scale) : clamp !== identity$6;
+ };
+
+ scale.interpolate = function(_) {
+ return arguments.length ? (interpolate$$1 = _, rescale()) : interpolate$$1;
+ };
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+
+ return function(t, u) {
+ transform = t, untransform = u;
+ return rescale();
+ };
+}
+
+function continuous(transform, untransform) {
+ return transformer$1()(transform, untransform);
+}
+
+function tickFormat(start, stop, count, specifier) {
+ var step = tickStep(start, stop, count),
+ precision;
+ specifier = formatSpecifier(specifier == null ? ",f" : specifier);
+ switch (specifier.type) {
+ case "s": {
+ var value = Math.max(Math.abs(start), Math.abs(stop));
+ if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;
+ return exports.formatPrefix(specifier, value);
+ }
+ case "":
+ case "e":
+ case "g":
+ case "p":
+ case "r": {
+ if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e");
+ break;
+ }
+ case "f":
+ case "%": {
+ if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === "%") * 2;
+ break;
+ }
+ }
+ return exports.format(specifier);
+}
+
+function linearish(scale) {
+ var domain = scale.domain;
+
+ scale.ticks = function(count) {
+ var d = domain();
+ return ticks(d[0], d[d.length - 1], count == null ? 10 : count);
+ };
+
+ scale.tickFormat = function(count, specifier) {
+ var d = domain();
+ return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);
+ };
+
+ scale.nice = function(count) {
+ if (count == null) count = 10;
+
+ var d = domain(),
+ i0 = 0,
+ i1 = d.length - 1,
+ start = d[i0],
+ stop = d[i1],
+ step;
+
+ if (stop < start) {
+ step = start, start = stop, stop = step;
+ step = i0, i0 = i1, i1 = step;
+ }
+
+ step = tickIncrement(start, stop, count);
+
+ if (step > 0) {
+ start = Math.floor(start / step) * step;
+ stop = Math.ceil(stop / step) * step;
+ step = tickIncrement(start, stop, count);
+ } else if (step < 0) {
+ start = Math.ceil(start * step) / step;
+ stop = Math.floor(stop * step) / step;
+ step = tickIncrement(start, stop, count);
+ }
+
+ if (step > 0) {
+ d[i0] = Math.floor(start / step) * step;
+ d[i1] = Math.ceil(stop / step) * step;
+ domain(d);
+ } else if (step < 0) {
+ d[i0] = Math.ceil(start * step) / step;
+ d[i1] = Math.floor(stop * step) / step;
+ domain(d);
+ }
+
+ return scale;
+ };
+
+ return scale;
+}
+
+function linear$2() {
+ var scale = continuous(identity$6, identity$6);
+
+ scale.copy = function() {
+ return copy(scale, linear$2());
+ };
+
+ initRange.apply(scale, arguments);
+
+ return linearish(scale);
+}
+
+function identity$7(domain) {
+ var unknown;
+
+ function scale(x) {
+ return isNaN(x = +x) ? unknown : x;
+ }
+
+ scale.invert = scale;
+
+ scale.domain = scale.range = function(_) {
+ return arguments.length ? (domain = map$2.call(_, number$2), scale) : domain.slice();
+ };
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+
+ scale.copy = function() {
+ return identity$7(domain).unknown(unknown);
+ };
+
+ domain = arguments.length ? map$2.call(domain, number$2) : [0, 1];
+
+ return linearish(scale);
+}
+
+function nice(domain, interval) {
+ domain = domain.slice();
+
+ var i0 = 0,
+ i1 = domain.length - 1,
+ x0 = domain[i0],
+ x1 = domain[i1],
+ t;
+
+ if (x1 < x0) {
+ t = i0, i0 = i1, i1 = t;
+ t = x0, x0 = x1, x1 = t;
+ }
+
+ domain[i0] = interval.floor(x0);
+ domain[i1] = interval.ceil(x1);
+ return domain;
+}
+
+function transformLog(x) {
+ return Math.log(x);
+}
+
+function transformExp(x) {
+ return Math.exp(x);
+}
+
+function transformLogn(x) {
+ return -Math.log(-x);
+}
+
+function transformExpn(x) {
+ return -Math.exp(-x);
+}
+
+function pow10(x) {
+ return isFinite(x) ? +("1e" + x) : x < 0 ? 0 : x;
+}
+
+function powp(base) {
+ return base === 10 ? pow10
+ : base === Math.E ? Math.exp
+ : function(x) { return Math.pow(base, x); };
+}
+
+function logp(base) {
+ return base === Math.E ? Math.log
+ : base === 10 && Math.log10
+ || base === 2 && Math.log2
+ || (base = Math.log(base), function(x) { return Math.log(x) / base; });
+}
+
+function reflect(f) {
+ return function(x) {
+ return -f(-x);
+ };
+}
+
+function loggish(transform) {
+ var scale = transform(transformLog, transformExp),
+ domain = scale.domain,
+ base = 10,
+ logs,
+ pows;
+
+ function rescale() {
+ logs = logp(base), pows = powp(base);
+ if (domain()[0] < 0) {
+ logs = reflect(logs), pows = reflect(pows);
+ transform(transformLogn, transformExpn);
+ } else {
+ transform(transformLog, transformExp);
+ }
+ return scale;
+ }
+
+ scale.base = function(_) {
+ return arguments.length ? (base = +_, rescale()) : base;
+ };
+
+ scale.domain = function(_) {
+ return arguments.length ? (domain(_), rescale()) : domain();
+ };
+
+ scale.ticks = function(count) {
+ var d = domain(),
+ u = d[0],
+ v = d[d.length - 1],
+ r;
+
+ if (r = v < u) i = u, u = v, v = i;
+
+ var i = logs(u),
+ j = logs(v),
+ p,
+ k,
+ t,
+ n = count == null ? 10 : +count,
+ z = [];
+
+ if (!(base % 1) && j - i < n) {
+ i = Math.round(i) - 1, j = Math.round(j) + 1;
+ if (u > 0) for (; i < j; ++i) {
+ for (k = 1, p = pows(i); k < base; ++k) {
+ t = p * k;
+ if (t < u) continue;
+ if (t > v) break;
+ z.push(t);
+ }
+ } else for (; i < j; ++i) {
+ for (k = base - 1, p = pows(i); k >= 1; --k) {
+ t = p * k;
+ if (t < u) continue;
+ if (t > v) break;
+ z.push(t);
+ }
+ }
+ } else {
+ z = ticks(i, j, Math.min(j - i, n)).map(pows);
+ }
+
+ return r ? z.reverse() : z;
+ };
+
+ scale.tickFormat = function(count, specifier) {
+ if (specifier == null) specifier = base === 10 ? ".0e" : ",";
+ if (typeof specifier !== "function") specifier = exports.format(specifier);
+ if (count === Infinity) return specifier;
+ if (count == null) count = 10;
+ var k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?
+ return function(d) {
+ var i = d / pows(Math.round(logs(d)));
+ if (i * base < base - 0.5) i *= base;
+ return i <= k ? specifier(d) : "";
+ };
+ };
+
+ scale.nice = function() {
+ return domain(nice(domain(), {
+ floor: function(x) { return pows(Math.floor(logs(x))); },
+ ceil: function(x) { return pows(Math.ceil(logs(x))); }
+ }));
+ };
+
+ return scale;
+}
+
+function log$1() {
+ var scale = loggish(transformer$1()).domain([1, 10]);
+
+ scale.copy = function() {
+ return copy(scale, log$1()).base(scale.base());
+ };
+
+ initRange.apply(scale, arguments);
+
+ return scale;
+}
+
+function transformSymlog(c) {
+ return function(x) {
+ return Math.sign(x) * Math.log1p(Math.abs(x / c));
+ };
+}
+
+function transformSymexp(c) {
+ return function(x) {
+ return Math.sign(x) * Math.expm1(Math.abs(x)) * c;
+ };
+}
+
+function symlogish(transform) {
+ var c = 1, scale = transform(transformSymlog(c), transformSymexp(c));
+
+ scale.constant = function(_) {
+ return arguments.length ? transform(transformSymlog(c = +_), transformSymexp(c)) : c;
+ };
+
+ return linearish(scale);
+}
+
+function symlog() {
+ var scale = symlogish(transformer$1());
+
+ scale.copy = function() {
+ return copy(scale, symlog()).constant(scale.constant());
+ };
+
+ return initRange.apply(scale, arguments);
+}
+
+function transformPow(exponent) {
+ return function(x) {
+ return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);
+ };
+}
+
+function transformSqrt(x) {
+ return x < 0 ? -Math.sqrt(-x) : Math.sqrt(x);
+}
+
+function transformSquare(x) {
+ return x < 0 ? -x * x : x * x;
+}
+
+function powish(transform) {
+ var scale = transform(identity$6, identity$6),
+ exponent = 1;
+
+ function rescale() {
+ return exponent === 1 ? transform(identity$6, identity$6)
+ : exponent === 0.5 ? transform(transformSqrt, transformSquare)
+ : transform(transformPow(exponent), transformPow(1 / exponent));
+ }
+
+ scale.exponent = function(_) {
+ return arguments.length ? (exponent = +_, rescale()) : exponent;
+ };
+
+ return linearish(scale);
+}
+
+function pow$1() {
+ var scale = powish(transformer$1());
+
+ scale.copy = function() {
+ return copy(scale, pow$1()).exponent(scale.exponent());
+ };
+
+ initRange.apply(scale, arguments);
+
+ return scale;
+}
+
+function sqrt$1() {
+ return pow$1.apply(null, arguments).exponent(0.5);
+}
+
+function quantile$$1() {
+ var domain = [],
+ range = [],
+ thresholds = [],
+ unknown;
+
+ function rescale() {
+ var i = 0, n = Math.max(1, range.length);
+ thresholds = new Array(n - 1);
+ while (++i < n) thresholds[i - 1] = threshold(domain, i / n);
+ return scale;
+ }
+
+ function scale(x) {
+ return isNaN(x = +x) ? unknown : range[bisectRight(thresholds, x)];
+ }
+
+ scale.invertExtent = function(y) {
+ var i = range.indexOf(y);
+ return i < 0 ? [NaN, NaN] : [
+ i > 0 ? thresholds[i - 1] : domain[0],
+ i < thresholds.length ? thresholds[i] : domain[domain.length - 1]
+ ];
+ };
+
+ scale.domain = function(_) {
+ if (!arguments.length) return domain.slice();
+ domain = [];
+ for (var i = 0, n = _.length, d; i < n; ++i) if (d = _[i], d != null && !isNaN(d = +d)) domain.push(d);
+ domain.sort(ascending);
+ return rescale();
+ };
+
+ scale.range = function(_) {
+ return arguments.length ? (range = slice$5.call(_), rescale()) : range.slice();
+ };
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+
+ scale.quantiles = function() {
+ return thresholds.slice();
+ };
+
+ scale.copy = function() {
+ return quantile$$1()
+ .domain(domain)
+ .range(range)
+ .unknown(unknown);
+ };
+
+ return initRange.apply(scale, arguments);
+}
+
+function quantize$1() {
+ var x0 = 0,
+ x1 = 1,
+ n = 1,
+ domain = [0.5],
+ range = [0, 1],
+ unknown;
+
+ function scale(x) {
+ return x <= x ? range[bisectRight(domain, x, 0, n)] : unknown;
+ }
+
+ function rescale() {
+ var i = -1;
+ domain = new Array(n);
+ while (++i < n) domain[i] = ((i + 1) * x1 - (i - n) * x0) / (n + 1);
+ return scale;
+ }
+
+ scale.domain = function(_) {
+ return arguments.length ? (x0 = +_[0], x1 = +_[1], rescale()) : [x0, x1];
+ };
+
+ scale.range = function(_) {
+ return arguments.length ? (n = (range = slice$5.call(_)).length - 1, rescale()) : range.slice();
+ };
+
+ scale.invertExtent = function(y) {
+ var i = range.indexOf(y);
+ return i < 0 ? [NaN, NaN]
+ : i < 1 ? [x0, domain[0]]
+ : i >= n ? [domain[n - 1], x1]
+ : [domain[i - 1], domain[i]];
+ };
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : scale;
+ };
+
+ scale.thresholds = function() {
+ return domain.slice();
+ };
+
+ scale.copy = function() {
+ return quantize$1()
+ .domain([x0, x1])
+ .range(range)
+ .unknown(unknown);
+ };
+
+ return initRange.apply(linearish(scale), arguments);
+}
+
+function threshold$1() {
+ var domain = [0.5],
+ range = [0, 1],
+ unknown,
+ n = 1;
+
+ function scale(x) {
+ return x <= x ? range[bisectRight(domain, x, 0, n)] : unknown;
+ }
+
+ scale.domain = function(_) {
+ return arguments.length ? (domain = slice$5.call(_), n = Math.min(domain.length, range.length - 1), scale) : domain.slice();
+ };
+
+ scale.range = function(_) {
+ return arguments.length ? (range = slice$5.call(_), n = Math.min(domain.length, range.length - 1), scale) : range.slice();
+ };
+
+ scale.invertExtent = function(y) {
+ var i = range.indexOf(y);
+ return [domain[i - 1], domain[i]];
+ };
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+
+ scale.copy = function() {
+ return threshold$1()
+ .domain(domain)
+ .range(range)
+ .unknown(unknown);
+ };
+
+ return initRange.apply(scale, arguments);
+}
+
+var t0$1 = new Date,
+ t1$1 = new Date;
+
+function newInterval(floori, offseti, count, field) {
+
+ function interval(date) {
+ return floori(date = new Date(+date)), date;
+ }
+
+ interval.floor = interval;
+
+ interval.ceil = function(date) {
+ return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;
+ };
+
+ interval.round = function(date) {
+ var d0 = interval(date),
+ d1 = interval.ceil(date);
+ return date - d0 < d1 - date ? d0 : d1;
+ };
+
+ interval.offset = function(date, step) {
+ return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;
+ };
+
+ interval.range = function(start, stop, step) {
+ var range = [], previous;
+ start = interval.ceil(start);
+ step = step == null ? 1 : Math.floor(step);
+ if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date
+ do range.push(previous = new Date(+start)), offseti(start, step), floori(start);
+ while (previous < start && start < stop);
+ return range;
+ };
+
+ interval.filter = function(test) {
+ return newInterval(function(date) {
+ if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);
+ }, function(date, step) {
+ if (date >= date) {
+ if (step < 0) while (++step <= 0) {
+ while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty
+ } else while (--step >= 0) {
+ while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty
+ }
+ }
+ });
+ };
+
+ if (count) {
+ interval.count = function(start, end) {
+ t0$1.setTime(+start), t1$1.setTime(+end);
+ floori(t0$1), floori(t1$1);
+ return Math.floor(count(t0$1, t1$1));
+ };
+
+ interval.every = function(step) {
+ step = Math.floor(step);
+ return !isFinite(step) || !(step > 0) ? null
+ : !(step > 1) ? interval
+ : interval.filter(field
+ ? function(d) { return field(d) % step === 0; }
+ : function(d) { return interval.count(0, d) % step === 0; });
+ };
+ }
+
+ return interval;
+}
+
+var millisecond = newInterval(function() {
+ // noop
+}, function(date, step) {
+ date.setTime(+date + step);
+}, function(start, end) {
+ return end - start;
+});
+
+// An optimized implementation for this simple case.
+millisecond.every = function(k) {
+ k = Math.floor(k);
+ if (!isFinite(k) || !(k > 0)) return null;
+ if (!(k > 1)) return millisecond;
+ return newInterval(function(date) {
+ date.setTime(Math.floor(date / k) * k);
+ }, function(date, step) {
+ date.setTime(+date + step * k);
+ }, function(start, end) {
+ return (end - start) / k;
+ });
+};
+var milliseconds = millisecond.range;
+
+var durationSecond = 1e3;
+var durationMinute = 6e4;
+var durationHour = 36e5;
+var durationDay = 864e5;
+var durationWeek = 6048e5;
+
+var second = newInterval(function(date) {
+ date.setTime(date - date.getMilliseconds());
+}, function(date, step) {
+ date.setTime(+date + step * durationSecond);
+}, function(start, end) {
+ return (end - start) / durationSecond;
+}, function(date) {
+ return date.getUTCSeconds();
+});
+var seconds = second.range;
+
+var minute = newInterval(function(date) {
+ date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);
+}, function(date, step) {
+ date.setTime(+date + step * durationMinute);
+}, function(start, end) {
+ return (end - start) / durationMinute;
+}, function(date) {
+ return date.getMinutes();
+});
+var minutes = minute.range;
+
+var hour = newInterval(function(date) {
+ date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);
+}, function(date, step) {
+ date.setTime(+date + step * durationHour);
+}, function(start, end) {
+ return (end - start) / durationHour;
+}, function(date) {
+ return date.getHours();
+});
+var hours = hour.range;
+
+var day = newInterval(function(date) {
+ date.setHours(0, 0, 0, 0);
+}, function(date, step) {
+ date.setDate(date.getDate() + step);
+}, function(start, end) {
+ return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay;
+}, function(date) {
+ return date.getDate() - 1;
+});
+var days = day.range;
+
+function weekday(i) {
+ return newInterval(function(date) {
+ date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
+ date.setHours(0, 0, 0, 0);
+ }, function(date, step) {
+ date.setDate(date.getDate() + step * 7);
+ }, function(start, end) {
+ return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;
+ });
+}
+
+var sunday = weekday(0);
+var monday = weekday(1);
+var tuesday = weekday(2);
+var wednesday = weekday(3);
+var thursday = weekday(4);
+var friday = weekday(5);
+var saturday = weekday(6);
+
+var sundays = sunday.range;
+var mondays = monday.range;
+var tuesdays = tuesday.range;
+var wednesdays = wednesday.range;
+var thursdays = thursday.range;
+var fridays = friday.range;
+var saturdays = saturday.range;
+
+var month = newInterval(function(date) {
+ date.setDate(1);
+ date.setHours(0, 0, 0, 0);
+}, function(date, step) {
+ date.setMonth(date.getMonth() + step);
+}, function(start, end) {
+ return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
+}, function(date) {
+ return date.getMonth();
+});
+var months = month.range;
+
+var year = newInterval(function(date) {
+ date.setMonth(0, 1);
+ date.setHours(0, 0, 0, 0);
+}, function(date, step) {
+ date.setFullYear(date.getFullYear() + step);
+}, function(start, end) {
+ return end.getFullYear() - start.getFullYear();
+}, function(date) {
+ return date.getFullYear();
+});
+
+// An optimized implementation for this simple case.
+year.every = function(k) {
+ return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) {
+ date.setFullYear(Math.floor(date.getFullYear() / k) * k);
+ date.setMonth(0, 1);
+ date.setHours(0, 0, 0, 0);
+ }, function(date, step) {
+ date.setFullYear(date.getFullYear() + step * k);
+ });
+};
+var years = year.range;
+
+var utcMinute = newInterval(function(date) {
+ date.setUTCSeconds(0, 0);
+}, function(date, step) {
+ date.setTime(+date + step * durationMinute);
+}, function(start, end) {
+ return (end - start) / durationMinute;
+}, function(date) {
+ return date.getUTCMinutes();
+});
+var utcMinutes = utcMinute.range;
+
+var utcHour = newInterval(function(date) {
+ date.setUTCMinutes(0, 0, 0);
+}, function(date, step) {
+ date.setTime(+date + step * durationHour);
+}, function(start, end) {
+ return (end - start) / durationHour;
+}, function(date) {
+ return date.getUTCHours();
+});
+var utcHours = utcHour.range;
+
+var utcDay = newInterval(function(date) {
+ date.setUTCHours(0, 0, 0, 0);
+}, function(date, step) {
+ date.setUTCDate(date.getUTCDate() + step);
+}, function(start, end) {
+ return (end - start) / durationDay;
+}, function(date) {
+ return date.getUTCDate() - 1;
+});
+var utcDays = utcDay.range;
+
+function utcWeekday(i) {
+ return newInterval(function(date) {
+ date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
+ date.setUTCHours(0, 0, 0, 0);
+ }, function(date, step) {
+ date.setUTCDate(date.getUTCDate() + step * 7);
+ }, function(start, end) {
+ return (end - start) / durationWeek;
+ });
+}
+
+var utcSunday = utcWeekday(0);
+var utcMonday = utcWeekday(1);
+var utcTuesday = utcWeekday(2);
+var utcWednesday = utcWeekday(3);
+var utcThursday = utcWeekday(4);
+var utcFriday = utcWeekday(5);
+var utcSaturday = utcWeekday(6);
+
+var utcSundays = utcSunday.range;
+var utcMondays = utcMonday.range;
+var utcTuesdays = utcTuesday.range;
+var utcWednesdays = utcWednesday.range;
+var utcThursdays = utcThursday.range;
+var utcFridays = utcFriday.range;
+var utcSaturdays = utcSaturday.range;
+
+var utcMonth = newInterval(function(date) {
+ date.setUTCDate(1);
+ date.setUTCHours(0, 0, 0, 0);
+}, function(date, step) {
+ date.setUTCMonth(date.getUTCMonth() + step);
+}, function(start, end) {
+ return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;
+}, function(date) {
+ return date.getUTCMonth();
+});
+var utcMonths = utcMonth.range;
+
+var utcYear = newInterval(function(date) {
+ date.setUTCMonth(0, 1);
+ date.setUTCHours(0, 0, 0, 0);
+}, function(date, step) {
+ date.setUTCFullYear(date.getUTCFullYear() + step);
+}, function(start, end) {
+ return end.getUTCFullYear() - start.getUTCFullYear();
+}, function(date) {
+ return date.getUTCFullYear();
+});
+
+// An optimized implementation for this simple case.
+utcYear.every = function(k) {
+ return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) {
+ date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);
+ date.setUTCMonth(0, 1);
+ date.setUTCHours(0, 0, 0, 0);
+ }, function(date, step) {
+ date.setUTCFullYear(date.getUTCFullYear() + step * k);
+ });
+};
+var utcYears = utcYear.range;
+
+function localDate(d) {
+ if (0 <= d.y && d.y < 100) {
+ var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);
+ date.setFullYear(d.y);
+ return date;
+ }
+ return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);
+}
+
+function utcDate(d) {
+ if (0 <= d.y && d.y < 100) {
+ var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));
+ date.setUTCFullYear(d.y);
+ return date;
+ }
+ return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));
+}
+
+function newYear(y) {
+ return {y: y, m: 0, d: 1, H: 0, M: 0, S: 0, L: 0};
+}
+
+function formatLocale$1(locale) {
+ var locale_dateTime = locale.dateTime,
+ locale_date = locale.date,
+ locale_time = locale.time,
+ locale_periods = locale.periods,
+ locale_weekdays = locale.days,
+ locale_shortWeekdays = locale.shortDays,
+ locale_months = locale.months,
+ locale_shortMonths = locale.shortMonths;
+
+ var periodRe = formatRe(locale_periods),
+ periodLookup = formatLookup(locale_periods),
+ weekdayRe = formatRe(locale_weekdays),
+ weekdayLookup = formatLookup(locale_weekdays),
+ shortWeekdayRe = formatRe(locale_shortWeekdays),
+ shortWeekdayLookup = formatLookup(locale_shortWeekdays),
+ monthRe = formatRe(locale_months),
+ monthLookup = formatLookup(locale_months),
+ shortMonthRe = formatRe(locale_shortMonths),
+ shortMonthLookup = formatLookup(locale_shortMonths);
+
+ var formats = {
+ "a": formatShortWeekday,
+ "A": formatWeekday,
+ "b": formatShortMonth,
+ "B": formatMonth,
+ "c": null,
+ "d": formatDayOfMonth,
+ "e": formatDayOfMonth,
+ "f": formatMicroseconds,
+ "H": formatHour24,
+ "I": formatHour12,
+ "j": formatDayOfYear,
+ "L": formatMilliseconds,
+ "m": formatMonthNumber,
+ "M": formatMinutes,
+ "p": formatPeriod,
+ "Q": formatUnixTimestamp,
+ "s": formatUnixTimestampSeconds,
+ "S": formatSeconds,
+ "u": formatWeekdayNumberMonday,
+ "U": formatWeekNumberSunday,
+ "V": formatWeekNumberISO,
+ "w": formatWeekdayNumberSunday,
+ "W": formatWeekNumberMonday,
+ "x": null,
+ "X": null,
+ "y": formatYear$1,
+ "Y": formatFullYear,
+ "Z": formatZone,
+ "%": formatLiteralPercent
+ };
+
+ var utcFormats = {
+ "a": formatUTCShortWeekday,
+ "A": formatUTCWeekday,
+ "b": formatUTCShortMonth,
+ "B": formatUTCMonth,
+ "c": null,
+ "d": formatUTCDayOfMonth,
+ "e": formatUTCDayOfMonth,
+ "f": formatUTCMicroseconds,
+ "H": formatUTCHour24,
+ "I": formatUTCHour12,
+ "j": formatUTCDayOfYear,
+ "L": formatUTCMilliseconds,
+ "m": formatUTCMonthNumber,
+ "M": formatUTCMinutes,
+ "p": formatUTCPeriod,
+ "Q": formatUnixTimestamp,
+ "s": formatUnixTimestampSeconds,
+ "S": formatUTCSeconds,
+ "u": formatUTCWeekdayNumberMonday,
+ "U": formatUTCWeekNumberSunday,
+ "V": formatUTCWeekNumberISO,
+ "w": formatUTCWeekdayNumberSunday,
+ "W": formatUTCWeekNumberMonday,
+ "x": null,
+ "X": null,
+ "y": formatUTCYear,
+ "Y": formatUTCFullYear,
+ "Z": formatUTCZone,
+ "%": formatLiteralPercent
+ };
+
+ var parses = {
+ "a": parseShortWeekday,
+ "A": parseWeekday,
+ "b": parseShortMonth,
+ "B": parseMonth,
+ "c": parseLocaleDateTime,
+ "d": parseDayOfMonth,
+ "e": parseDayOfMonth,
+ "f": parseMicroseconds,
+ "H": parseHour24,
+ "I": parseHour24,
+ "j": parseDayOfYear,
+ "L": parseMilliseconds,
+ "m": parseMonthNumber,
+ "M": parseMinutes,
+ "p": parsePeriod,
+ "Q": parseUnixTimestamp,
+ "s": parseUnixTimestampSeconds,
+ "S": parseSeconds,
+ "u": parseWeekdayNumberMonday,
+ "U": parseWeekNumberSunday,
+ "V": parseWeekNumberISO,
+ "w": parseWeekdayNumberSunday,
+ "W": parseWeekNumberMonday,
+ "x": parseLocaleDate,
+ "X": parseLocaleTime,
+ "y": parseYear,
+ "Y": parseFullYear,
+ "Z": parseZone,
+ "%": parseLiteralPercent
+ };
+
+ // These recursive directive definitions must be deferred.
+ formats.x = newFormat(locale_date, formats);
+ formats.X = newFormat(locale_time, formats);
+ formats.c = newFormat(locale_dateTime, formats);
+ utcFormats.x = newFormat(locale_date, utcFormats);
+ utcFormats.X = newFormat(locale_time, utcFormats);
+ utcFormats.c = newFormat(locale_dateTime, utcFormats);
+
+ function newFormat(specifier, formats) {
+ return function(date) {
+ var string = [],
+ i = -1,
+ j = 0,
+ n = specifier.length,
+ c,
+ pad,
+ format;
+
+ if (!(date instanceof Date)) date = new Date(+date);
+
+ while (++i < n) {
+ if (specifier.charCodeAt(i) === 37) {
+ string.push(specifier.slice(j, i));
+ if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);
+ else pad = c === "e" ? " " : "0";
+ if (format = formats[c]) c = format(date, pad);
+ string.push(c);
+ j = i + 1;
+ }
+ }
+
+ string.push(specifier.slice(j, i));
+ return string.join("");
+ };
+ }
+
+ function newParse(specifier, newDate) {
+ return function(string) {
+ var d = newYear(1900),
+ i = parseSpecifier(d, specifier, string += "", 0),
+ week, day$$1;
+ if (i != string.length) return null;
+
+ // If a UNIX timestamp is specified, return it.
+ if ("Q" in d) return new Date(d.Q);
+
+ // The am-pm flag is 0 for AM, and 1 for PM.
+ if ("p" in d) d.H = d.H % 12 + d.p * 12;
+
+ // Convert day-of-week and week-of-year to day-of-year.
+ if ("V" in d) {
+ if (d.V < 1 || d.V > 53) return null;
+ if (!("w" in d)) d.w = 1;
+ if ("Z" in d) {
+ week = utcDate(newYear(d.y)), day$$1 = week.getUTCDay();
+ week = day$$1 > 4 || day$$1 === 0 ? utcMonday.ceil(week) : utcMonday(week);
+ week = utcDay.offset(week, (d.V - 1) * 7);
+ d.y = week.getUTCFullYear();
+ d.m = week.getUTCMonth();
+ d.d = week.getUTCDate() + (d.w + 6) % 7;
+ } else {
+ week = newDate(newYear(d.y)), day$$1 = week.getDay();
+ week = day$$1 > 4 || day$$1 === 0 ? monday.ceil(week) : monday(week);
+ week = day.offset(week, (d.V - 1) * 7);
+ d.y = week.getFullYear();
+ d.m = week.getMonth();
+ d.d = week.getDate() + (d.w + 6) % 7;
+ }
+ } else if ("W" in d || "U" in d) {
+ if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0;
+ day$$1 = "Z" in d ? utcDate(newYear(d.y)).getUTCDay() : newDate(newYear(d.y)).getDay();
+ d.m = 0;
+ d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day$$1 + 5) % 7 : d.w + d.U * 7 - (day$$1 + 6) % 7;
+ }
+
+ // If a time zone is specified, all fields are interpreted as UTC and then
+ // offset according to the specified time zone.
+ if ("Z" in d) {
+ d.H += d.Z / 100 | 0;
+ d.M += d.Z % 100;
+ return utcDate(d);
+ }
+
+ // Otherwise, all fields are in local time.
+ return newDate(d);
+ };
+ }
+
+ function parseSpecifier(d, specifier, string, j) {
+ var i = 0,
+ n = specifier.length,
+ m = string.length,
+ c,
+ parse;
+
+ while (i < n) {
+ if (j >= m) return -1;
+ c = specifier.charCodeAt(i++);
+ if (c === 37) {
+ c = specifier.charAt(i++);
+ parse = parses[c in pads ? specifier.charAt(i++) : c];
+ if (!parse || ((j = parse(d, string, j)) < 0)) return -1;
+ } else if (c != string.charCodeAt(j++)) {
+ return -1;
+ }
+ }
+
+ return j;
+ }
+
+ function parsePeriod(d, string, i) {
+ var n = periodRe.exec(string.slice(i));
+ return n ? (d.p = periodLookup[n[0].toLowerCase()], i + n[0].length) : -1;
+ }
+
+ function parseShortWeekday(d, string, i) {
+ var n = shortWeekdayRe.exec(string.slice(i));
+ return n ? (d.w = shortWeekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1;
+ }
+
+ function parseWeekday(d, string, i) {
+ var n = weekdayRe.exec(string.slice(i));
+ return n ? (d.w = weekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1;
+ }
+
+ function parseShortMonth(d, string, i) {
+ var n = shortMonthRe.exec(string.slice(i));
+ return n ? (d.m = shortMonthLookup[n[0].toLowerCase()], i + n[0].length) : -1;
+ }
+
+ function parseMonth(d, string, i) {
+ var n = monthRe.exec(string.slice(i));
+ return n ? (d.m = monthLookup[n[0].toLowerCase()], i + n[0].length) : -1;
+ }
+
+ function parseLocaleDateTime(d, string, i) {
+ return parseSpecifier(d, locale_dateTime, string, i);
+ }
+
+ function parseLocaleDate(d, string, i) {
+ return parseSpecifier(d, locale_date, string, i);
+ }
+
+ function parseLocaleTime(d, string, i) {
+ return parseSpecifier(d, locale_time, string, i);
+ }
+
+ function formatShortWeekday(d) {
+ return locale_shortWeekdays[d.getDay()];
+ }
+
+ function formatWeekday(d) {
+ return locale_weekdays[d.getDay()];
+ }
+
+ function formatShortMonth(d) {
+ return locale_shortMonths[d.getMonth()];
+ }
+
+ function formatMonth(d) {
+ return locale_months[d.getMonth()];
+ }
+
+ function formatPeriod(d) {
+ return locale_periods[+(d.getHours() >= 12)];
+ }
+
+ function formatUTCShortWeekday(d) {
+ return locale_shortWeekdays[d.getUTCDay()];
+ }
+
+ function formatUTCWeekday(d) {
+ return locale_weekdays[d.getUTCDay()];
+ }
+
+ function formatUTCShortMonth(d) {
+ return locale_shortMonths[d.getUTCMonth()];
+ }
+
+ function formatUTCMonth(d) {
+ return locale_months[d.getUTCMonth()];
+ }
+
+ function formatUTCPeriod(d) {
+ return locale_periods[+(d.getUTCHours() >= 12)];
+ }
+
+ return {
+ format: function(specifier) {
+ var f = newFormat(specifier += "", formats);
+ f.toString = function() { return specifier; };
+ return f;
+ },
+ parse: function(specifier) {
+ var p = newParse(specifier += "", localDate);
+ p.toString = function() { return specifier; };
+ return p;
+ },
+ utcFormat: function(specifier) {
+ var f = newFormat(specifier += "", utcFormats);
+ f.toString = function() { return specifier; };
+ return f;
+ },
+ utcParse: function(specifier) {
+ var p = newParse(specifier, utcDate);
+ p.toString = function() { return specifier; };
+ return p;
+ }
+ };
+}
+
+var pads = {"-": "", "_": " ", "0": "0"},
+ numberRe = /^\s*\d+/, // note: ignores next directive
+ percentRe = /^%/,
+ requoteRe = /[\\^$*+?|[\]().{}]/g;
+
+function pad$1(value, fill, width) {
+ var sign = value < 0 ? "-" : "",
+ string = (sign ? -value : value) + "",
+ length = string.length;
+ return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);
+}
+
+function requote(s) {
+ return s.replace(requoteRe, "\\$&");
+}
+
+function formatRe(names) {
+ return new RegExp("^(?:" + names.map(requote).join("|") + ")", "i");
+}
+
+function formatLookup(names) {
+ var map = {}, i = -1, n = names.length;
+ while (++i < n) map[names[i].toLowerCase()] = i;
+ return map;
+}
+
+function parseWeekdayNumberSunday(d, string, i) {
+ var n = numberRe.exec(string.slice(i, i + 1));
+ return n ? (d.w = +n[0], i + n[0].length) : -1;
+}
+
+function parseWeekdayNumberMonday(d, string, i) {
+ var n = numberRe.exec(string.slice(i, i + 1));
+ return n ? (d.u = +n[0], i + n[0].length) : -1;
+}
+
+function parseWeekNumberSunday(d, string, i) {
+ var n = numberRe.exec(string.slice(i, i + 2));
+ return n ? (d.U = +n[0], i + n[0].length) : -1;
+}
+
+function parseWeekNumberISO(d, string, i) {
+ var n = numberRe.exec(string.slice(i, i + 2));
+ return n ? (d.V = +n[0], i + n[0].length) : -1;
+}
+
+function parseWeekNumberMonday(d, string, i) {
+ var n = numberRe.exec(string.slice(i, i + 2));
+ return n ? (d.W = +n[0], i + n[0].length) : -1;
+}
+
+function parseFullYear(d, string, i) {
+ var n = numberRe.exec(string.slice(i, i + 4));
+ return n ? (d.y = +n[0], i + n[0].length) : -1;
+}
+
+function parseYear(d, string, i) {
+ var n = numberRe.exec(string.slice(i, i + 2));
+ return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;
+}
+
+function parseZone(d, string, i) {
+ var n = /^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(string.slice(i, i + 6));
+ return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || "00")), i + n[0].length) : -1;
+}
+
+function parseMonthNumber(d, string, i) {
+ var n = numberRe.exec(string.slice(i, i + 2));
+ return n ? (d.m = n[0] - 1, i + n[0].length) : -1;
+}
+
+function parseDayOfMonth(d, string, i) {
+ var n = numberRe.exec(string.slice(i, i + 2));
+ return n ? (d.d = +n[0], i + n[0].length) : -1;
+}
+
+function parseDayOfYear(d, string, i) {
+ var n = numberRe.exec(string.slice(i, i + 3));
+ return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;
+}
+
+function parseHour24(d, string, i) {
+ var n = numberRe.exec(string.slice(i, i + 2));
+ return n ? (d.H = +n[0], i + n[0].length) : -1;
+}
+
+function parseMinutes(d, string, i) {
+ var n = numberRe.exec(string.slice(i, i + 2));
+ return n ? (d.M = +n[0], i + n[0].length) : -1;
+}
+
+function parseSeconds(d, string, i) {
+ var n = numberRe.exec(string.slice(i, i + 2));
+ return n ? (d.S = +n[0], i + n[0].length) : -1;
+}
+
+function parseMilliseconds(d, string, i) {
+ var n = numberRe.exec(string.slice(i, i + 3));
+ return n ? (d.L = +n[0], i + n[0].length) : -1;
+}
+
+function parseMicroseconds(d, string, i) {
+ var n = numberRe.exec(string.slice(i, i + 6));
+ return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;
+}
+
+function parseLiteralPercent(d, string, i) {
+ var n = percentRe.exec(string.slice(i, i + 1));
+ return n ? i + n[0].length : -1;
+}
+
+function parseUnixTimestamp(d, string, i) {
+ var n = numberRe.exec(string.slice(i));
+ return n ? (d.Q = +n[0], i + n[0].length) : -1;
+}
+
+function parseUnixTimestampSeconds(d, string, i) {
+ var n = numberRe.exec(string.slice(i));
+ return n ? (d.Q = (+n[0]) * 1000, i + n[0].length) : -1;
+}
+
+function formatDayOfMonth(d, p) {
+ return pad$1(d.getDate(), p, 2);
+}
+
+function formatHour24(d, p) {
+ return pad$1(d.getHours(), p, 2);
+}
+
+function formatHour12(d, p) {
+ return pad$1(d.getHours() % 12 || 12, p, 2);
+}
+
+function formatDayOfYear(d, p) {
+ return pad$1(1 + day.count(year(d), d), p, 3);
+}
+
+function formatMilliseconds(d, p) {
+ return pad$1(d.getMilliseconds(), p, 3);
+}
+
+function formatMicroseconds(d, p) {
+ return formatMilliseconds(d, p) + "000";
+}
+
+function formatMonthNumber(d, p) {
+ return pad$1(d.getMonth() + 1, p, 2);
+}
+
+function formatMinutes(d, p) {
+ return pad$1(d.getMinutes(), p, 2);
+}
+
+function formatSeconds(d, p) {
+ return pad$1(d.getSeconds(), p, 2);
+}
+
+function formatWeekdayNumberMonday(d) {
+ var day$$1 = d.getDay();
+ return day$$1 === 0 ? 7 : day$$1;
+}
+
+function formatWeekNumberSunday(d, p) {
+ return pad$1(sunday.count(year(d), d), p, 2);
+}
+
+function formatWeekNumberISO(d, p) {
+ var day$$1 = d.getDay();
+ d = (day$$1 >= 4 || day$$1 === 0) ? thursday(d) : thursday.ceil(d);
+ return pad$1(thursday.count(year(d), d) + (year(d).getDay() === 4), p, 2);
+}
+
+function formatWeekdayNumberSunday(d) {
+ return d.getDay();
+}
+
+function formatWeekNumberMonday(d, p) {
+ return pad$1(monday.count(year(d), d), p, 2);
+}
+
+function formatYear$1(d, p) {
+ return pad$1(d.getFullYear() % 100, p, 2);
+}
+
+function formatFullYear(d, p) {
+ return pad$1(d.getFullYear() % 10000, p, 4);
+}
+
+function formatZone(d) {
+ var z = d.getTimezoneOffset();
+ return (z > 0 ? "-" : (z *= -1, "+"))
+ + pad$1(z / 60 | 0, "0", 2)
+ + pad$1(z % 60, "0", 2);
+}
+
+function formatUTCDayOfMonth(d, p) {
+ return pad$1(d.getUTCDate(), p, 2);
+}
+
+function formatUTCHour24(d, p) {
+ return pad$1(d.getUTCHours(), p, 2);
+}
+
+function formatUTCHour12(d, p) {
+ return pad$1(d.getUTCHours() % 12 || 12, p, 2);
+}
+
+function formatUTCDayOfYear(d, p) {
+ return pad$1(1 + utcDay.count(utcYear(d), d), p, 3);
+}
+
+function formatUTCMilliseconds(d, p) {
+ return pad$1(d.getUTCMilliseconds(), p, 3);
+}
+
+function formatUTCMicroseconds(d, p) {
+ return formatUTCMilliseconds(d, p) + "000";
+}
+
+function formatUTCMonthNumber(d, p) {
+ return pad$1(d.getUTCMonth() + 1, p, 2);
+}
+
+function formatUTCMinutes(d, p) {
+ return pad$1(d.getUTCMinutes(), p, 2);
+}
+
+function formatUTCSeconds(d, p) {
+ return pad$1(d.getUTCSeconds(), p, 2);
+}
+
+function formatUTCWeekdayNumberMonday(d) {
+ var dow = d.getUTCDay();
+ return dow === 0 ? 7 : dow;
+}
+
+function formatUTCWeekNumberSunday(d, p) {
+ return pad$1(utcSunday.count(utcYear(d), d), p, 2);
+}
+
+function formatUTCWeekNumberISO(d, p) {
+ var day$$1 = d.getUTCDay();
+ d = (day$$1 >= 4 || day$$1 === 0) ? utcThursday(d) : utcThursday.ceil(d);
+ return pad$1(utcThursday.count(utcYear(d), d) + (utcYear(d).getUTCDay() === 4), p, 2);
+}
+
+function formatUTCWeekdayNumberSunday(d) {
+ return d.getUTCDay();
+}
+
+function formatUTCWeekNumberMonday(d, p) {
+ return pad$1(utcMonday.count(utcYear(d), d), p, 2);
+}
+
+function formatUTCYear(d, p) {
+ return pad$1(d.getUTCFullYear() % 100, p, 2);
+}
+
+function formatUTCFullYear(d, p) {
+ return pad$1(d.getUTCFullYear() % 10000, p, 4);
+}
+
+function formatUTCZone() {
+ return "+0000";
+}
+
+function formatLiteralPercent() {
+ return "%";
+}
+
+function formatUnixTimestamp(d) {
+ return +d;
+}
+
+function formatUnixTimestampSeconds(d) {
+ return Math.floor(+d / 1000);
+}
+
+var locale$1;
+
+defaultLocale$1({
+ dateTime: "%x, %X",
+ date: "%-m/%-d/%Y",
+ time: "%-I:%M:%S %p",
+ periods: ["AM", "PM"],
+ days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
+ shortDays: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
+ months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
+ shortMonths: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
+});
+
+function defaultLocale$1(definition) {
+ locale$1 = formatLocale$1(definition);
+ exports.timeFormat = locale$1.format;
+ exports.timeParse = locale$1.parse;
+ exports.utcFormat = locale$1.utcFormat;
+ exports.utcParse = locale$1.utcParse;
+ return locale$1;
+}
+
+var isoSpecifier = "%Y-%m-%dT%H:%M:%S.%LZ";
+
+function formatIsoNative(date) {
+ return date.toISOString();
+}
+
+var formatIso = Date.prototype.toISOString
+ ? formatIsoNative
+ : exports.utcFormat(isoSpecifier);
+
+function parseIsoNative(string) {
+ var date = new Date(string);
+ return isNaN(date) ? null : date;
+}
+
+var parseIso = +new Date("2000-01-01T00:00:00.000Z")
+ ? parseIsoNative
+ : exports.utcParse(isoSpecifier);
+
+var durationSecond$1 = 1000,
+ durationMinute$1 = durationSecond$1 * 60,
+ durationHour$1 = durationMinute$1 * 60,
+ durationDay$1 = durationHour$1 * 24,
+ durationWeek$1 = durationDay$1 * 7,
+ durationMonth = durationDay$1 * 30,
+ durationYear = durationDay$1 * 365;
+
+function date$1(t) {
+ return new Date(t);
+}
+
+function number$3(t) {
+ return t instanceof Date ? +t : +new Date(+t);
+}
+
+function calendar(year$$1, month$$1, week, day$$1, hour$$1, minute$$1, second$$1, millisecond$$1, format) {
+ var scale = continuous(identity$6, identity$6),
+ invert = scale.invert,
+ domain = scale.domain;
+
+ var formatMillisecond = format(".%L"),
+ formatSecond = format(":%S"),
+ formatMinute = format("%I:%M"),
+ formatHour = format("%I %p"),
+ formatDay = format("%a %d"),
+ formatWeek = format("%b %d"),
+ formatMonth = format("%B"),
+ formatYear = format("%Y");
+
+ var tickIntervals = [
+ [second$$1, 1, durationSecond$1],
+ [second$$1, 5, 5 * durationSecond$1],
+ [second$$1, 15, 15 * durationSecond$1],
+ [second$$1, 30, 30 * durationSecond$1],
+ [minute$$1, 1, durationMinute$1],
+ [minute$$1, 5, 5 * durationMinute$1],
+ [minute$$1, 15, 15 * durationMinute$1],
+ [minute$$1, 30, 30 * durationMinute$1],
+ [ hour$$1, 1, durationHour$1 ],
+ [ hour$$1, 3, 3 * durationHour$1 ],
+ [ hour$$1, 6, 6 * durationHour$1 ],
+ [ hour$$1, 12, 12 * durationHour$1 ],
+ [ day$$1, 1, durationDay$1 ],
+ [ day$$1, 2, 2 * durationDay$1 ],
+ [ week, 1, durationWeek$1 ],
+ [ month$$1, 1, durationMonth ],
+ [ month$$1, 3, 3 * durationMonth ],
+ [ year$$1, 1, durationYear ]
+ ];
+
+ function tickFormat(date) {
+ return (second$$1(date) < date ? formatMillisecond
+ : minute$$1(date) < date ? formatSecond
+ : hour$$1(date) < date ? formatMinute
+ : day$$1(date) < date ? formatHour
+ : month$$1(date) < date ? (week(date) < date ? formatDay : formatWeek)
+ : year$$1(date) < date ? formatMonth
+ : formatYear)(date);
+ }
+
+ function tickInterval(interval, start, stop, step) {
+ if (interval == null) interval = 10;
+
+ // If a desired tick count is specified, pick a reasonable tick interval
+ // based on the extent of the domain and a rough estimate of tick size.
+ // Otherwise, assume interval is already a time interval and use it.
+ if (typeof interval === "number") {
+ var target = Math.abs(stop - start) / interval,
+ i = bisector(function(i) { return i[2]; }).right(tickIntervals, target);
+ if (i === tickIntervals.length) {
+ step = tickStep(start / durationYear, stop / durationYear, interval);
+ interval = year$$1;
+ } else if (i) {
+ i = tickIntervals[target / tickIntervals[i - 1][2] < tickIntervals[i][2] / target ? i - 1 : i];
+ step = i[1];
+ interval = i[0];
+ } else {
+ step = Math.max(tickStep(start, stop, interval), 1);
+ interval = millisecond$$1;
+ }
+ }
+
+ return step == null ? interval : interval.every(step);
+ }
+
+ scale.invert = function(y) {
+ return new Date(invert(y));
+ };
+
+ scale.domain = function(_) {
+ return arguments.length ? domain(map$2.call(_, number$3)) : domain().map(date$1);
+ };
+
+ scale.ticks = function(interval, step) {
+ var d = domain(),
+ t0 = d[0],
+ t1 = d[d.length - 1],
+ r = t1 < t0,
+ t;
+ if (r) t = t0, t0 = t1, t1 = t;
+ t = tickInterval(interval, t0, t1, step);
+ t = t ? t.range(t0, t1 + 1) : []; // inclusive stop
+ return r ? t.reverse() : t;
+ };
+
+ scale.tickFormat = function(count, specifier) {
+ return specifier == null ? tickFormat : format(specifier);
+ };
+
+ scale.nice = function(interval, step) {
+ var d = domain();
+ return (interval = tickInterval(interval, d[0], d[d.length - 1], step))
+ ? domain(nice(d, interval))
+ : scale;
+ };
+
+ scale.copy = function() {
+ return copy(scale, calendar(year$$1, month$$1, week, day$$1, hour$$1, minute$$1, second$$1, millisecond$$1, format));
+ };
+
+ return scale;
+}
+
+function time() {
+ return initRange.apply(calendar(year, month, sunday, day, hour, minute, second, millisecond, exports.timeFormat).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);
+}
+
+function utcTime() {
+ return initRange.apply(calendar(utcYear, utcMonth, utcSunday, utcDay, utcHour, utcMinute, second, millisecond, exports.utcFormat).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]), arguments);
+}
+
+function transformer$2() {
+ var x0 = 0,
+ x1 = 1,
+ t0,
+ t1,
+ k10,
+ transform,
+ interpolator = identity$6,
+ clamp = false,
+ unknown;
+
+ function scale(x) {
+ return isNaN(x = +x) ? unknown : interpolator(k10 === 0 ? 0.5 : (x = (transform(x) - t0) * k10, clamp ? Math.max(0, Math.min(1, x)) : x));
+ }
+
+ scale.domain = function(_) {
+ return arguments.length ? (t0 = transform(x0 = +_[0]), t1 = transform(x1 = +_[1]), k10 = t0 === t1 ? 0 : 1 / (t1 - t0), scale) : [x0, x1];
+ };
+
+ scale.clamp = function(_) {
+ return arguments.length ? (clamp = !!_, scale) : clamp;
+ };
+
+ scale.interpolator = function(_) {
+ return arguments.length ? (interpolator = _, scale) : interpolator;
+ };
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+
+ return function(t) {
+ transform = t, t0 = t(x0), t1 = t(x1), k10 = t0 === t1 ? 0 : 1 / (t1 - t0);
+ return scale;
+ };
+}
+
+function copy$1(source, target) {
+ return target
+ .domain(source.domain())
+ .interpolator(source.interpolator())
+ .clamp(source.clamp())
+ .unknown(source.unknown());
+}
+
+function sequential() {
+ var scale = linearish(transformer$2()(identity$6));
+
+ scale.copy = function() {
+ return copy$1(scale, sequential());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+function sequentialLog() {
+ var scale = loggish(transformer$2()).domain([1, 10]);
+
+ scale.copy = function() {
+ return copy$1(scale, sequentialLog()).base(scale.base());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+function sequentialSymlog() {
+ var scale = symlogish(transformer$2());
+
+ scale.copy = function() {
+ return copy$1(scale, sequentialSymlog()).constant(scale.constant());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+function sequentialPow() {
+ var scale = powish(transformer$2());
+
+ scale.copy = function() {
+ return copy$1(scale, sequentialPow()).exponent(scale.exponent());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+function sequentialSqrt() {
+ return sequentialPow.apply(null, arguments).exponent(0.5);
+}
+
+function sequentialQuantile() {
+ var domain = [],
+ interpolator = identity$6;
+
+ function scale(x) {
+ if (!isNaN(x = +x)) return interpolator((bisectRight(domain, x) - 1) / (domain.length - 1));
+ }
+
+ scale.domain = function(_) {
+ if (!arguments.length) return domain.slice();
+ domain = [];
+ for (var i = 0, n = _.length, d; i < n; ++i) if (d = _[i], d != null && !isNaN(d = +d)) domain.push(d);
+ domain.sort(ascending);
+ return scale;
+ };
+
+ scale.interpolator = function(_) {
+ return arguments.length ? (interpolator = _, scale) : interpolator;
+ };
+
+ scale.copy = function() {
+ return sequentialQuantile(interpolator).domain(domain);
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+function transformer$3() {
+ var x0 = 0,
+ x1 = 0.5,
+ x2 = 1,
+ t0,
+ t1,
+ t2,
+ k10,
+ k21,
+ interpolator = identity$6,
+ transform,
+ clamp = false,
+ unknown;
+
+ function scale(x) {
+ return isNaN(x = +x) ? unknown : (x = 0.5 + ((x = +transform(x)) - t1) * (x < t1 ? k10 : k21), interpolator(clamp ? Math.max(0, Math.min(1, x)) : x));
+ }
+
+ scale.domain = function(_) {
+ return arguments.length ? (t0 = transform(x0 = +_[0]), t1 = transform(x1 = +_[1]), t2 = transform(x2 = +_[2]), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1), scale) : [x0, x1, x2];
+ };
+
+ scale.clamp = function(_) {
+ return arguments.length ? (clamp = !!_, scale) : clamp;
+ };
+
+ scale.interpolator = function(_) {
+ return arguments.length ? (interpolator = _, scale) : interpolator;
+ };
+
+ scale.unknown = function(_) {
+ return arguments.length ? (unknown = _, scale) : unknown;
+ };
+
+ return function(t) {
+ transform = t, t0 = t(x0), t1 = t(x1), t2 = t(x2), k10 = t0 === t1 ? 0 : 0.5 / (t1 - t0), k21 = t1 === t2 ? 0 : 0.5 / (t2 - t1);
+ return scale;
+ };
+}
+
+function diverging() {
+ var scale = linearish(transformer$3()(identity$6));
+
+ scale.copy = function() {
+ return copy$1(scale, diverging());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+function divergingLog() {
+ var scale = loggish(transformer$3()).domain([0.1, 1, 10]);
+
+ scale.copy = function() {
+ return copy$1(scale, divergingLog()).base(scale.base());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+function divergingSymlog() {
+ var scale = symlogish(transformer$3());
+
+ scale.copy = function() {
+ return copy$1(scale, divergingSymlog()).constant(scale.constant());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+function divergingPow() {
+ var scale = powish(transformer$3());
+
+ scale.copy = function() {
+ return copy$1(scale, divergingPow()).exponent(scale.exponent());
+ };
+
+ return initInterpolator.apply(scale, arguments);
+}
+
+function divergingSqrt() {
+ return divergingPow.apply(null, arguments).exponent(0.5);
+}
+
+function colors(specifier) {
+ var n = specifier.length / 6 | 0, colors = new Array(n), i = 0;
+ while (i < n) colors[i] = "#" + specifier.slice(i * 6, ++i * 6);
+ return colors;
+}
+
+var category10 = colors("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");
+
+var Accent = colors("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666");
+
+var Dark2 = colors("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666");
+
+var Paired = colors("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");
+
+var Pastel1 = colors("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2");
+
+var Pastel2 = colors("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc");
+
+var Set1 = colors("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999");
+
+var Set2 = colors("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3");
+
+var Set3 = colors("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");
+
+function ramp(scheme) {
+ return rgbBasis(scheme[scheme.length - 1]);
+}
+
+var scheme = new Array(3).concat(
+ "d8b365f5f5f55ab4ac",
+ "a6611adfc27d80cdc1018571",
+ "a6611adfc27df5f5f580cdc1018571",
+ "8c510ad8b365f6e8c3c7eae55ab4ac01665e",
+ "8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e",
+ "8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e",
+ "8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e",
+ "5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30",
+ "5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30"
+).map(colors);
+
+var BrBG = ramp(scheme);
+
+var scheme$1 = new Array(3).concat(
+ "af8dc3f7f7f77fbf7b",
+ "7b3294c2a5cfa6dba0008837",
+ "7b3294c2a5cff7f7f7a6dba0008837",
+ "762a83af8dc3e7d4e8d9f0d37fbf7b1b7837",
+ "762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837",
+ "762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837",
+ "762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837",
+ "40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b",
+ "40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b"
+).map(colors);
+
+var PRGn = ramp(scheme$1);
+
+var scheme$2 = new Array(3).concat(
+ "e9a3c9f7f7f7a1d76a",
+ "d01c8bf1b6dab8e1864dac26",
+ "d01c8bf1b6daf7f7f7b8e1864dac26",
+ "c51b7de9a3c9fde0efe6f5d0a1d76a4d9221",
+ "c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221",
+ "c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221",
+ "c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221",
+ "8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419",
+ "8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419"
+).map(colors);
+
+var PiYG = ramp(scheme$2);
+
+var scheme$3 = new Array(3).concat(
+ "998ec3f7f7f7f1a340",
+ "5e3c99b2abd2fdb863e66101",
+ "5e3c99b2abd2f7f7f7fdb863e66101",
+ "542788998ec3d8daebfee0b6f1a340b35806",
+ "542788998ec3d8daebf7f7f7fee0b6f1a340b35806",
+ "5427888073acb2abd2d8daebfee0b6fdb863e08214b35806",
+ "5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806",
+ "2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08",
+ "2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08"
+).map(colors);
+
+var PuOr = ramp(scheme$3);
+
+var scheme$4 = new Array(3).concat(
+ "ef8a62f7f7f767a9cf",
+ "ca0020f4a58292c5de0571b0",
+ "ca0020f4a582f7f7f792c5de0571b0",
+ "b2182bef8a62fddbc7d1e5f067a9cf2166ac",
+ "b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac",
+ "b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac",
+ "b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac",
+ "67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061",
+ "67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061"
+).map(colors);
+
+var RdBu = ramp(scheme$4);
+
+var scheme$5 = new Array(3).concat(
+ "ef8a62ffffff999999",
+ "ca0020f4a582bababa404040",
+ "ca0020f4a582ffffffbababa404040",
+ "b2182bef8a62fddbc7e0e0e09999994d4d4d",
+ "b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d",
+ "b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d",
+ "b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d",
+ "67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a",
+ "67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a"
+).map(colors);
+
+var RdGy = ramp(scheme$5);
+
+var scheme$6 = new Array(3).concat(
+ "fc8d59ffffbf91bfdb",
+ "d7191cfdae61abd9e92c7bb6",
+ "d7191cfdae61ffffbfabd9e92c7bb6",
+ "d73027fc8d59fee090e0f3f891bfdb4575b4",
+ "d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4",
+ "d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4",
+ "d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4",
+ "a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695",
+ "a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695"
+).map(colors);
+
+var RdYlBu = ramp(scheme$6);
+
+var scheme$7 = new Array(3).concat(
+ "fc8d59ffffbf91cf60",
+ "d7191cfdae61a6d96a1a9641",
+ "d7191cfdae61ffffbfa6d96a1a9641",
+ "d73027fc8d59fee08bd9ef8b91cf601a9850",
+ "d73027fc8d59fee08bffffbfd9ef8b91cf601a9850",
+ "d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850",
+ "d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850",
+ "a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837",
+ "a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837"
+).map(colors);
+
+var RdYlGn = ramp(scheme$7);
+
+var scheme$8 = new Array(3).concat(
+ "fc8d59ffffbf99d594",
+ "d7191cfdae61abdda42b83ba",
+ "d7191cfdae61ffffbfabdda42b83ba",
+ "d53e4ffc8d59fee08be6f59899d5943288bd",
+ "d53e4ffc8d59fee08bffffbfe6f59899d5943288bd",
+ "d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd",
+ "d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd",
+ "9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2",
+ "9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2"
+).map(colors);
+
+var Spectral = ramp(scheme$8);
+
+var scheme$9 = new Array(3).concat(
+ "e5f5f999d8c92ca25f",
+ "edf8fbb2e2e266c2a4238b45",
+ "edf8fbb2e2e266c2a42ca25f006d2c",
+ "edf8fbccece699d8c966c2a42ca25f006d2c",
+ "edf8fbccece699d8c966c2a441ae76238b45005824",
+ "f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824",
+ "f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b"
+).map(colors);
+
+var BuGn = ramp(scheme$9);
+
+var scheme$a = new Array(3).concat(
+ "e0ecf49ebcda8856a7",
+ "edf8fbb3cde38c96c688419d",
+ "edf8fbb3cde38c96c68856a7810f7c",
+ "edf8fbbfd3e69ebcda8c96c68856a7810f7c",
+ "edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b",
+ "f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b",
+ "f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b"
+).map(colors);
+
+var BuPu = ramp(scheme$a);
+
+var scheme$b = new Array(3).concat(
+ "e0f3dba8ddb543a2ca",
+ "f0f9e8bae4bc7bccc42b8cbe",
+ "f0f9e8bae4bc7bccc443a2ca0868ac",
+ "f0f9e8ccebc5a8ddb57bccc443a2ca0868ac",
+ "f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e",
+ "f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e",
+ "f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081"
+).map(colors);
+
+var GnBu = ramp(scheme$b);
+
+var scheme$c = new Array(3).concat(
+ "fee8c8fdbb84e34a33",
+ "fef0d9fdcc8afc8d59d7301f",
+ "fef0d9fdcc8afc8d59e34a33b30000",
+ "fef0d9fdd49efdbb84fc8d59e34a33b30000",
+ "fef0d9fdd49efdbb84fc8d59ef6548d7301f990000",
+ "fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000",
+ "fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000"
+).map(colors);
+
+var OrRd = ramp(scheme$c);
+
+var scheme$d = new Array(3).concat(
+ "ece2f0a6bddb1c9099",
+ "f6eff7bdc9e167a9cf02818a",
+ "f6eff7bdc9e167a9cf1c9099016c59",
+ "f6eff7d0d1e6a6bddb67a9cf1c9099016c59",
+ "f6eff7d0d1e6a6bddb67a9cf3690c002818a016450",
+ "fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450",
+ "fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636"
+).map(colors);
+
+var PuBuGn = ramp(scheme$d);
+
+var scheme$e = new Array(3).concat(
+ "ece7f2a6bddb2b8cbe",
+ "f1eef6bdc9e174a9cf0570b0",
+ "f1eef6bdc9e174a9cf2b8cbe045a8d",
+ "f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d",
+ "f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b",
+ "fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b",
+ "fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858"
+).map(colors);
+
+var PuBu = ramp(scheme$e);
+
+var scheme$f = new Array(3).concat(
+ "e7e1efc994c7dd1c77",
+ "f1eef6d7b5d8df65b0ce1256",
+ "f1eef6d7b5d8df65b0dd1c77980043",
+ "f1eef6d4b9dac994c7df65b0dd1c77980043",
+ "f1eef6d4b9dac994c7df65b0e7298ace125691003f",
+ "f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f",
+ "f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f"
+).map(colors);
+
+var PuRd = ramp(scheme$f);
+
+var scheme$g = new Array(3).concat(
+ "fde0ddfa9fb5c51b8a",
+ "feebe2fbb4b9f768a1ae017e",
+ "feebe2fbb4b9f768a1c51b8a7a0177",
+ "feebe2fcc5c0fa9fb5f768a1c51b8a7a0177",
+ "feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177",
+ "fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177",
+ "fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a"
+).map(colors);
+
+var RdPu = ramp(scheme$g);
+
+var scheme$h = new Array(3).concat(
+ "edf8b17fcdbb2c7fb8",
+ "ffffcca1dab441b6c4225ea8",
+ "ffffcca1dab441b6c42c7fb8253494",
+ "ffffccc7e9b47fcdbb41b6c42c7fb8253494",
+ "ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84",
+ "ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84",
+ "ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58"
+).map(colors);
+
+var YlGnBu = ramp(scheme$h);
+
+var scheme$i = new Array(3).concat(
+ "f7fcb9addd8e31a354",
+ "ffffccc2e69978c679238443",
+ "ffffccc2e69978c67931a354006837",
+ "ffffccd9f0a3addd8e78c67931a354006837",
+ "ffffccd9f0a3addd8e78c67941ab5d238443005a32",
+ "ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32",
+ "ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529"
+).map(colors);
+
+var YlGn = ramp(scheme$i);
+
+var scheme$j = new Array(3).concat(
+ "fff7bcfec44fd95f0e",
+ "ffffd4fed98efe9929cc4c02",
+ "ffffd4fed98efe9929d95f0e993404",
+ "ffffd4fee391fec44ffe9929d95f0e993404",
+ "ffffd4fee391fec44ffe9929ec7014cc4c028c2d04",
+ "ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04",
+ "ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506"
+).map(colors);
+
+var YlOrBr = ramp(scheme$j);
+
+var scheme$k = new Array(3).concat(
+ "ffeda0feb24cf03b20",
+ "ffffb2fecc5cfd8d3ce31a1c",
+ "ffffb2fecc5cfd8d3cf03b20bd0026",
+ "ffffb2fed976feb24cfd8d3cf03b20bd0026",
+ "ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026",
+ "ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026",
+ "ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026"
+).map(colors);
+
+var YlOrRd = ramp(scheme$k);
+
+var scheme$l = new Array(3).concat(
+ "deebf79ecae13182bd",
+ "eff3ffbdd7e76baed62171b5",
+ "eff3ffbdd7e76baed63182bd08519c",
+ "eff3ffc6dbef9ecae16baed63182bd08519c",
+ "eff3ffc6dbef9ecae16baed64292c62171b5084594",
+ "f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594",
+ "f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b"
+).map(colors);
+
+var Blues = ramp(scheme$l);
+
+var scheme$m = new Array(3).concat(
+ "e5f5e0a1d99b31a354",
+ "edf8e9bae4b374c476238b45",
+ "edf8e9bae4b374c47631a354006d2c",
+ "edf8e9c7e9c0a1d99b74c47631a354006d2c",
+ "edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32",
+ "f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32",
+ "f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b"
+).map(colors);
+
+var Greens = ramp(scheme$m);
+
+var scheme$n = new Array(3).concat(
+ "f0f0f0bdbdbd636363",
+ "f7f7f7cccccc969696525252",
+ "f7f7f7cccccc969696636363252525",
+ "f7f7f7d9d9d9bdbdbd969696636363252525",
+ "f7f7f7d9d9d9bdbdbd969696737373525252252525",
+ "fffffff0f0f0d9d9d9bdbdbd969696737373525252252525",
+ "fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000"
+).map(colors);
+
+var Greys = ramp(scheme$n);
+
+var scheme$o = new Array(3).concat(
+ "efedf5bcbddc756bb1",
+ "f2f0f7cbc9e29e9ac86a51a3",
+ "f2f0f7cbc9e29e9ac8756bb154278f",
+ "f2f0f7dadaebbcbddc9e9ac8756bb154278f",
+ "f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486",
+ "fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486",
+ "fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d"
+).map(colors);
+
+var Purples = ramp(scheme$o);
+
+var scheme$p = new Array(3).concat(
+ "fee0d2fc9272de2d26",
+ "fee5d9fcae91fb6a4acb181d",
+ "fee5d9fcae91fb6a4ade2d26a50f15",
+ "fee5d9fcbba1fc9272fb6a4ade2d26a50f15",
+ "fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d",
+ "fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d",
+ "fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d"
+).map(colors);
+
+var Reds = ramp(scheme$p);
+
+var scheme$q = new Array(3).concat(
+ "fee6cefdae6be6550d",
+ "feeddefdbe85fd8d3cd94701",
+ "feeddefdbe85fd8d3ce6550da63603",
+ "feeddefdd0a2fdae6bfd8d3ce6550da63603",
+ "feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04",
+ "fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04",
+ "fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704"
+).map(colors);
+
+var Oranges = ramp(scheme$q);
+
+var cubehelix$3 = cubehelixLong(cubehelix(300, 0.5, 0.0), cubehelix(-240, 0.5, 1.0));
+
+var warm = cubehelixLong(cubehelix(-100, 0.75, 0.35), cubehelix(80, 1.50, 0.8));
+
+var cool = cubehelixLong(cubehelix(260, 0.75, 0.35), cubehelix(80, 1.50, 0.8));
+
+var c = cubehelix();
+
+function rainbow(t) {
+ if (t < 0 || t > 1) t -= Math.floor(t);
+ var ts = Math.abs(t - 0.5);
+ c.h = 360 * t - 100;
+ c.s = 1.5 - 1.5 * ts;
+ c.l = 0.8 - 0.9 * ts;
+ return c + "";
+}
+
+var c$1 = rgb(),
+ pi_1_3 = Math.PI / 3,
+ pi_2_3 = Math.PI * 2 / 3;
+
+function sinebow(t) {
+ var x;
+ t = (0.5 - t) * Math.PI;
+ c$1.r = 255 * (x = Math.sin(t)) * x;
+ c$1.g = 255 * (x = Math.sin(t + pi_1_3)) * x;
+ c$1.b = 255 * (x = Math.sin(t + pi_2_3)) * x;
+ return c$1 + "";
+}
+
+function ramp$1(range) {
+ var n = range.length;
+ return function(t) {
+ return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];
+ };
+}
+
+var viridis = ramp$1(colors("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));
+
+var magma = ramp$1(colors("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf"));
+
+var inferno = ramp$1(colors("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4"));
+
+var plasma = ramp$1(colors("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921"));
+
+function constant$b(x) {
+ return function constant() {
+ return x;
};
- var d3_geom_voronoiClipExtent = [ [ -1e6, -1e6 ], [ 1e6, 1e6 ] ];
- function d3_geom_voronoiTriangleArea(a, b, c) {
- return (a.x - c.x) * (b.y - a.y) - (a.x - b.x) * (c.y - a.y);
- }
- d3.geom.delaunay = function(vertices) {
- return d3.geom.voronoi().triangles(vertices);
+}
+
+var abs$1 = Math.abs;
+var atan2$1 = Math.atan2;
+var cos$2 = Math.cos;
+var max$2 = Math.max;
+var min$1 = Math.min;
+var sin$2 = Math.sin;
+var sqrt$2 = Math.sqrt;
+
+var epsilon$3 = 1e-12;
+var pi$4 = Math.PI;
+var halfPi$3 = pi$4 / 2;
+var tau$4 = 2 * pi$4;
+
+function acos$1(x) {
+ return x > 1 ? 0 : x < -1 ? pi$4 : Math.acos(x);
+}
+
+function asin$1(x) {
+ return x >= 1 ? halfPi$3 : x <= -1 ? -halfPi$3 : Math.asin(x);
+}
+
+function arcInnerRadius(d) {
+ return d.innerRadius;
+}
+
+function arcOuterRadius(d) {
+ return d.outerRadius;
+}
+
+function arcStartAngle(d) {
+ return d.startAngle;
+}
+
+function arcEndAngle(d) {
+ return d.endAngle;
+}
+
+function arcPadAngle(d) {
+ return d && d.padAngle; // Note: optional!
+}
+
+function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
+ var x10 = x1 - x0, y10 = y1 - y0,
+ x32 = x3 - x2, y32 = y3 - y2,
+ t = y32 * x10 - x32 * y10;
+ if (t * t < epsilon$3) return;
+ t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;
+ return [x0 + t * x10, y0 + t * y10];
+}
+
+// Compute perpendicular offset line of length rc.
+// http://mathworld.wolfram.com/Circle-LineIntersection.html
+function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
+ var x01 = x0 - x1,
+ y01 = y0 - y1,
+ lo = (cw ? rc : -rc) / sqrt$2(x01 * x01 + y01 * y01),
+ ox = lo * y01,
+ oy = -lo * x01,
+ x11 = x0 + ox,
+ y11 = y0 + oy,
+ x10 = x1 + ox,
+ y10 = y1 + oy,
+ x00 = (x11 + x10) / 2,
+ y00 = (y11 + y10) / 2,
+ dx = x10 - x11,
+ dy = y10 - y11,
+ d2 = dx * dx + dy * dy,
+ r = r1 - rc,
+ D = x11 * y10 - x10 * y11,
+ d = (dy < 0 ? -1 : 1) * sqrt$2(max$2(0, r * r * d2 - D * D)),
+ cx0 = (D * dy - dx * d) / d2,
+ cy0 = (-D * dx - dy * d) / d2,
+ cx1 = (D * dy + dx * d) / d2,
+ cy1 = (-D * dx + dy * d) / d2,
+ dx0 = cx0 - x00,
+ dy0 = cy0 - y00,
+ dx1 = cx1 - x00,
+ dy1 = cy1 - y00;
+
+ // Pick the closer of the two intersection points.
+ // TODO Is there a faster way to determine which intersection to use?
+ if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;
+
+ return {
+ cx: cx0,
+ cy: cy0,
+ x01: -ox,
+ y01: -oy,
+ x11: cx0 * (r1 / r - 1),
+ y11: cy0 * (r1 / r - 1)
};
- d3.geom.quadtree = function(points, x1, y1, x2, y2) {
- var x = d3_geom_pointX, y = d3_geom_pointY, compat;
- if (compat = arguments.length) {
- x = d3_geom_quadtreeCompatX;
- y = d3_geom_quadtreeCompatY;
- if (compat === 3) {
- y2 = y1;
- x2 = x1;
- y1 = x1 = 0;
+}
+
+function arc() {
+ var innerRadius = arcInnerRadius,
+ outerRadius = arcOuterRadius,
+ cornerRadius = constant$b(0),
+ padRadius = null,
+ startAngle = arcStartAngle,
+ endAngle = arcEndAngle,
+ padAngle = arcPadAngle,
+ context = null;
+
+ function arc() {
+ var buffer,
+ r,
+ r0 = +innerRadius.apply(this, arguments),
+ r1 = +outerRadius.apply(this, arguments),
+ a0 = startAngle.apply(this, arguments) - halfPi$3,
+ a1 = endAngle.apply(this, arguments) - halfPi$3,
+ da = abs$1(a1 - a0),
+ cw = a1 > a0;
+
+ if (!context) context = buffer = path();
+
+ // Ensure that the outer radius is always larger than the inner radius.
+ if (r1 < r0) r = r1, r1 = r0, r0 = r;
+
+ // Is it a point?
+ if (!(r1 > epsilon$3)) context.moveTo(0, 0);
+
+ // Or is it a circle or annulus?
+ else if (da > tau$4 - epsilon$3) {
+ context.moveTo(r1 * cos$2(a0), r1 * sin$2(a0));
+ context.arc(0, 0, r1, a0, a1, !cw);
+ if (r0 > epsilon$3) {
+ context.moveTo(r0 * cos$2(a1), r0 * sin$2(a1));
+ context.arc(0, 0, r0, a1, a0, cw);
}
- return quadtree(points);
}
- function quadtree(data) {
- var d, fx = d3_functor(x), fy = d3_functor(y), xs, ys, i, n, x1_, y1_, x2_, y2_;
- if (x1 != null) {
- x1_ = x1, y1_ = y1, x2_ = x2, y2_ = y2;
- } else {
- x2_ = y2_ = -(x1_ = y1_ = Infinity);
- xs = [], ys = [];
- n = data.length;
- if (compat) for (i = 0; i < n; ++i) {
- d = data[i];
- if (d.x < x1_) x1_ = d.x;
- if (d.y < y1_) y1_ = d.y;
- if (d.x > x2_) x2_ = d.x;
- if (d.y > y2_) y2_ = d.y;
- xs.push(d.x);
- ys.push(d.y);
- } else for (i = 0; i < n; ++i) {
- var x_ = +fx(d = data[i], i), y_ = +fy(d, i);
- if (x_ < x1_) x1_ = x_;
- if (y_ < y1_) y1_ = y_;
- if (x_ > x2_) x2_ = x_;
- if (y_ > y2_) y2_ = y_;
- xs.push(x_);
- ys.push(y_);
+
+ // Or is it a circular or annular sector?
+ else {
+ var a01 = a0,
+ a11 = a1,
+ a00 = a0,
+ a10 = a1,
+ da0 = da,
+ da1 = da,
+ ap = padAngle.apply(this, arguments) / 2,
+ rp = (ap > epsilon$3) && (padRadius ? +padRadius.apply(this, arguments) : sqrt$2(r0 * r0 + r1 * r1)),
+ rc = min$1(abs$1(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),
+ rc0 = rc,
+ rc1 = rc,
+ t0,
+ t1;
+
+ // Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.
+ if (rp > epsilon$3) {
+ var p0 = asin$1(rp / r0 * sin$2(ap)),
+ p1 = asin$1(rp / r1 * sin$2(ap));
+ if ((da0 -= p0 * 2) > epsilon$3) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;
+ else da0 = 0, a00 = a10 = (a0 + a1) / 2;
+ if ((da1 -= p1 * 2) > epsilon$3) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;
+ else da1 = 0, a01 = a11 = (a0 + a1) / 2;
+ }
+
+ var x01 = r1 * cos$2(a01),
+ y01 = r1 * sin$2(a01),
+ x10 = r0 * cos$2(a10),
+ y10 = r0 * sin$2(a10);
+
+ // Apply rounded corners?
+ if (rc > epsilon$3) {
+ var x11 = r1 * cos$2(a11),
+ y11 = r1 * sin$2(a11),
+ x00 = r0 * cos$2(a00),
+ y00 = r0 * sin$2(a00),
+ oc;
+
+ // Restrict the corner radius according to the sector angle.
+ if (da < pi$4 && (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10))) {
+ var ax = x01 - oc[0],
+ ay = y01 - oc[1],
+ bx = x11 - oc[0],
+ by = y11 - oc[1],
+ kc = 1 / sin$2(acos$1((ax * bx + ay * by) / (sqrt$2(ax * ax + ay * ay) * sqrt$2(bx * bx + by * by))) / 2),
+ lc = sqrt$2(oc[0] * oc[0] + oc[1] * oc[1]);
+ rc0 = min$1(rc, (r0 - lc) / (kc - 1));
+ rc1 = min$1(rc, (r1 - lc) / (kc + 1));
}
}
- var dx = x2_ - x1_, dy = y2_ - y1_;
- if (dx > dy) y2_ = y1_ + dx; else x2_ = x1_ + dy;
- function insert(n, d, x, y, x1, y1, x2, y2) {
- if (isNaN(x) || isNaN(y)) return;
- if (n.leaf) {
- var nx = n.x, ny = n.y;
- if (nx != null) {
- if (abs(nx - x) + abs(ny - y) < .01) {
- insertChild(n, d, x, y, x1, y1, x2, y2);
- } else {
- var nPoint = n.point;
- n.x = n.y = n.point = null;
- insertChild(n, nPoint, nx, ny, x1, y1, x2, y2);
- insertChild(n, d, x, y, x1, y1, x2, y2);
- }
- } else {
- n.x = x, n.y = y, n.point = d;
- }
- } else {
- insertChild(n, d, x, y, x1, y1, x2, y2);
+
+ // Is the sector collapsed to a line?
+ if (!(da1 > epsilon$3)) context.moveTo(x01, y01);
+
+ // Does the sector’s outer ring have rounded corners?
+ else if (rc1 > epsilon$3) {
+ t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);
+ t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);
+
+ context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);
+
+ // Have the corners merged?
+ if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2$1(t0.y01, t0.x01), atan2$1(t1.y01, t1.x01), !cw);
+
+ // Otherwise, draw the two corners and the ring.
+ else {
+ context.arc(t0.cx, t0.cy, rc1, atan2$1(t0.y01, t0.x01), atan2$1(t0.y11, t0.x11), !cw);
+ context.arc(0, 0, r1, atan2$1(t0.cy + t0.y11, t0.cx + t0.x11), atan2$1(t1.cy + t1.y11, t1.cx + t1.x11), !cw);
+ context.arc(t1.cx, t1.cy, rc1, atan2$1(t1.y11, t1.x11), atan2$1(t1.y01, t1.x01), !cw);
}
}
- function insertChild(n, d, x, y, x1, y1, x2, y2) {
- var sx = (x1 + x2) * .5, sy = (y1 + y2) * .5, right = x >= sx, bottom = y >= sy, i = (bottom << 1) + right;
- n.leaf = false;
- n = n.nodes[i] || (n.nodes[i] = d3_geom_quadtreeNode());
- if (right) x1 = sx; else x2 = sx;
- if (bottom) y1 = sy; else y2 = sy;
- insert(n, d, x, y, x1, y1, x2, y2);
- }
- var root = d3_geom_quadtreeNode();
- root.add = function(d) {
- insert(root, d, +fx(d, ++i), +fy(d, i), x1_, y1_, x2_, y2_);
- };
- root.visit = function(f) {
- d3_geom_quadtreeVisit(f, root, x1_, y1_, x2_, y2_);
- };
- i = -1;
- if (x1 == null) {
- while (++i < n) {
- insert(root, data[i], xs[i], ys[i], x1_, y1_, x2_, y2_);
+
+ // Or is the outer ring just a circular arc?
+ else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);
+
+ // Is there no inner ring, and it’s a circular sector?
+ // Or perhaps it’s an annular sector collapsed due to padding?
+ if (!(r0 > epsilon$3) || !(da0 > epsilon$3)) context.lineTo(x10, y10);
+
+ // Does the sector’s inner ring (or point) have rounded corners?
+ else if (rc0 > epsilon$3) {
+ t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);
+ t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);
+
+ context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);
+
+ // Have the corners merged?
+ if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2$1(t0.y01, t0.x01), atan2$1(t1.y01, t1.x01), !cw);
+
+ // Otherwise, draw the two corners and the ring.
+ else {
+ context.arc(t0.cx, t0.cy, rc0, atan2$1(t0.y01, t0.x01), atan2$1(t0.y11, t0.x11), !cw);
+ context.arc(0, 0, r0, atan2$1(t0.cy + t0.y11, t0.cx + t0.x11), atan2$1(t1.cy + t1.y11, t1.cx + t1.x11), cw);
+ context.arc(t1.cx, t1.cy, rc0, atan2$1(t1.y11, t1.x11), atan2$1(t1.y01, t1.x01), !cw);
}
- --i;
- } else data.forEach(root.add);
- xs = ys = data = d = null;
- return root;
+ }
+
+ // Or is the inner ring just a circular arc?
+ else context.arc(0, 0, r0, a10, a00, cw);
}
- quadtree.x = function(_) {
- return arguments.length ? (x = _, quadtree) : x;
- };
- quadtree.y = function(_) {
- return arguments.length ? (y = _, quadtree) : y;
- };
- quadtree.extent = function(_) {
- if (!arguments.length) return x1 == null ? null : [ [ x1, y1 ], [ x2, y2 ] ];
- if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = +_[0][0], y1 = +_[0][1], x2 = +_[1][0],
- y2 = +_[1][1];
- return quadtree;
- };
- quadtree.size = function(_) {
- if (!arguments.length) return x1 == null ? null : [ x2 - x1, y2 - y1 ];
- if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = y1 = 0, x2 = +_[0], y2 = +_[1];
- return quadtree;
- };
- return quadtree;
- };
- function d3_geom_quadtreeCompatX(d) {
- return d.x;
- }
- function d3_geom_quadtreeCompatY(d) {
- return d.y;
- }
- function d3_geom_quadtreeNode() {
- return {
- leaf: true,
- nodes: [],
- point: null,
- x: null,
- y: null
- };
+
+ context.closePath();
+
+ if (buffer) return context = null, buffer + "" || null;
}
- function d3_geom_quadtreeVisit(f, node, x1, y1, x2, y2) {
- if (!f(node, x1, y1, x2, y2)) {
- var sx = (x1 + x2) * .5, sy = (y1 + y2) * .5, children = node.nodes;
- if (children[0]) d3_geom_quadtreeVisit(f, children[0], x1, y1, sx, sy);
- if (children[1]) d3_geom_quadtreeVisit(f, children[1], sx, y1, x2, sy);
- if (children[2]) d3_geom_quadtreeVisit(f, children[2], x1, sy, sx, y2);
- if (children[3]) d3_geom_quadtreeVisit(f, children[3], sx, sy, x2, y2);
+
+ arc.centroid = function() {
+ var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,
+ a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi$4 / 2;
+ return [cos$2(a) * r, sin$2(a) * r];
+ };
+
+ arc.innerRadius = function(_) {
+ return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant$b(+_), arc) : innerRadius;
+ };
+
+ arc.outerRadius = function(_) {
+ return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant$b(+_), arc) : outerRadius;
+ };
+
+ arc.cornerRadius = function(_) {
+ return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant$b(+_), arc) : cornerRadius;
+ };
+
+ arc.padRadius = function(_) {
+ return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant$b(+_), arc) : padRadius;
+ };
+
+ arc.startAngle = function(_) {
+ return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant$b(+_), arc) : startAngle;
+ };
+
+ arc.endAngle = function(_) {
+ return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant$b(+_), arc) : endAngle;
+ };
+
+ arc.padAngle = function(_) {
+ return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant$b(+_), arc) : padAngle;
+ };
+
+ arc.context = function(_) {
+ return arguments.length ? ((context = _ == null ? null : _), arc) : context;
+ };
+
+ return arc;
+}
+
+function Linear(context) {
+ this._context = context;
+}
+
+Linear.prototype = {
+ areaStart: function() {
+ this._line = 0;
+ },
+ areaEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._point = 0;
+ },
+ lineEnd: function() {
+ if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
+ this._line = 1 - this._line;
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+ switch (this._point) {
+ case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
+ case 1: this._point = 2; // proceed
+ default: this._context.lineTo(x, y); break;
+ }
+ }
+};
+
+function curveLinear(context) {
+ return new Linear(context);
+}
+
+function x$3(p) {
+ return p[0];
+}
+
+function y$3(p) {
+ return p[1];
+}
+
+function line() {
+ var x$$1 = x$3,
+ y$$1 = y$3,
+ defined = constant$b(true),
+ context = null,
+ curve = curveLinear,
+ output = null;
+
+ function line(data) {
+ var i,
+ n = data.length,
+ d,
+ defined0 = false,
+ buffer;
+
+ if (context == null) output = curve(buffer = path());
+
+ for (i = 0; i <= n; ++i) {
+ if (!(i < n && defined(d = data[i], i, data)) === defined0) {
+ if (defined0 = !defined0) output.lineStart();
+ else output.lineEnd();
+ }
+ if (defined0) output.point(+x$$1(d, i, data), +y$$1(d, i, data));
}
+
+ if (buffer) return output = null, buffer + "" || null;
}
- d3.interpolateRgb = d3_interpolateRgb;
- function d3_interpolateRgb(a, b) {
- a = d3.rgb(a);
- b = d3.rgb(b);
- var ar = a.r, ag = a.g, ab = a.b, br = b.r - ar, bg = b.g - ag, bb = b.b - ab;
- return function(t) {
- return "#" + d3_rgb_hex(Math.round(ar + br * t)) + d3_rgb_hex(Math.round(ag + bg * t)) + d3_rgb_hex(Math.round(ab + bb * t));
- };
- }
- d3.interpolateObject = d3_interpolateObject;
- function d3_interpolateObject(a, b) {
- var i = {}, c = {}, k;
- for (k in a) {
- if (k in b) {
- i[k] = d3_interpolate(a[k], b[k]);
- } else {
- c[k] = a[k];
+
+ line.x = function(_) {
+ return arguments.length ? (x$$1 = typeof _ === "function" ? _ : constant$b(+_), line) : x$$1;
+ };
+
+ line.y = function(_) {
+ return arguments.length ? (y$$1 = typeof _ === "function" ? _ : constant$b(+_), line) : y$$1;
+ };
+
+ line.defined = function(_) {
+ return arguments.length ? (defined = typeof _ === "function" ? _ : constant$b(!!_), line) : defined;
+ };
+
+ line.curve = function(_) {
+ return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;
+ };
+
+ line.context = function(_) {
+ return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;
+ };
+
+ return line;
+}
+
+function area$3() {
+ var x0 = x$3,
+ x1 = null,
+ y0 = constant$b(0),
+ y1 = y$3,
+ defined = constant$b(true),
+ context = null,
+ curve = curveLinear,
+ output = null;
+
+ function area(data) {
+ var i,
+ j,
+ k,
+ n = data.length,
+ d,
+ defined0 = false,
+ buffer,
+ x0z = new Array(n),
+ y0z = new Array(n);
+
+ if (context == null) output = curve(buffer = path());
+
+ for (i = 0; i <= n; ++i) {
+ if (!(i < n && defined(d = data[i], i, data)) === defined0) {
+ if (defined0 = !defined0) {
+ j = i;
+ output.areaStart();
+ output.lineStart();
+ } else {
+ output.lineEnd();
+ output.lineStart();
+ for (k = i - 1; k >= j; --k) {
+ output.point(x0z[k], y0z[k]);
+ }
+ output.lineEnd();
+ output.areaEnd();
+ }
}
- }
- for (k in b) {
- if (!(k in a)) {
- c[k] = b[k];
+ if (defined0) {
+ x0z[i] = +x0(d, i, data), y0z[i] = +y0(d, i, data);
+ output.point(x1 ? +x1(d, i, data) : x0z[i], y1 ? +y1(d, i, data) : y0z[i]);
}
}
- return function(t) {
- for (k in i) c[k] = i[k](t);
- return c;
- };
+
+ if (buffer) return output = null, buffer + "" || null;
}
- d3.interpolateNumber = d3_interpolateNumber;
- function d3_interpolateNumber(a, b) {
- a = +a, b = +b;
- return function(t) {
- return a * (1 - t) + b * t;
- };
+
+ function arealine() {
+ return line().defined(defined).curve(curve).context(context);
}
- d3.interpolateString = d3_interpolateString;
- function d3_interpolateString(a, b) {
- var bi = d3_interpolate_numberA.lastIndex = d3_interpolate_numberB.lastIndex = 0, am, bm, bs, i = -1, s = [], q = [];
- a = a + "", b = b + "";
- while ((am = d3_interpolate_numberA.exec(a)) && (bm = d3_interpolate_numberB.exec(b))) {
- if ((bs = bm.index) > bi) {
- bs = b.slice(bi, bs);
- if (s[i]) s[i] += bs; else s[++i] = bs;
- }
- if ((am = am[0]) === (bm = bm[0])) {
- if (s[i]) s[i] += bm; else s[++i] = bm;
- } else {
- s[++i] = null;
- q.push({
- i: i,
- x: d3_interpolateNumber(am, bm)
- });
+
+ area.x = function(_) {
+ return arguments.length ? (x0 = typeof _ === "function" ? _ : constant$b(+_), x1 = null, area) : x0;
+ };
+
+ area.x0 = function(_) {
+ return arguments.length ? (x0 = typeof _ === "function" ? _ : constant$b(+_), area) : x0;
+ };
+
+ area.x1 = function(_) {
+ return arguments.length ? (x1 = _ == null ? null : typeof _ === "function" ? _ : constant$b(+_), area) : x1;
+ };
+
+ area.y = function(_) {
+ return arguments.length ? (y0 = typeof _ === "function" ? _ : constant$b(+_), y1 = null, area) : y0;
+ };
+
+ area.y0 = function(_) {
+ return arguments.length ? (y0 = typeof _ === "function" ? _ : constant$b(+_), area) : y0;
+ };
+
+ area.y1 = function(_) {
+ return arguments.length ? (y1 = _ == null ? null : typeof _ === "function" ? _ : constant$b(+_), area) : y1;
+ };
+
+ area.lineX0 =
+ area.lineY0 = function() {
+ return arealine().x(x0).y(y0);
+ };
+
+ area.lineY1 = function() {
+ return arealine().x(x0).y(y1);
+ };
+
+ area.lineX1 = function() {
+ return arealine().x(x1).y(y0);
+ };
+
+ area.defined = function(_) {
+ return arguments.length ? (defined = typeof _ === "function" ? _ : constant$b(!!_), area) : defined;
+ };
+
+ area.curve = function(_) {
+ return arguments.length ? (curve = _, context != null && (output = curve(context)), area) : curve;
+ };
+
+ area.context = function(_) {
+ return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), area) : context;
+ };
+
+ return area;
+}
+
+function descending$1(a, b) {
+ return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
+}
+
+function identity$8(d) {
+ return d;
+}
+
+function pie() {
+ var value = identity$8,
+ sortValues = descending$1,
+ sort = null,
+ startAngle = constant$b(0),
+ endAngle = constant$b(tau$4),
+ padAngle = constant$b(0);
+
+ function pie(data) {
+ var i,
+ n = data.length,
+ j,
+ k,
+ sum = 0,
+ index = new Array(n),
+ arcs = new Array(n),
+ a0 = +startAngle.apply(this, arguments),
+ da = Math.min(tau$4, Math.max(-tau$4, endAngle.apply(this, arguments) - a0)),
+ a1,
+ p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),
+ pa = p * (da < 0 ? -1 : 1),
+ v;
+
+ for (i = 0; i < n; ++i) {
+ if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {
+ sum += v;
}
- bi = d3_interpolate_numberB.lastIndex;
}
- if (bi < b.length) {
- bs = b.slice(bi);
- if (s[i]) s[i] += bs; else s[++i] = bs;
+
+ // Optionally sort the arcs by previously-computed values or by data.
+ if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });
+ else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });
+
+ // Compute the arcs! They are stored in the original data's order.
+ for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {
+ j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {
+ data: data[j],
+ index: i,
+ value: v,
+ startAngle: a0,
+ endAngle: a1,
+ padAngle: p
+ };
}
- return s.length < 2 ? q[0] ? (b = q[0].x, function(t) {
- return b(t) + "";
- }) : function() {
- return b;
- } : (b = q.length, function(t) {
- for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);
- return s.join("");
- });
- }
- var d3_interpolate_numberA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, d3_interpolate_numberB = new RegExp(d3_interpolate_numberA.source, "g");
- d3.interpolate = d3_interpolate;
- function d3_interpolate(a, b) {
- var i = d3.interpolators.length, f;
- while (--i >= 0 && !(f = d3.interpolators[i](a, b))) ;
- return f;
- }
- d3.interpolators = [ function(a, b) {
- var t = typeof b;
- return (t === "string" ? d3_rgb_names.has(b) || /^(#|rgb\(|hsl\()/.test(b) ? d3_interpolateRgb : d3_interpolateString : b instanceof d3_color ? d3_interpolateRgb : Array.isArray(b) ? d3_interpolateArray : t === "object" && isNaN(b) ? d3_interpolateObject : d3_interpolateNumber)(a, b);
- } ];
- d3.interpolateArray = d3_interpolateArray;
- function d3_interpolateArray(a, b) {
- var x = [], c = [], na = a.length, nb = b.length, n0 = Math.min(a.length, b.length), i;
- for (i = 0; i < n0; ++i) x.push(d3_interpolate(a[i], b[i]));
- for (;i < na; ++i) c[i] = a[i];
- for (;i < nb; ++i) c[i] = b[i];
- return function(t) {
- for (i = 0; i < n0; ++i) c[i] = x[i](t);
- return c;
- };
+
+ return arcs;
}
- var d3_ease_default = function() {
- return d3_identity;
+
+ pie.value = function(_) {
+ return arguments.length ? (value = typeof _ === "function" ? _ : constant$b(+_), pie) : value;
};
- var d3_ease = d3.map({
- linear: d3_ease_default,
- poly: d3_ease_poly,
- quad: function() {
- return d3_ease_quad;
- },
- cubic: function() {
- return d3_ease_cubic;
- },
- sin: function() {
- return d3_ease_sin;
- },
- exp: function() {
- return d3_ease_exp;
- },
- circle: function() {
- return d3_ease_circle;
- },
- elastic: d3_ease_elastic,
- back: d3_ease_back,
- bounce: function() {
- return d3_ease_bounce;
- }
- });
- var d3_ease_mode = d3.map({
- "in": d3_identity,
- out: d3_ease_reverse,
- "in-out": d3_ease_reflect,
- "out-in": function(f) {
- return d3_ease_reflect(d3_ease_reverse(f));
- }
- });
- d3.ease = function(name) {
- var i = name.indexOf("-"), t = i >= 0 ? name.slice(0, i) : name, m = i >= 0 ? name.slice(i + 1) : "in";
- t = d3_ease.get(t) || d3_ease_default;
- m = d3_ease_mode.get(m) || d3_identity;
- return d3_ease_clamp(m(t.apply(null, d3_arraySlice.call(arguments, 1))));
+
+ pie.sortValues = function(_) {
+ return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;
};
- function d3_ease_clamp(f) {
- return function(t) {
- return t <= 0 ? 0 : t >= 1 ? 1 : f(t);
- };
- }
- function d3_ease_reverse(f) {
- return function(t) {
- return 1 - f(1 - t);
- };
- }
- function d3_ease_reflect(f) {
- return function(t) {
- return .5 * (t < .5 ? f(2 * t) : 2 - f(2 - 2 * t));
- };
- }
- function d3_ease_quad(t) {
- return t * t;
- }
- function d3_ease_cubic(t) {
- return t * t * t;
- }
- function d3_ease_cubicInOut(t) {
- if (t <= 0) return 0;
- if (t >= 1) return 1;
- var t2 = t * t, t3 = t2 * t;
- return 4 * (t < .5 ? t3 : 3 * (t - t2) + t3 - .75);
- }
- function d3_ease_poly(e) {
- return function(t) {
- return Math.pow(t, e);
- };
- }
- function d3_ease_sin(t) {
- return 1 - Math.cos(t * halfπ);
- }
- function d3_ease_exp(t) {
- return Math.pow(2, 10 * (t - 1));
- }
- function d3_ease_circle(t) {
- return 1 - Math.sqrt(1 - t * t);
- }
- function d3_ease_elastic(a, p) {
- var s;
- if (arguments.length < 2) p = .45;
- if (arguments.length) s = p / Ï„ * Math.asin(1 / a); else a = 1, s = p / 4;
- return function(t) {
- return 1 + a * Math.pow(2, -10 * t) * Math.sin((t - s) * Ï„ / p);
- };
- }
- function d3_ease_back(s) {
- if (!s) s = 1.70158;
- return function(t) {
- return t * t * ((s + 1) * t - s);
- };
- }
- function d3_ease_bounce(t) {
- return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375;
- }
- d3.interpolateHcl = d3_interpolateHcl;
- function d3_interpolateHcl(a, b) {
- a = d3.hcl(a);
- b = d3.hcl(b);
- var ah = a.h, ac = a.c, al = a.l, bh = b.h - ah, bc = b.c - ac, bl = b.l - al;
- if (isNaN(bc)) bc = 0, ac = isNaN(ac) ? b.c : ac;
- if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360;
- return function(t) {
- return d3_hcl_lab(ah + bh * t, ac + bc * t, al + bl * t) + "";
- };
- }
- d3.interpolateHsl = d3_interpolateHsl;
- function d3_interpolateHsl(a, b) {
- a = d3.hsl(a);
- b = d3.hsl(b);
- var ah = a.h, as = a.s, al = a.l, bh = b.h - ah, bs = b.s - as, bl = b.l - al;
- if (isNaN(bs)) bs = 0, as = isNaN(as) ? b.s : as;
- if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360;
- return function(t) {
- return d3_hsl_rgb(ah + bh * t, as + bs * t, al + bl * t) + "";
- };
- }
- d3.interpolateLab = d3_interpolateLab;
- function d3_interpolateLab(a, b) {
- a = d3.lab(a);
- b = d3.lab(b);
- var al = a.l, aa = a.a, ab = a.b, bl = b.l - al, ba = b.a - aa, bb = b.b - ab;
- return function(t) {
- return d3_lab_rgb(al + bl * t, aa + ba * t, ab + bb * t) + "";
- };
+
+ pie.sort = function(_) {
+ return arguments.length ? (sort = _, sortValues = null, pie) : sort;
+ };
+
+ pie.startAngle = function(_) {
+ return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant$b(+_), pie) : startAngle;
+ };
+
+ pie.endAngle = function(_) {
+ return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant$b(+_), pie) : endAngle;
+ };
+
+ pie.padAngle = function(_) {
+ return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant$b(+_), pie) : padAngle;
+ };
+
+ return pie;
+}
+
+var curveRadialLinear = curveRadial(curveLinear);
+
+function Radial(curve) {
+ this._curve = curve;
+}
+
+Radial.prototype = {
+ areaStart: function() {
+ this._curve.areaStart();
+ },
+ areaEnd: function() {
+ this._curve.areaEnd();
+ },
+ lineStart: function() {
+ this._curve.lineStart();
+ },
+ lineEnd: function() {
+ this._curve.lineEnd();
+ },
+ point: function(a, r) {
+ this._curve.point(r * Math.sin(a), r * -Math.cos(a));
+ }
+};
+
+function curveRadial(curve) {
+
+ function radial(context) {
+ return new Radial(curve(context));
}
- d3.interpolateRound = d3_interpolateRound;
- function d3_interpolateRound(a, b) {
- b -= a;
- return function(t) {
- return Math.round(a + b * t);
- };
+
+ radial._curve = curve;
+
+ return radial;
+}
+
+function lineRadial(l) {
+ var c = l.curve;
+
+ l.angle = l.x, delete l.x;
+ l.radius = l.y, delete l.y;
+
+ l.curve = function(_) {
+ return arguments.length ? c(curveRadial(_)) : c()._curve;
+ };
+
+ return l;
+}
+
+function lineRadial$1() {
+ return lineRadial(line().curve(curveRadialLinear));
+}
+
+function areaRadial() {
+ var a = area$3().curve(curveRadialLinear),
+ c = a.curve,
+ x0 = a.lineX0,
+ x1 = a.lineX1,
+ y0 = a.lineY0,
+ y1 = a.lineY1;
+
+ a.angle = a.x, delete a.x;
+ a.startAngle = a.x0, delete a.x0;
+ a.endAngle = a.x1, delete a.x1;
+ a.radius = a.y, delete a.y;
+ a.innerRadius = a.y0, delete a.y0;
+ a.outerRadius = a.y1, delete a.y1;
+ a.lineStartAngle = function() { return lineRadial(x0()); }, delete a.lineX0;
+ a.lineEndAngle = function() { return lineRadial(x1()); }, delete a.lineX1;
+ a.lineInnerRadius = function() { return lineRadial(y0()); }, delete a.lineY0;
+ a.lineOuterRadius = function() { return lineRadial(y1()); }, delete a.lineY1;
+
+ a.curve = function(_) {
+ return arguments.length ? c(curveRadial(_)) : c()._curve;
+ };
+
+ return a;
+}
+
+function pointRadial(x, y) {
+ return [(y = +y) * Math.cos(x -= Math.PI / 2), y * Math.sin(x)];
+}
+
+var slice$6 = Array.prototype.slice;
+
+function linkSource(d) {
+ return d.source;
+}
+
+function linkTarget(d) {
+ return d.target;
+}
+
+function link$2(curve) {
+ var source = linkSource,
+ target = linkTarget,
+ x$$1 = x$3,
+ y$$1 = y$3,
+ context = null;
+
+ function link() {
+ var buffer, argv = slice$6.call(arguments), s = source.apply(this, argv), t = target.apply(this, argv);
+ if (!context) context = buffer = path();
+ curve(context, +x$$1.apply(this, (argv[0] = s, argv)), +y$$1.apply(this, argv), +x$$1.apply(this, (argv[0] = t, argv)), +y$$1.apply(this, argv));
+ if (buffer) return context = null, buffer + "" || null;
}
- d3.transform = function(string) {
- var g = d3_document.createElementNS(d3.ns.prefix.svg, "g");
- return (d3.transform = function(string) {
- if (string != null) {
- g.setAttribute("transform", string);
- var t = g.transform.baseVal.consolidate();
- }
- return new d3_transform(t ? t.matrix : d3_transformIdentity);
- })(string);
- };
- function d3_transform(m) {
- var r0 = [ m.a, m.b ], r1 = [ m.c, m.d ], kx = d3_transformNormalize(r0), kz = d3_transformDot(r0, r1), ky = d3_transformNormalize(d3_transformCombine(r1, r0, -kz)) || 0;
- if (r0[0] * r1[1] < r1[0] * r0[1]) {
- r0[0] *= -1;
- r0[1] *= -1;
- kx *= -1;
- kz *= -1;
- }
- this.rotate = (kx ? Math.atan2(r0[1], r0[0]) : Math.atan2(-r1[0], r1[1])) * d3_degrees;
- this.translate = [ m.e, m.f ];
- this.scale = [ kx, ky ];
- this.skew = ky ? Math.atan2(kz, ky) * d3_degrees : 0;
- }
- d3_transform.prototype.toString = function() {
- return "translate(" + this.translate + ")rotate(" + this.rotate + ")skewX(" + this.skew + ")scale(" + this.scale + ")";
- };
- function d3_transformDot(a, b) {
- return a[0] * b[0] + a[1] * b[1];
- }
- function d3_transformNormalize(a) {
- var k = Math.sqrt(d3_transformDot(a, a));
- if (k) {
- a[0] /= k;
- a[1] /= k;
- }
- return k;
- }
- function d3_transformCombine(a, b, k) {
- a[0] += k * b[0];
- a[1] += k * b[1];
- return a;
- }
- var d3_transformIdentity = {
- a: 1,
- b: 0,
- c: 0,
- d: 1,
- e: 0,
- f: 0
- };
- d3.interpolateTransform = d3_interpolateTransform;
- function d3_interpolateTransform(a, b) {
- var s = [], q = [], n, A = d3.transform(a), B = d3.transform(b), ta = A.translate, tb = B.translate, ra = A.rotate, rb = B.rotate, wa = A.skew, wb = B.skew, ka = A.scale, kb = B.scale;
- if (ta[0] != tb[0] || ta[1] != tb[1]) {
- s.push("translate(", null, ",", null, ")");
- q.push({
- i: 1,
- x: d3_interpolateNumber(ta[0], tb[0])
- }, {
- i: 3,
- x: d3_interpolateNumber(ta[1], tb[1])
- });
- } else if (tb[0] || tb[1]) {
- s.push("translate(" + tb + ")");
- } else {
- s.push("");
- }
- if (ra != rb) {
- if (ra - rb > 180) rb += 360; else if (rb - ra > 180) ra += 360;
- q.push({
- i: s.push(s.pop() + "rotate(", null, ")") - 2,
- x: d3_interpolateNumber(ra, rb)
- });
- } else if (rb) {
- s.push(s.pop() + "rotate(" + rb + ")");
- }
- if (wa != wb) {
- q.push({
- i: s.push(s.pop() + "skewX(", null, ")") - 2,
- x: d3_interpolateNumber(wa, wb)
- });
- } else if (wb) {
- s.push(s.pop() + "skewX(" + wb + ")");
- }
- if (ka[0] != kb[0] || ka[1] != kb[1]) {
- n = s.push(s.pop() + "scale(", null, ",", null, ")");
- q.push({
- i: n - 4,
- x: d3_interpolateNumber(ka[0], kb[0])
- }, {
- i: n - 2,
- x: d3_interpolateNumber(ka[1], kb[1])
- });
- } else if (kb[0] != 1 || kb[1] != 1) {
- s.push(s.pop() + "scale(" + kb + ")");
- }
- n = q.length;
- return function(t) {
- var i = -1, o;
- while (++i < n) s[(o = q[i]).i] = o.x(t);
- return s.join("");
- };
+
+ link.source = function(_) {
+ return arguments.length ? (source = _, link) : source;
+ };
+
+ link.target = function(_) {
+ return arguments.length ? (target = _, link) : target;
+ };
+
+ link.x = function(_) {
+ return arguments.length ? (x$$1 = typeof _ === "function" ? _ : constant$b(+_), link) : x$$1;
+ };
+
+ link.y = function(_) {
+ return arguments.length ? (y$$1 = typeof _ === "function" ? _ : constant$b(+_), link) : y$$1;
+ };
+
+ link.context = function(_) {
+ return arguments.length ? ((context = _ == null ? null : _), link) : context;
+ };
+
+ return link;
+}
+
+function curveHorizontal(context, x0, y0, x1, y1) {
+ context.moveTo(x0, y0);
+ context.bezierCurveTo(x0 = (x0 + x1) / 2, y0, x0, y1, x1, y1);
+}
+
+function curveVertical(context, x0, y0, x1, y1) {
+ context.moveTo(x0, y0);
+ context.bezierCurveTo(x0, y0 = (y0 + y1) / 2, x1, y0, x1, y1);
+}
+
+function curveRadial$1(context, x0, y0, x1, y1) {
+ var p0 = pointRadial(x0, y0),
+ p1 = pointRadial(x0, y0 = (y0 + y1) / 2),
+ p2 = pointRadial(x1, y0),
+ p3 = pointRadial(x1, y1);
+ context.moveTo(p0[0], p0[1]);
+ context.bezierCurveTo(p1[0], p1[1], p2[0], p2[1], p3[0], p3[1]);
+}
+
+function linkHorizontal() {
+ return link$2(curveHorizontal);
+}
+
+function linkVertical() {
+ return link$2(curveVertical);
+}
+
+function linkRadial() {
+ var l = link$2(curveRadial$1);
+ l.angle = l.x, delete l.x;
+ l.radius = l.y, delete l.y;
+ return l;
+}
+
+var circle$2 = {
+ draw: function(context, size) {
+ var r = Math.sqrt(size / pi$4);
+ context.moveTo(r, 0);
+ context.arc(0, 0, r, 0, tau$4);
}
- function d3_uninterpolateNumber(a, b) {
- b = (b -= a = +a) || 1 / b;
- return function(x) {
- return (x - a) / b;
- };
+};
+
+var cross$2 = {
+ draw: function(context, size) {
+ var r = Math.sqrt(size / 5) / 2;
+ context.moveTo(-3 * r, -r);
+ context.lineTo(-r, -r);
+ context.lineTo(-r, -3 * r);
+ context.lineTo(r, -3 * r);
+ context.lineTo(r, -r);
+ context.lineTo(3 * r, -r);
+ context.lineTo(3 * r, r);
+ context.lineTo(r, r);
+ context.lineTo(r, 3 * r);
+ context.lineTo(-r, 3 * r);
+ context.lineTo(-r, r);
+ context.lineTo(-3 * r, r);
+ context.closePath();
+ }
+};
+
+var tan30 = Math.sqrt(1 / 3),
+ tan30_2 = tan30 * 2;
+
+var diamond = {
+ draw: function(context, size) {
+ var y = Math.sqrt(size / tan30_2),
+ x = y * tan30;
+ context.moveTo(0, -y);
+ context.lineTo(x, 0);
+ context.lineTo(0, y);
+ context.lineTo(-x, 0);
+ context.closePath();
+ }
+};
+
+var ka = 0.89081309152928522810,
+ kr = Math.sin(pi$4 / 10) / Math.sin(7 * pi$4 / 10),
+ kx = Math.sin(tau$4 / 10) * kr,
+ ky = -Math.cos(tau$4 / 10) * kr;
+
+var star = {
+ draw: function(context, size) {
+ var r = Math.sqrt(size * ka),
+ x = kx * r,
+ y = ky * r;
+ context.moveTo(0, -r);
+ context.lineTo(x, y);
+ for (var i = 1; i < 5; ++i) {
+ var a = tau$4 * i / 5,
+ c = Math.cos(a),
+ s = Math.sin(a);
+ context.lineTo(s * r, -c * r);
+ context.lineTo(c * x - s * y, s * x + c * y);
+ }
+ context.closePath();
+ }
+};
+
+var square = {
+ draw: function(context, size) {
+ var w = Math.sqrt(size),
+ x = -w / 2;
+ context.rect(x, x, w, w);
}
- function d3_uninterpolateClamp(a, b) {
- b = (b -= a = +a) || 1 / b;
- return function(x) {
- return Math.max(0, Math.min(1, (x - a) / b));
- };
+};
+
+var sqrt3 = Math.sqrt(3);
+
+var triangle = {
+ draw: function(context, size) {
+ var y = -Math.sqrt(size / (sqrt3 * 3));
+ context.moveTo(0, y * 2);
+ context.lineTo(-sqrt3 * y, -y);
+ context.lineTo(sqrt3 * y, -y);
+ context.closePath();
+ }
+};
+
+var c$2 = -0.5,
+ s = Math.sqrt(3) / 2,
+ k = 1 / Math.sqrt(12),
+ a = (k / 2 + 1) * 3;
+
+var wye = {
+ draw: function(context, size) {
+ var r = Math.sqrt(size / a),
+ x0 = r / 2,
+ y0 = r * k,
+ x1 = x0,
+ y1 = r * k + r,
+ x2 = -x1,
+ y2 = y1;
+ context.moveTo(x0, y0);
+ context.lineTo(x1, y1);
+ context.lineTo(x2, y2);
+ context.lineTo(c$2 * x0 - s * y0, s * x0 + c$2 * y0);
+ context.lineTo(c$2 * x1 - s * y1, s * x1 + c$2 * y1);
+ context.lineTo(c$2 * x2 - s * y2, s * x2 + c$2 * y2);
+ context.lineTo(c$2 * x0 + s * y0, c$2 * y0 - s * x0);
+ context.lineTo(c$2 * x1 + s * y1, c$2 * y1 - s * x1);
+ context.lineTo(c$2 * x2 + s * y2, c$2 * y2 - s * x2);
+ context.closePath();
+ }
+};
+
+var symbols = [
+ circle$2,
+ cross$2,
+ diamond,
+ square,
+ star,
+ triangle,
+ wye
+];
+
+function symbol() {
+ var type = constant$b(circle$2),
+ size = constant$b(64),
+ context = null;
+
+ function symbol() {
+ var buffer;
+ if (!context) context = buffer = path();
+ type.apply(this, arguments).draw(context, +size.apply(this, arguments));
+ if (buffer) return context = null, buffer + "" || null;
}
- d3.layout = {};
- d3.layout.bundle = function() {
- return function(links) {
- var paths = [], i = -1, n = links.length;
- while (++i < n) paths.push(d3_layout_bundlePath(links[i]));
- return paths;
- };
+
+ symbol.type = function(_) {
+ return arguments.length ? (type = typeof _ === "function" ? _ : constant$b(_), symbol) : type;
};
- function d3_layout_bundlePath(link) {
- var start = link.source, end = link.target, lca = d3_layout_bundleLeastCommonAncestor(start, end), points = [ start ];
- while (start !== lca) {
- start = start.parent;
- points.push(start);
- }
- var k = points.length;
- while (end !== lca) {
- points.splice(k, 0, end);
- end = end.parent;
- }
- return points;
- }
- function d3_layout_bundleAncestors(node) {
- var ancestors = [], parent = node.parent;
- while (parent != null) {
- ancestors.push(node);
- node = parent;
- parent = parent.parent;
- }
- ancestors.push(node);
- return ancestors;
- }
- function d3_layout_bundleLeastCommonAncestor(a, b) {
- if (a === b) return a;
- var aNodes = d3_layout_bundleAncestors(a), bNodes = d3_layout_bundleAncestors(b), aNode = aNodes.pop(), bNode = bNodes.pop(), sharedNode = null;
- while (aNode === bNode) {
- sharedNode = aNode;
- aNode = aNodes.pop();
- bNode = bNodes.pop();
- }
- return sharedNode;
- }
- d3.layout.chord = function() {
- var chord = {}, chords, groups, matrix, n, padding = 0, sortGroups, sortSubgroups, sortChords;
- function relayout() {
- var subgroups = {}, groupSums = [], groupIndex = d3.range(n), subgroupIndex = [], k, x, x0, i, j;
- chords = [];
- groups = [];
- k = 0, i = -1;
- while (++i < n) {
- x = 0, j = -1;
- while (++j < n) {
- x += matrix[i][j];
- }
- groupSums.push(x);
- subgroupIndex.push(d3.range(n));
- k += x;
- }
- if (sortGroups) {
- groupIndex.sort(function(a, b) {
- return sortGroups(groupSums[a], groupSums[b]);
- });
- }
- if (sortSubgroups) {
- subgroupIndex.forEach(function(d, i) {
- d.sort(function(a, b) {
- return sortSubgroups(matrix[i][a], matrix[i][b]);
- });
- });
+
+ symbol.size = function(_) {
+ return arguments.length ? (size = typeof _ === "function" ? _ : constant$b(+_), symbol) : size;
+ };
+
+ symbol.context = function(_) {
+ return arguments.length ? (context = _ == null ? null : _, symbol) : context;
+ };
+
+ return symbol;
+}
+
+function noop$3() {}
+
+function point$2(that, x, y) {
+ that._context.bezierCurveTo(
+ (2 * that._x0 + that._x1) / 3,
+ (2 * that._y0 + that._y1) / 3,
+ (that._x0 + 2 * that._x1) / 3,
+ (that._y0 + 2 * that._y1) / 3,
+ (that._x0 + 4 * that._x1 + x) / 6,
+ (that._y0 + 4 * that._y1 + y) / 6
+ );
+}
+
+function Basis(context) {
+ this._context = context;
+}
+
+Basis.prototype = {
+ areaStart: function() {
+ this._line = 0;
+ },
+ areaEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._x0 = this._x1 =
+ this._y0 = this._y1 = NaN;
+ this._point = 0;
+ },
+ lineEnd: function() {
+ switch (this._point) {
+ case 3: point$2(this, this._x1, this._y1); // proceed
+ case 2: this._context.lineTo(this._x1, this._y1); break;
+ }
+ if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
+ this._line = 1 - this._line;
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+ switch (this._point) {
+ case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
+ case 1: this._point = 2; break;
+ case 2: this._point = 3; this._context.lineTo((5 * this._x0 + this._x1) / 6, (5 * this._y0 + this._y1) / 6); // proceed
+ default: point$2(this, x, y); break;
+ }
+ this._x0 = this._x1, this._x1 = x;
+ this._y0 = this._y1, this._y1 = y;
+ }
+};
+
+function basis$2(context) {
+ return new Basis(context);
+}
+
+function BasisClosed(context) {
+ this._context = context;
+}
+
+BasisClosed.prototype = {
+ areaStart: noop$3,
+ areaEnd: noop$3,
+ lineStart: function() {
+ this._x0 = this._x1 = this._x2 = this._x3 = this._x4 =
+ this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = NaN;
+ this._point = 0;
+ },
+ lineEnd: function() {
+ switch (this._point) {
+ case 1: {
+ this._context.moveTo(this._x2, this._y2);
+ this._context.closePath();
+ break;
}
- k = (Ï„ - padding * n) / k;
- x = 0, i = -1;
- while (++i < n) {
- x0 = x, j = -1;
- while (++j < n) {
- var di = groupIndex[i], dj = subgroupIndex[di][j], v = matrix[di][dj], a0 = x, a1 = x += v * k;
- subgroups[di + "-" + dj] = {
- index: di,
- subindex: dj,
- startAngle: a0,
- endAngle: a1,
- value: v
- };
- }
- groups[di] = {
- index: di,
- startAngle: x0,
- endAngle: x,
- value: (x - x0) / k
- };
- x += padding;
+ case 2: {
+ this._context.moveTo((this._x2 + 2 * this._x3) / 3, (this._y2 + 2 * this._y3) / 3);
+ this._context.lineTo((this._x3 + 2 * this._x2) / 3, (this._y3 + 2 * this._y2) / 3);
+ this._context.closePath();
+ break;
}
- i = -1;
- while (++i < n) {
- j = i - 1;
- while (++j < n) {
- var source = subgroups[i + "-" + j], target = subgroups[j + "-" + i];
- if (source.value || target.value) {
- chords.push(source.value < target.value ? {
- source: target,
- target: source
- } : {
- source: source,
- target: target
- });
- }
- }
+ case 3: {
+ this.point(this._x2, this._y2);
+ this.point(this._x3, this._y3);
+ this.point(this._x4, this._y4);
+ break;
}
- if (sortChords) resort();
- }
- function resort() {
- chords.sort(function(a, b) {
- return sortChords((a.source.value + a.target.value) / 2, (b.source.value + b.target.value) / 2);
- });
- }
- chord.matrix = function(x) {
- if (!arguments.length) return matrix;
- n = (matrix = x) && matrix.length;
- chords = groups = null;
- return chord;
- };
- chord.padding = function(x) {
- if (!arguments.length) return padding;
- padding = x;
- chords = groups = null;
- return chord;
- };
- chord.sortGroups = function(x) {
- if (!arguments.length) return sortGroups;
- sortGroups = x;
- chords = groups = null;
- return chord;
- };
- chord.sortSubgroups = function(x) {
- if (!arguments.length) return sortSubgroups;
- sortSubgroups = x;
- chords = null;
- return chord;
- };
- chord.sortChords = function(x) {
- if (!arguments.length) return sortChords;
- sortChords = x;
- if (chords) resort();
- return chord;
- };
- chord.chords = function() {
- if (!chords) relayout();
- return chords;
- };
- chord.groups = function() {
- if (!groups) relayout();
- return groups;
- };
- return chord;
- };
- d3.layout.force = function() {
- var force = {}, event = d3.dispatch("start", "tick", "end"), size = [ 1, 1 ], drag, alpha, friction = .9, linkDistance = d3_layout_forceLinkDistance, linkStrength = d3_layout_forceLinkStrength, charge = -30, chargeDistance2 = d3_layout_forceChargeDistance2, gravity = .1, theta2 = .64, nodes = [], links = [], distances, strengths, charges;
- function repulse(node) {
- return function(quad, x1, _, x2) {
- if (quad.point !== node) {
- var dx = quad.cx - node.x, dy = quad.cy - node.y, dw = x2 - x1, dn = dx * dx + dy * dy;
- if (dw * dw / theta2 < dn) {
- if (dn < chargeDistance2) {
- var k = quad.charge / dn;
- node.px -= dx * k;
- node.py -= dy * k;
- }
- return true;
- }
- if (quad.point && dn && dn < chargeDistance2) {
- var k = quad.pointCharge / dn;
- node.px -= dx * k;
- node.py -= dy * k;
- }
- }
- return !quad.charge;
- };
}
- force.tick = function() {
- if ((alpha *= .99) < .005) {
- event.end({
- type: "end",
- alpha: alpha = 0
- });
- return true;
- }
- var n = nodes.length, m = links.length, q, i, o, s, t, l, k, x, y;
- for (i = 0; i < m; ++i) {
- o = links[i];
- s = o.source;
- t = o.target;
- x = t.x - s.x;
- y = t.y - s.y;
- if (l = x * x + y * y) {
- l = alpha * strengths[i] * ((l = Math.sqrt(l)) - distances[i]) / l;
- x *= l;
- y *= l;
- t.x -= x * (k = s.weight / (t.weight + s.weight));
- t.y -= y * k;
- s.x += x * (k = 1 - k);
- s.y += y * k;
- }
- }
- if (k = alpha * gravity) {
- x = size[0] / 2;
- y = size[1] / 2;
- i = -1;
- if (k) while (++i < n) {
- o = nodes[i];
- o.x += (x - o.x) * k;
- o.y += (y - o.y) * k;
- }
- }
- if (charge) {
- d3_layout_forceAccumulate(q = d3.geom.quadtree(nodes), alpha, charges);
- i = -1;
- while (++i < n) {
- if (!(o = nodes[i]).fixed) {
- q.visit(repulse(o));
- }
- }
- }
- i = -1;
- while (++i < n) {
- o = nodes[i];
- if (o.fixed) {
- o.x = o.px;
- o.y = o.py;
- } else {
- o.x -= (o.px - (o.px = o.x)) * friction;
- o.y -= (o.py - (o.py = o.y)) * friction;
- }
- }
- event.tick({
- type: "tick",
- alpha: alpha
- });
- };
- force.nodes = function(x) {
- if (!arguments.length) return nodes;
- nodes = x;
- return force;
- };
- force.links = function(x) {
- if (!arguments.length) return links;
- links = x;
- return force;
- };
- force.size = function(x) {
- if (!arguments.length) return size;
- size = x;
- return force;
- };
- force.linkDistance = function(x) {
- if (!arguments.length) return linkDistance;
- linkDistance = typeof x === "function" ? x : +x;
- return force;
- };
- force.distance = force.linkDistance;
- force.linkStrength = function(x) {
- if (!arguments.length) return linkStrength;
- linkStrength = typeof x === "function" ? x : +x;
- return force;
- };
- force.friction = function(x) {
- if (!arguments.length) return friction;
- friction = +x;
- return force;
- };
- force.charge = function(x) {
- if (!arguments.length) return charge;
- charge = typeof x === "function" ? x : +x;
- return force;
- };
- force.chargeDistance = function(x) {
- if (!arguments.length) return Math.sqrt(chargeDistance2);
- chargeDistance2 = x * x;
- return force;
- };
- force.gravity = function(x) {
- if (!arguments.length) return gravity;
- gravity = +x;
- return force;
- };
- force.theta = function(x) {
- if (!arguments.length) return Math.sqrt(theta2);
- theta2 = x * x;
- return force;
- };
- force.alpha = function(x) {
- if (!arguments.length) return alpha;
- x = +x;
- if (alpha) {
- if (x > 0) alpha = x; else alpha = 0;
- } else if (x > 0) {
- event.start({
- type: "start",
- alpha: alpha = x
- });
- d3.timer(force.tick);
- }
- return force;
- };
- force.start = function() {
- var i, n = nodes.length, m = links.length, w = size[0], h = size[1], neighbors, o;
- for (i = 0; i < n; ++i) {
- (o = nodes[i]).index = i;
- o.weight = 0;
- }
- for (i = 0; i < m; ++i) {
- o = links[i];
- if (typeof o.source == "number") o.source = nodes[o.source];
- if (typeof o.target == "number") o.target = nodes[o.target];
- ++o.source.weight;
- ++o.target.weight;
- }
- for (i = 0; i < n; ++i) {
- o = nodes[i];
- if (isNaN(o.x)) o.x = position("x", w);
- if (isNaN(o.y)) o.y = position("y", h);
- if (isNaN(o.px)) o.px = o.x;
- if (isNaN(o.py)) o.py = o.y;
- }
- distances = [];
- if (typeof linkDistance === "function") for (i = 0; i < m; ++i) distances[i] = +linkDistance.call(this, links[i], i); else for (i = 0; i < m; ++i) distances[i] = linkDistance;
- strengths = [];
- if (typeof linkStrength === "function") for (i = 0; i < m; ++i) strengths[i] = +linkStrength.call(this, links[i], i); else for (i = 0; i < m; ++i) strengths[i] = linkStrength;
- charges = [];
- if (typeof charge === "function") for (i = 0; i < n; ++i) charges[i] = +charge.call(this, nodes[i], i); else for (i = 0; i < n; ++i) charges[i] = charge;
- function position(dimension, size) {
- if (!neighbors) {
- neighbors = new Array(n);
- for (j = 0; j < n; ++j) {
- neighbors[j] = [];
- }
- for (j = 0; j < m; ++j) {
- var o = links[j];
- neighbors[o.source.index].push(o.target);
- neighbors[o.target.index].push(o.source);
- }
- }
- var candidates = neighbors[i], j = -1, m = candidates.length, x;
- while (++j < m) if (!isNaN(x = candidates[j][dimension])) return x;
- return Math.random() * size;
- }
- return force.resume();
- };
- force.resume = function() {
- return force.alpha(.1);
- };
- force.stop = function() {
- return force.alpha(0);
- };
- force.drag = function() {
- if (!drag) drag = d3.behavior.drag().origin(d3_identity).on("dragstart.force", d3_layout_forceDragstart).on("drag.force", dragmove).on("dragend.force", d3_layout_forceDragend);
- if (!arguments.length) return drag;
- this.on("mouseover.force", d3_layout_forceMouseover).on("mouseout.force", d3_layout_forceMouseout).call(drag);
- };
- function dragmove(d) {
- d.px = d3.event.x, d.py = d3.event.y;
- force.resume();
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+ switch (this._point) {
+ case 0: this._point = 1; this._x2 = x, this._y2 = y; break;
+ case 1: this._point = 2; this._x3 = x, this._y3 = y; break;
+ case 2: this._point = 3; this._x4 = x, this._y4 = y; this._context.moveTo((this._x0 + 4 * this._x1 + x) / 6, (this._y0 + 4 * this._y1 + y) / 6); break;
+ default: point$2(this, x, y); break;
}
- return d3.rebind(force, event, "on");
- };
- function d3_layout_forceDragstart(d) {
- d.fixed |= 2;
+ this._x0 = this._x1, this._x1 = x;
+ this._y0 = this._y1, this._y1 = y;
}
- function d3_layout_forceDragend(d) {
- d.fixed &= ~6;
- }
- function d3_layout_forceMouseover(d) {
- d.fixed |= 4;
- d.px = d.x, d.py = d.y;
- }
- function d3_layout_forceMouseout(d) {
- d.fixed &= ~4;
- }
- function d3_layout_forceAccumulate(quad, alpha, charges) {
- var cx = 0, cy = 0;
- quad.charge = 0;
- if (!quad.leaf) {
- var nodes = quad.nodes, n = nodes.length, i = -1, c;
- while (++i < n) {
- c = nodes[i];
- if (c == null) continue;
- d3_layout_forceAccumulate(c, alpha, charges);
- quad.charge += c.charge;
- cx += c.charge * c.cx;
- cy += c.charge * c.cy;
- }
- }
- if (quad.point) {
- if (!quad.leaf) {
- quad.point.x += Math.random() - .5;
- quad.point.y += Math.random() - .5;
- }
- var k = alpha * charges[quad.point.index];
- quad.charge += quad.pointCharge = k;
- cx += k * quad.point.x;
- cy += k * quad.point.y;
- }
- quad.cx = cx / quad.charge;
- quad.cy = cy / quad.charge;
- }
- var d3_layout_forceLinkDistance = 20, d3_layout_forceLinkStrength = 1, d3_layout_forceChargeDistance2 = Infinity;
- d3.layout.hierarchy = function() {
- var sort = d3_layout_hierarchySort, children = d3_layout_hierarchyChildren, value = d3_layout_hierarchyValue;
- function hierarchy(root) {
- var stack = [ root ], nodes = [], node;
- root.depth = 0;
- while ((node = stack.pop()) != null) {
- nodes.push(node);
- if ((childs = children.call(hierarchy, node, node.depth)) && (n = childs.length)) {
- var n, childs, child;
- while (--n >= 0) {
- stack.push(child = childs[n]);
- child.parent = node;
- child.depth = node.depth + 1;
- }
- if (value) node.value = 0;
- node.children = childs;
- } else {
- if (value) node.value = +value.call(hierarchy, node, node.depth) || 0;
- delete node.children;
- }
+};
+
+function basisClosed$1(context) {
+ return new BasisClosed(context);
+}
+
+function BasisOpen(context) {
+ this._context = context;
+}
+
+BasisOpen.prototype = {
+ areaStart: function() {
+ this._line = 0;
+ },
+ areaEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._x0 = this._x1 =
+ this._y0 = this._y1 = NaN;
+ this._point = 0;
+ },
+ lineEnd: function() {
+ if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();
+ this._line = 1 - this._line;
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+ switch (this._point) {
+ case 0: this._point = 1; break;
+ case 1: this._point = 2; break;
+ case 2: this._point = 3; var x0 = (this._x0 + 4 * this._x1 + x) / 6, y0 = (this._y0 + 4 * this._y1 + y) / 6; this._line ? this._context.lineTo(x0, y0) : this._context.moveTo(x0, y0); break;
+ case 3: this._point = 4; // proceed
+ default: point$2(this, x, y); break;
+ }
+ this._x0 = this._x1, this._x1 = x;
+ this._y0 = this._y1, this._y1 = y;
+ }
+};
+
+function basisOpen(context) {
+ return new BasisOpen(context);
+}
+
+function Bundle(context, beta) {
+ this._basis = new Basis(context);
+ this._beta = beta;
+}
+
+Bundle.prototype = {
+ lineStart: function() {
+ this._x = [];
+ this._y = [];
+ this._basis.lineStart();
+ },
+ lineEnd: function() {
+ var x = this._x,
+ y = this._y,
+ j = x.length - 1;
+
+ if (j > 0) {
+ var x0 = x[0],
+ y0 = y[0],
+ dx = x[j] - x0,
+ dy = y[j] - y0,
+ i = -1,
+ t;
+
+ while (++i <= j) {
+ t = i / j;
+ this._basis.point(
+ this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),
+ this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)
+ );
}
- d3_layout_hierarchyVisitAfter(root, function(node) {
- var childs, parent;
- if (sort && (childs = node.children)) childs.sort(sort);
- if (value && (parent = node.parent)) parent.value += node.value;
- });
- return nodes;
}
- hierarchy.sort = function(x) {
- if (!arguments.length) return sort;
- sort = x;
- return hierarchy;
- };
- hierarchy.children = function(x) {
- if (!arguments.length) return children;
- children = x;
- return hierarchy;
- };
- hierarchy.value = function(x) {
- if (!arguments.length) return value;
- value = x;
- return hierarchy;
- };
- hierarchy.revalue = function(root) {
- if (value) {
- d3_layout_hierarchyVisitBefore(root, function(node) {
- if (node.children) node.value = 0;
- });
- d3_layout_hierarchyVisitAfter(root, function(node) {
- var parent;
- if (!node.children) node.value = +value.call(hierarchy, node, node.depth) || 0;
- if (parent = node.parent) parent.value += node.value;
- });
- }
- return root;
- };
- return hierarchy;
+
+ this._x = this._y = null;
+ this._basis.lineEnd();
+ },
+ point: function(x, y) {
+ this._x.push(+x);
+ this._y.push(+y);
+ }
+};
+
+var bundle = (function custom(beta) {
+
+ function bundle(context) {
+ return beta === 1 ? new Basis(context) : new Bundle(context, beta);
+ }
+
+ bundle.beta = function(beta) {
+ return custom(+beta);
};
- function d3_layout_hierarchyRebind(object, hierarchy) {
- d3.rebind(object, hierarchy, "sort", "children", "value");
- object.nodes = object;
- object.links = d3_layout_hierarchyLinks;
- return object;
+
+ return bundle;
+})(0.85);
+
+function point$3(that, x, y) {
+ that._context.bezierCurveTo(
+ that._x1 + that._k * (that._x2 - that._x0),
+ that._y1 + that._k * (that._y2 - that._y0),
+ that._x2 + that._k * (that._x1 - x),
+ that._y2 + that._k * (that._y1 - y),
+ that._x2,
+ that._y2
+ );
+}
+
+function Cardinal(context, tension) {
+ this._context = context;
+ this._k = (1 - tension) / 6;
+}
+
+Cardinal.prototype = {
+ areaStart: function() {
+ this._line = 0;
+ },
+ areaEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._x0 = this._x1 = this._x2 =
+ this._y0 = this._y1 = this._y2 = NaN;
+ this._point = 0;
+ },
+ lineEnd: function() {
+ switch (this._point) {
+ case 2: this._context.lineTo(this._x2, this._y2); break;
+ case 3: point$3(this, this._x1, this._y1); break;
+ }
+ if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
+ this._line = 1 - this._line;
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+ switch (this._point) {
+ case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
+ case 1: this._point = 2; this._x1 = x, this._y1 = y; break;
+ case 2: this._point = 3; // proceed
+ default: point$3(this, x, y); break;
+ }
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
+ }
+};
+
+var cardinal = (function custom(tension) {
+
+ function cardinal(context) {
+ return new Cardinal(context, tension);
}
- function d3_layout_hierarchyVisitBefore(node, callback) {
- var nodes = [ node ];
- while ((node = nodes.pop()) != null) {
- callback(node);
- if ((children = node.children) && (n = children.length)) {
- var n, children;
- while (--n >= 0) nodes.push(children[n]);
+
+ cardinal.tension = function(tension) {
+ return custom(+tension);
+ };
+
+ return cardinal;
+})(0);
+
+function CardinalClosed(context, tension) {
+ this._context = context;
+ this._k = (1 - tension) / 6;
+}
+
+CardinalClosed.prototype = {
+ areaStart: noop$3,
+ areaEnd: noop$3,
+ lineStart: function() {
+ this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =
+ this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;
+ this._point = 0;
+ },
+ lineEnd: function() {
+ switch (this._point) {
+ case 1: {
+ this._context.moveTo(this._x3, this._y3);
+ this._context.closePath();
+ break;
}
- }
- }
- function d3_layout_hierarchyVisitAfter(node, callback) {
- var nodes = [ node ], nodes2 = [];
- while ((node = nodes.pop()) != null) {
- nodes2.push(node);
- if ((children = node.children) && (n = children.length)) {
- var i = -1, n, children;
- while (++i < n) nodes.push(children[i]);
+ case 2: {
+ this._context.lineTo(this._x3, this._y3);
+ this._context.closePath();
+ break;
+ }
+ case 3: {
+ this.point(this._x3, this._y3);
+ this.point(this._x4, this._y4);
+ this.point(this._x5, this._y5);
+ break;
}
}
- while ((node = nodes2.pop()) != null) {
- callback(node);
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+ switch (this._point) {
+ case 0: this._point = 1; this._x3 = x, this._y3 = y; break;
+ case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;
+ case 2: this._point = 3; this._x5 = x, this._y5 = y; break;
+ default: point$3(this, x, y); break;
}
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
}
- function d3_layout_hierarchyChildren(d) {
- return d.children;
+};
+
+var cardinalClosed = (function custom(tension) {
+
+ function cardinal$$1(context) {
+ return new CardinalClosed(context, tension);
}
- function d3_layout_hierarchyValue(d) {
- return d.value;
+
+ cardinal$$1.tension = function(tension) {
+ return custom(+tension);
+ };
+
+ return cardinal$$1;
+})(0);
+
+function CardinalOpen(context, tension) {
+ this._context = context;
+ this._k = (1 - tension) / 6;
+}
+
+CardinalOpen.prototype = {
+ areaStart: function() {
+ this._line = 0;
+ },
+ areaEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._x0 = this._x1 = this._x2 =
+ this._y0 = this._y1 = this._y2 = NaN;
+ this._point = 0;
+ },
+ lineEnd: function() {
+ if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();
+ this._line = 1 - this._line;
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+ switch (this._point) {
+ case 0: this._point = 1; break;
+ case 1: this._point = 2; break;
+ case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;
+ case 3: this._point = 4; // proceed
+ default: point$3(this, x, y); break;
+ }
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
+ }
+};
+
+var cardinalOpen = (function custom(tension) {
+
+ function cardinal$$1(context) {
+ return new CardinalOpen(context, tension);
}
- function d3_layout_hierarchySort(a, b) {
- return b.value - a.value;
+
+ cardinal$$1.tension = function(tension) {
+ return custom(+tension);
+ };
+
+ return cardinal$$1;
+})(0);
+
+function point$4(that, x, y) {
+ var x1 = that._x1,
+ y1 = that._y1,
+ x2 = that._x2,
+ y2 = that._y2;
+
+ if (that._l01_a > epsilon$3) {
+ var a = 2 * that._l01_2a + 3 * that._l01_a * that._l12_a + that._l12_2a,
+ n = 3 * that._l01_a * (that._l01_a + that._l12_a);
+ x1 = (x1 * a - that._x0 * that._l12_2a + that._x2 * that._l01_2a) / n;
+ y1 = (y1 * a - that._y0 * that._l12_2a + that._y2 * that._l01_2a) / n;
}
- function d3_layout_hierarchyLinks(nodes) {
- return d3.merge(nodes.map(function(parent) {
- return (parent.children || []).map(function(child) {
- return {
- source: parent,
- target: child
- };
- });
- }));
+
+ if (that._l23_a > epsilon$3) {
+ var b = 2 * that._l23_2a + 3 * that._l23_a * that._l12_a + that._l12_2a,
+ m = 3 * that._l23_a * (that._l23_a + that._l12_a);
+ x2 = (x2 * b + that._x1 * that._l23_2a - x * that._l12_2a) / m;
+ y2 = (y2 * b + that._y1 * that._l23_2a - y * that._l12_2a) / m;
}
- d3.layout.partition = function() {
- var hierarchy = d3.layout.hierarchy(), size = [ 1, 1 ];
- function position(node, x, dx, dy) {
- var children = node.children;
- node.x = x;
- node.y = node.depth * dy;
- node.dx = dx;
- node.dy = dy;
- if (children && (n = children.length)) {
- var i = -1, n, c, d;
- dx = node.value ? dx / node.value : 0;
- while (++i < n) {
- position(c = children[i], x, d = c.value * dx, dy);
- x += d;
- }
- }
- }
- function depth(node) {
- var children = node.children, d = 0;
- if (children && (n = children.length)) {
- var i = -1, n;
- while (++i < n) d = Math.max(d, depth(children[i]));
- }
- return 1 + d;
- }
- function partition(d, i) {
- var nodes = hierarchy.call(this, d, i);
- position(nodes[0], 0, size[0], size[1] / depth(nodes[0]));
- return nodes;
- }
- partition.size = function(x) {
- if (!arguments.length) return size;
- size = x;
- return partition;
- };
- return d3_layout_hierarchyRebind(partition, hierarchy);
- };
- d3.layout.pie = function() {
- var value = Number, sort = d3_layout_pieSortByValue, startAngle = 0, endAngle = Ï„;
- function pie(data) {
- var values = data.map(function(d, i) {
- return +value.call(pie, d, i);
- });
- var a = +(typeof startAngle === "function" ? startAngle.apply(this, arguments) : startAngle);
- var k = ((typeof endAngle === "function" ? endAngle.apply(this, arguments) : endAngle) - a) / d3.sum(values);
- var index = d3.range(data.length);
- if (sort != null) index.sort(sort === d3_layout_pieSortByValue ? function(i, j) {
- return values[j] - values[i];
- } : function(i, j) {
- return sort(data[i], data[j]);
- });
- var arcs = [];
- index.forEach(function(i) {
- var d;
- arcs[i] = {
- data: data[i],
- value: d = values[i],
- startAngle: a,
- endAngle: a += d * k
- };
- });
- return arcs;
+
+ that._context.bezierCurveTo(x1, y1, x2, y2, that._x2, that._y2);
+}
+
+function CatmullRom(context, alpha) {
+ this._context = context;
+ this._alpha = alpha;
+}
+
+CatmullRom.prototype = {
+ areaStart: function() {
+ this._line = 0;
+ },
+ areaEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._x0 = this._x1 = this._x2 =
+ this._y0 = this._y1 = this._y2 = NaN;
+ this._l01_a = this._l12_a = this._l23_a =
+ this._l01_2a = this._l12_2a = this._l23_2a =
+ this._point = 0;
+ },
+ lineEnd: function() {
+ switch (this._point) {
+ case 2: this._context.lineTo(this._x2, this._y2); break;
+ case 3: this.point(this._x2, this._y2); break;
+ }
+ if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
+ this._line = 1 - this._line;
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+
+ if (this._point) {
+ var x23 = this._x2 - x,
+ y23 = this._y2 - y;
+ this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
}
- pie.value = function(x) {
- if (!arguments.length) return value;
- value = x;
- return pie;
- };
- pie.sort = function(x) {
- if (!arguments.length) return sort;
- sort = x;
- return pie;
- };
- pie.startAngle = function(x) {
- if (!arguments.length) return startAngle;
- startAngle = x;
- return pie;
- };
- pie.endAngle = function(x) {
- if (!arguments.length) return endAngle;
- endAngle = x;
- return pie;
- };
- return pie;
- };
- var d3_layout_pieSortByValue = {};
- d3.layout.stack = function() {
- var values = d3_identity, order = d3_layout_stackOrderDefault, offset = d3_layout_stackOffsetZero, out = d3_layout_stackOut, x = d3_layout_stackX, y = d3_layout_stackY;
- function stack(data, index) {
- if (!(n = data.length)) return data;
- var series = data.map(function(d, i) {
- return values.call(stack, d, i);
- });
- var points = series.map(function(d) {
- return d.map(function(v, i) {
- return [ x.call(stack, v, i), y.call(stack, v, i) ];
- });
- });
- var orders = order.call(stack, points, index);
- series = d3.permute(series, orders);
- points = d3.permute(points, orders);
- var offsets = offset.call(stack, points, index);
- var m = series[0].length, n, i, j, o;
- for (j = 0; j < m; ++j) {
- out.call(stack, series[0][j], o = offsets[j], points[0][j][1]);
- for (i = 1; i < n; ++i) {
- out.call(stack, series[i][j], o += points[i - 1][j][1], points[i][j][1]);
- }
- }
- return data;
+
+ switch (this._point) {
+ case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
+ case 1: this._point = 2; break;
+ case 2: this._point = 3; // proceed
+ default: point$4(this, x, y); break;
}
- stack.values = function(x) {
- if (!arguments.length) return values;
- values = x;
- return stack;
- };
- stack.order = function(x) {
- if (!arguments.length) return order;
- order = typeof x === "function" ? x : d3_layout_stackOrders.get(x) || d3_layout_stackOrderDefault;
- return stack;
- };
- stack.offset = function(x) {
- if (!arguments.length) return offset;
- offset = typeof x === "function" ? x : d3_layout_stackOffsets.get(x) || d3_layout_stackOffsetZero;
- return stack;
- };
- stack.x = function(z) {
- if (!arguments.length) return x;
- x = z;
- return stack;
- };
- stack.y = function(z) {
- if (!arguments.length) return y;
- y = z;
- return stack;
- };
- stack.out = function(z) {
- if (!arguments.length) return out;
- out = z;
- return stack;
- };
- return stack;
- };
- function d3_layout_stackX(d) {
- return d.x;
- }
- function d3_layout_stackY(d) {
- return d.y;
+
+ this._l01_a = this._l12_a, this._l12_a = this._l23_a;
+ this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
}
- function d3_layout_stackOut(d, y0, y) {
- d.y0 = y0;
- d.y = y;
+};
+
+var catmullRom = (function custom(alpha) {
+
+ function catmullRom(context) {
+ return alpha ? new CatmullRom(context, alpha) : new Cardinal(context, 0);
}
- var d3_layout_stackOrders = d3.map({
- "inside-out": function(data) {
- var n = data.length, i, j, max = data.map(d3_layout_stackMaxIndex), sums = data.map(d3_layout_stackReduceSum), index = d3.range(n).sort(function(a, b) {
- return max[a] - max[b];
- }), top = 0, bottom = 0, tops = [], bottoms = [];
- for (i = 0; i < n; ++i) {
- j = index[i];
- if (top < bottom) {
- top += sums[j];
- tops.push(j);
- } else {
- bottom += sums[j];
- bottoms.push(j);
- }
+
+ catmullRom.alpha = function(alpha) {
+ return custom(+alpha);
+ };
+
+ return catmullRom;
+})(0.5);
+
+function CatmullRomClosed(context, alpha) {
+ this._context = context;
+ this._alpha = alpha;
+}
+
+CatmullRomClosed.prototype = {
+ areaStart: noop$3,
+ areaEnd: noop$3,
+ lineStart: function() {
+ this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =
+ this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;
+ this._l01_a = this._l12_a = this._l23_a =
+ this._l01_2a = this._l12_2a = this._l23_2a =
+ this._point = 0;
+ },
+ lineEnd: function() {
+ switch (this._point) {
+ case 1: {
+ this._context.moveTo(this._x3, this._y3);
+ this._context.closePath();
+ break;
}
- return bottoms.reverse().concat(tops);
- },
- reverse: function(data) {
- return d3.range(data.length).reverse();
- },
- "default": d3_layout_stackOrderDefault
- });
- var d3_layout_stackOffsets = d3.map({
- silhouette: function(data) {
- var n = data.length, m = data[0].length, sums = [], max = 0, i, j, o, y0 = [];
- for (j = 0; j < m; ++j) {
- for (i = 0, o = 0; i < n; i++) o += data[i][j][1];
- if (o > max) max = o;
- sums.push(o);
- }
- for (j = 0; j < m; ++j) {
- y0[j] = (max - sums[j]) / 2;
- }
- return y0;
- },
- wiggle: function(data) {
- var n = data.length, x = data[0], m = x.length, i, j, k, s1, s2, s3, dx, o, o0, y0 = [];
- y0[0] = o = o0 = 0;
- for (j = 1; j < m; ++j) {
- for (i = 0, s1 = 0; i < n; ++i) s1 += data[i][j][1];
- for (i = 0, s2 = 0, dx = x[j][0] - x[j - 1][0]; i < n; ++i) {
- for (k = 0, s3 = (data[i][j][1] - data[i][j - 1][1]) / (2 * dx); k < i; ++k) {
- s3 += (data[k][j][1] - data[k][j - 1][1]) / dx;
- }
- s2 += s3 * data[i][j][1];
- }
- y0[j] = o -= s1 ? s2 / s1 * dx : 0;
- if (o < o0) o0 = o;
+ case 2: {
+ this._context.lineTo(this._x3, this._y3);
+ this._context.closePath();
+ break;
}
- for (j = 0; j < m; ++j) y0[j] -= o0;
- return y0;
- },
- expand: function(data) {
- var n = data.length, m = data[0].length, k = 1 / n, i, j, o, y0 = [];
- for (j = 0; j < m; ++j) {
- for (i = 0, o = 0; i < n; i++) o += data[i][j][1];
- if (o) for (i = 0; i < n; i++) data[i][j][1] /= o; else for (i = 0; i < n; i++) data[i][j][1] = k;
- }
- for (j = 0; j < m; ++j) y0[j] = 0;
- return y0;
- },
- zero: d3_layout_stackOffsetZero
- });
- function d3_layout_stackOrderDefault(data) {
- return d3.range(data.length);
- }
- function d3_layout_stackOffsetZero(data) {
- var j = -1, m = data[0].length, y0 = [];
- while (++j < m) y0[j] = 0;
- return y0;
- }
- function d3_layout_stackMaxIndex(array) {
- var i = 1, j = 0, v = array[0][1], k, n = array.length;
- for (;i < n; ++i) {
- if ((k = array[i][1]) > v) {
- j = i;
- v = k;
+ case 3: {
+ this.point(this._x3, this._y3);
+ this.point(this._x4, this._y4);
+ this.point(this._x5, this._y5);
+ break;
}
}
- return j;
- }
- function d3_layout_stackReduceSum(d) {
- return d.reduce(d3_layout_stackSum, 0);
- }
- function d3_layout_stackSum(p, d) {
- return p + d[1];
- }
- d3.layout.histogram = function() {
- var frequency = true, valuer = Number, ranger = d3_layout_histogramRange, binner = d3_layout_histogramBinSturges;
- function histogram(data, i) {
- var bins = [], values = data.map(valuer, this), range = ranger.call(this, values, i), thresholds = binner.call(this, range, values, i), bin, i = -1, n = values.length, m = thresholds.length - 1, k = frequency ? 1 : 1 / n, x;
- while (++i < m) {
- bin = bins[i] = [];
- bin.dx = thresholds[i + 1] - (bin.x = thresholds[i]);
- bin.y = 0;
- }
- if (m > 0) {
- i = -1;
- while (++i < n) {
- x = values[i];
- if (x >= range[0] && x <= range[1]) {
- bin = bins[d3.bisect(thresholds, x, 1, m) - 1];
- bin.y += k;
- bin.push(data[i]);
- }
- }
- }
- return bins;
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+
+ if (this._point) {
+ var x23 = this._x2 - x,
+ y23 = this._y2 - y;
+ this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
}
- histogram.value = function(x) {
- if (!arguments.length) return valuer;
- valuer = x;
- return histogram;
- };
- histogram.range = function(x) {
- if (!arguments.length) return ranger;
- ranger = d3_functor(x);
- return histogram;
- };
- histogram.bins = function(x) {
- if (!arguments.length) return binner;
- binner = typeof x === "number" ? function(range) {
- return d3_layout_histogramBinFixed(range, x);
- } : d3_functor(x);
- return histogram;
- };
- histogram.frequency = function(x) {
- if (!arguments.length) return frequency;
- frequency = !!x;
- return histogram;
- };
- return histogram;
- };
- function d3_layout_histogramBinSturges(range, values) {
- return d3_layout_histogramBinFixed(range, Math.ceil(Math.log(values.length) / Math.LN2 + 1));
- }
- function d3_layout_histogramBinFixed(range, n) {
- var x = -1, b = +range[0], m = (range[1] - b) / n, f = [];
- while (++x <= n) f[x] = m * x + b;
- return f;
+
+ switch (this._point) {
+ case 0: this._point = 1; this._x3 = x, this._y3 = y; break;
+ case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;
+ case 2: this._point = 3; this._x5 = x, this._y5 = y; break;
+ default: point$4(this, x, y); break;
+ }
+
+ this._l01_a = this._l12_a, this._l12_a = this._l23_a;
+ this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
}
- function d3_layout_histogramRange(values) {
- return [ d3.min(values), d3.max(values) ];
+};
+
+var catmullRomClosed = (function custom(alpha) {
+
+ function catmullRom$$1(context) {
+ return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);
}
- d3.layout.pack = function() {
- var hierarchy = d3.layout.hierarchy().sort(d3_layout_packSort), padding = 0, size = [ 1, 1 ], radius;
- function pack(d, i) {
- var nodes = hierarchy.call(this, d, i), root = nodes[0], w = size[0], h = size[1], r = radius == null ? Math.sqrt : typeof radius === "function" ? radius : function() {
- return radius;
- };
- root.x = root.y = 0;
- d3_layout_hierarchyVisitAfter(root, function(d) {
- d.r = +r(d.value);
- });
- d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings);
- if (padding) {
- var dr = padding * (radius ? 1 : Math.max(2 * root.r / w, 2 * root.r / h)) / 2;
- d3_layout_hierarchyVisitAfter(root, function(d) {
- d.r += dr;
- });
- d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings);
- d3_layout_hierarchyVisitAfter(root, function(d) {
- d.r -= dr;
- });
- }
- d3_layout_packTransform(root, w / 2, h / 2, radius ? 1 : 1 / Math.max(2 * root.r / w, 2 * root.r / h));
- return nodes;
- }
- pack.size = function(_) {
- if (!arguments.length) return size;
- size = _;
- return pack;
- };
- pack.radius = function(_) {
- if (!arguments.length) return radius;
- radius = _ == null || typeof _ === "function" ? _ : +_;
- return pack;
- };
- pack.padding = function(_) {
- if (!arguments.length) return padding;
- padding = +_;
- return pack;
- };
- return d3_layout_hierarchyRebind(pack, hierarchy);
- };
- function d3_layout_packSort(a, b) {
- return a.value - b.value;
- }
- function d3_layout_packInsert(a, b) {
- var c = a._pack_next;
- a._pack_next = b;
- b._pack_prev = a;
- b._pack_next = c;
- c._pack_prev = b;
- }
- function d3_layout_packSplice(a, b) {
- a._pack_next = b;
- b._pack_prev = a;
- }
- function d3_layout_packIntersects(a, b) {
- var dx = b.x - a.x, dy = b.y - a.y, dr = a.r + b.r;
- return .999 * dr * dr > dx * dx + dy * dy;
- }
- function d3_layout_packSiblings(node) {
- if (!(nodes = node.children) || !(n = nodes.length)) return;
- var nodes, xMin = Infinity, xMax = -Infinity, yMin = Infinity, yMax = -Infinity, a, b, c, i, j, k, n;
- function bound(node) {
- xMin = Math.min(node.x - node.r, xMin);
- xMax = Math.max(node.x + node.r, xMax);
- yMin = Math.min(node.y - node.r, yMin);
- yMax = Math.max(node.y + node.r, yMax);
- }
- nodes.forEach(d3_layout_packLink);
- a = nodes[0];
- a.x = -a.r;
- a.y = 0;
- bound(a);
- if (n > 1) {
- b = nodes[1];
- b.x = b.r;
- b.y = 0;
- bound(b);
- if (n > 2) {
- c = nodes[2];
- d3_layout_packPlace(a, b, c);
- bound(c);
- d3_layout_packInsert(a, c);
- a._pack_prev = c;
- d3_layout_packInsert(c, b);
- b = a._pack_next;
- for (i = 3; i < n; i++) {
- d3_layout_packPlace(a, b, c = nodes[i]);
- var isect = 0, s1 = 1, s2 = 1;
- for (j = b._pack_next; j !== b; j = j._pack_next, s1++) {
- if (d3_layout_packIntersects(j, c)) {
- isect = 1;
- break;
- }
- }
- if (isect == 1) {
- for (k = a._pack_prev; k !== j._pack_prev; k = k._pack_prev, s2++) {
- if (d3_layout_packIntersects(k, c)) {
- break;
- }
- }
- }
- if (isect) {
- if (s1 < s2 || s1 == s2 && b.r < a.r) d3_layout_packSplice(a, b = j); else d3_layout_packSplice(a = k, b);
- i--;
- } else {
- d3_layout_packInsert(a, c);
- b = c;
- bound(c);
- }
- }
- }
+
+ catmullRom$$1.alpha = function(alpha) {
+ return custom(+alpha);
+ };
+
+ return catmullRom$$1;
+})(0.5);
+
+function CatmullRomOpen(context, alpha) {
+ this._context = context;
+ this._alpha = alpha;
+}
+
+CatmullRomOpen.prototype = {
+ areaStart: function() {
+ this._line = 0;
+ },
+ areaEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._x0 = this._x1 = this._x2 =
+ this._y0 = this._y1 = this._y2 = NaN;
+ this._l01_a = this._l12_a = this._l23_a =
+ this._l01_2a = this._l12_2a = this._l23_2a =
+ this._point = 0;
+ },
+ lineEnd: function() {
+ if (this._line || (this._line !== 0 && this._point === 3)) this._context.closePath();
+ this._line = 1 - this._line;
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+
+ if (this._point) {
+ var x23 = this._x2 - x,
+ y23 = this._y2 - y;
+ this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
}
- var cx = (xMin + xMax) / 2, cy = (yMin + yMax) / 2, cr = 0;
- for (i = 0; i < n; i++) {
- c = nodes[i];
- c.x -= cx;
- c.y -= cy;
- cr = Math.max(cr, c.r + Math.sqrt(c.x * c.x + c.y * c.y));
+
+ switch (this._point) {
+ case 0: this._point = 1; break;
+ case 1: this._point = 2; break;
+ case 2: this._point = 3; this._line ? this._context.lineTo(this._x2, this._y2) : this._context.moveTo(this._x2, this._y2); break;
+ case 3: this._point = 4; // proceed
+ default: point$4(this, x, y); break;
}
- node.r = cr;
- nodes.forEach(d3_layout_packUnlink);
+
+ this._l01_a = this._l12_a, this._l12_a = this._l23_a;
+ this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
+ this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
+ this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
}
- function d3_layout_packLink(node) {
- node._pack_next = node._pack_prev = node;
+};
+
+var catmullRomOpen = (function custom(alpha) {
+
+ function catmullRom$$1(context) {
+ return alpha ? new CatmullRomOpen(context, alpha) : new CardinalOpen(context, 0);
}
- function d3_layout_packUnlink(node) {
- delete node._pack_next;
- delete node._pack_prev;
+
+ catmullRom$$1.alpha = function(alpha) {
+ return custom(+alpha);
+ };
+
+ return catmullRom$$1;
+})(0.5);
+
+function LinearClosed(context) {
+ this._context = context;
+}
+
+LinearClosed.prototype = {
+ areaStart: noop$3,
+ areaEnd: noop$3,
+ lineStart: function() {
+ this._point = 0;
+ },
+ lineEnd: function() {
+ if (this._point) this._context.closePath();
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+ if (this._point) this._context.lineTo(x, y);
+ else this._point = 1, this._context.moveTo(x, y);
+ }
+};
+
+function linearClosed(context) {
+ return new LinearClosed(context);
+}
+
+function sign$1(x) {
+ return x < 0 ? -1 : 1;
+}
+
+// Calculate the slopes of the tangents (Hermite-type interpolation) based on
+// the following paper: Steffen, M. 1990. A Simple Method for Monotonic
+// Interpolation in One Dimension. Astronomy and Astrophysics, Vol. 239, NO.
+// NOV(II), P. 443, 1990.
+function slope3(that, x2, y2) {
+ var h0 = that._x1 - that._x0,
+ h1 = x2 - that._x1,
+ s0 = (that._y1 - that._y0) / (h0 || h1 < 0 && -0),
+ s1 = (y2 - that._y1) / (h1 || h0 < 0 && -0),
+ p = (s0 * h1 + s1 * h0) / (h0 + h1);
+ return (sign$1(s0) + sign$1(s1)) * Math.min(Math.abs(s0), Math.abs(s1), 0.5 * Math.abs(p)) || 0;
+}
+
+// Calculate a one-sided slope.
+function slope2(that, t) {
+ var h = that._x1 - that._x0;
+ return h ? (3 * (that._y1 - that._y0) / h - t) / 2 : t;
+}
+
+// According to https://en.wikipedia.org/wiki/Cubic_Hermite_spline#Representations
+// "you can express cubic Hermite interpolation in terms of cubic Bézier curves
+// with respect to the four values p0, p0 + m0 / 3, p1 - m1 / 3, p1".
+function point$5(that, t0, t1) {
+ var x0 = that._x0,
+ y0 = that._y0,
+ x1 = that._x1,
+ y1 = that._y1,
+ dx = (x1 - x0) / 3;
+ that._context.bezierCurveTo(x0 + dx, y0 + dx * t0, x1 - dx, y1 - dx * t1, x1, y1);
+}
+
+function MonotoneX(context) {
+ this._context = context;
+}
+
+MonotoneX.prototype = {
+ areaStart: function() {
+ this._line = 0;
+ },
+ areaEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._x0 = this._x1 =
+ this._y0 = this._y1 =
+ this._t0 = NaN;
+ this._point = 0;
+ },
+ lineEnd: function() {
+ switch (this._point) {
+ case 2: this._context.lineTo(this._x1, this._y1); break;
+ case 3: point$5(this, this._t0, slope2(this, this._t0)); break;
+ }
+ if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
+ this._line = 1 - this._line;
+ },
+ point: function(x, y) {
+ var t1 = NaN;
+
+ x = +x, y = +y;
+ if (x === this._x1 && y === this._y1) return; // Ignore coincident points.
+ switch (this._point) {
+ case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
+ case 1: this._point = 2; break;
+ case 2: this._point = 3; point$5(this, slope2(this, t1 = slope3(this, x, y)), t1); break;
+ default: point$5(this, this._t0, t1 = slope3(this, x, y)); break;
+ }
+
+ this._x0 = this._x1, this._x1 = x;
+ this._y0 = this._y1, this._y1 = y;
+ this._t0 = t1;
}
- function d3_layout_packTransform(node, x, y, k) {
- var children = node.children;
- node.x = x += k * node.x;
- node.y = y += k * node.y;
- node.r *= k;
- if (children) {
- var i = -1, n = children.length;
- while (++i < n) d3_layout_packTransform(children[i], x, y, k);
- }
- }
- function d3_layout_packPlace(a, b, c) {
- var db = a.r + c.r, dx = b.x - a.x, dy = b.y - a.y;
- if (db && (dx || dy)) {
- var da = b.r + c.r, dc = dx * dx + dy * dy;
- da *= da;
- db *= db;
- var x = .5 + (db - da) / (2 * dc), y = Math.sqrt(Math.max(0, 2 * da * (db + dc) - (db -= dc) * db - da * da)) / (2 * dc);
- c.x = a.x + x * dx + y * dy;
- c.y = a.y + x * dy - y * dx;
- } else {
- c.x = a.x + db;
- c.y = a.y;
- }
- }
- d3.layout.tree = function() {
- var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = null;
- function tree(d, i) {
- var nodes = hierarchy.call(this, d, i), root0 = nodes[0], root1 = wrapTree(root0);
- d3_layout_hierarchyVisitAfter(root1, firstWalk), root1.parent.m = -root1.z;
- d3_layout_hierarchyVisitBefore(root1, secondWalk);
- if (nodeSize) d3_layout_hierarchyVisitBefore(root0, sizeNode); else {
- var left = root0, right = root0, bottom = root0;
- d3_layout_hierarchyVisitBefore(root0, function(node) {
- if (node.x < left.x) left = node;
- if (node.x > right.x) right = node;
- if (node.depth > bottom.depth) bottom = node;
- });
- var tx = separation(left, right) / 2 - left.x, kx = size[0] / (right.x + separation(right, left) / 2 + tx), ky = size[1] / (bottom.depth || 1);
- d3_layout_hierarchyVisitBefore(root0, function(node) {
- node.x = (node.x + tx) * kx;
- node.y = node.depth * ky;
- });
- }
- return nodes;
- }
- function wrapTree(root0) {
- var root1 = {
- A: null,
- children: [ root0 ]
- }, queue = [ root1 ], node1;
- while ((node1 = queue.pop()) != null) {
- for (var children = node1.children, child, i = 0, n = children.length; i < n; ++i) {
- queue.push((children[i] = child = {
- _: children[i],
- parent: node1,
- children: (child = children[i].children) && child.slice() || [],
- A: null,
- a: null,
- z: 0,
- m: 0,
- c: 0,
- s: 0,
- t: null,
- i: i
- }).a = child);
+};
+
+function MonotoneY(context) {
+ this._context = new ReflectContext(context);
+}
+
+(MonotoneY.prototype = Object.create(MonotoneX.prototype)).point = function(x, y) {
+ MonotoneX.prototype.point.call(this, y, x);
+};
+
+function ReflectContext(context) {
+ this._context = context;
+}
+
+ReflectContext.prototype = {
+ moveTo: function(x, y) { this._context.moveTo(y, x); },
+ closePath: function() { this._context.closePath(); },
+ lineTo: function(x, y) { this._context.lineTo(y, x); },
+ bezierCurveTo: function(x1, y1, x2, y2, x, y) { this._context.bezierCurveTo(y1, x1, y2, x2, y, x); }
+};
+
+function monotoneX(context) {
+ return new MonotoneX(context);
+}
+
+function monotoneY(context) {
+ return new MonotoneY(context);
+}
+
+function Natural(context) {
+ this._context = context;
+}
+
+Natural.prototype = {
+ areaStart: function() {
+ this._line = 0;
+ },
+ areaEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._x = [];
+ this._y = [];
+ },
+ lineEnd: function() {
+ var x = this._x,
+ y = this._y,
+ n = x.length;
+
+ if (n) {
+ this._line ? this._context.lineTo(x[0], y[0]) : this._context.moveTo(x[0], y[0]);
+ if (n === 2) {
+ this._context.lineTo(x[1], y[1]);
+ } else {
+ var px = controlPoints(x),
+ py = controlPoints(y);
+ for (var i0 = 0, i1 = 1; i1 < n; ++i0, ++i1) {
+ this._context.bezierCurveTo(px[0][i0], py[0][i0], px[1][i0], py[1][i0], x[i1], y[i1]);
}
}
- return root1.children[0];
}
- function firstWalk(v) {
- var children = v.children, siblings = v.parent.children, w = v.i ? siblings[v.i - 1] : null;
- if (children.length) {
- d3_layout_treeShift(v);
- var midpoint = (children[0].z + children[children.length - 1].z) / 2;
- if (w) {
- v.z = w.z + separation(v._, w._);
- v.m = v.z - midpoint;
+
+ if (this._line || (this._line !== 0 && n === 1)) this._context.closePath();
+ this._line = 1 - this._line;
+ this._x = this._y = null;
+ },
+ point: function(x, y) {
+ this._x.push(+x);
+ this._y.push(+y);
+ }
+};
+
+// See https://www.particleincell.com/2012/bezier-splines/ for derivation.
+function controlPoints(x) {
+ var i,
+ n = x.length - 1,
+ m,
+ a = new Array(n),
+ b = new Array(n),
+ r = new Array(n);
+ a[0] = 0, b[0] = 2, r[0] = x[0] + 2 * x[1];
+ for (i = 1; i < n - 1; ++i) a[i] = 1, b[i] = 4, r[i] = 4 * x[i] + 2 * x[i + 1];
+ a[n - 1] = 2, b[n - 1] = 7, r[n - 1] = 8 * x[n - 1] + x[n];
+ for (i = 1; i < n; ++i) m = a[i] / b[i - 1], b[i] -= m, r[i] -= m * r[i - 1];
+ a[n - 1] = r[n - 1] / b[n - 1];
+ for (i = n - 2; i >= 0; --i) a[i] = (r[i] - a[i + 1]) / b[i];
+ b[n - 1] = (x[n] + a[n - 1]) / 2;
+ for (i = 0; i < n - 1; ++i) b[i] = 2 * x[i + 1] - a[i + 1];
+ return [a, b];
+}
+
+function natural(context) {
+ return new Natural(context);
+}
+
+function Step(context, t) {
+ this._context = context;
+ this._t = t;
+}
+
+Step.prototype = {
+ areaStart: function() {
+ this._line = 0;
+ },
+ areaEnd: function() {
+ this._line = NaN;
+ },
+ lineStart: function() {
+ this._x = this._y = NaN;
+ this._point = 0;
+ },
+ lineEnd: function() {
+ if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);
+ if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
+ if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;
+ },
+ point: function(x, y) {
+ x = +x, y = +y;
+ switch (this._point) {
+ case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
+ case 1: this._point = 2; // proceed
+ default: {
+ if (this._t <= 0) {
+ this._context.lineTo(this._x, y);
+ this._context.lineTo(x, y);
} else {
- v.z = midpoint;
+ var x1 = this._x * (1 - this._t) + x * this._t;
+ this._context.lineTo(x1, this._y);
+ this._context.lineTo(x1, y);
}
- } else if (w) {
- v.z = w.z + separation(v._, w._);
+ break;
}
- v.parent.A = apportion(v, w, v.parent.A || siblings[0]);
}
- function secondWalk(v) {
- v._.x = v.z + v.parent.m;
- v.m += v.parent.m;
+ this._x = x, this._y = y;
+ }
+};
+
+function step(context) {
+ return new Step(context, 0.5);
+}
+
+function stepBefore(context) {
+ return new Step(context, 0);
+}
+
+function stepAfter(context) {
+ return new Step(context, 1);
+}
+
+function none$1(series, order) {
+ if (!((n = series.length) > 1)) return;
+ for (var i = 1, j, s0, s1 = series[order[0]], n, m = s1.length; i < n; ++i) {
+ s0 = s1, s1 = series[order[i]];
+ for (j = 0; j < m; ++j) {
+ s1[j][1] += s1[j][0] = isNaN(s0[j][1]) ? s0[j][0] : s0[j][1];
}
- function apportion(v, w, ancestor) {
- if (w) {
- var vip = v, vop = v, vim = w, vom = vip.parent.children[0], sip = vip.m, sop = vop.m, sim = vim.m, som = vom.m, shift;
- while (vim = d3_layout_treeRight(vim), vip = d3_layout_treeLeft(vip), vim && vip) {
- vom = d3_layout_treeLeft(vom);
- vop = d3_layout_treeRight(vop);
- vop.a = v;
- shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);
- if (shift > 0) {
- d3_layout_treeMove(d3_layout_treeAncestor(vim, v, ancestor), v, shift);
- sip += shift;
- sop += shift;
- }
- sim += vim.m;
- sip += vip.m;
- som += vom.m;
- sop += vop.m;
- }
- if (vim && !d3_layout_treeRight(vop)) {
- vop.t = vim;
- vop.m += sim - sop;
- }
- if (vip && !d3_layout_treeLeft(vom)) {
- vom.t = vip;
- vom.m += sip - som;
- ancestor = v;
- }
+ }
+}
+
+function none$2(series) {
+ var n = series.length, o = new Array(n);
+ while (--n >= 0) o[n] = n;
+ return o;
+}
+
+function stackValue(d, key) {
+ return d[key];
+}
+
+function stack() {
+ var keys = constant$b([]),
+ order = none$2,
+ offset = none$1,
+ value = stackValue;
+
+ function stack(data) {
+ var kz = keys.apply(this, arguments),
+ i,
+ m = data.length,
+ n = kz.length,
+ sz = new Array(n),
+ oz;
+
+ for (i = 0; i < n; ++i) {
+ for (var ki = kz[i], si = sz[i] = new Array(m), j = 0, sij; j < m; ++j) {
+ si[j] = sij = [0, +value(data[j], ki, j, data)];
+ sij.data = data[j];
}
- return ancestor;
- }
- function sizeNode(node) {
- node.x *= size[0];
- node.y = node.depth * size[1];
+ si.key = ki;
}
- tree.separation = function(x) {
- if (!arguments.length) return separation;
- separation = x;
- return tree;
- };
- tree.size = function(x) {
- if (!arguments.length) return nodeSize ? null : size;
- nodeSize = (size = x) == null ? sizeNode : null;
- return tree;
- };
- tree.nodeSize = function(x) {
- if (!arguments.length) return nodeSize ? size : null;
- nodeSize = (size = x) == null ? null : sizeNode;
- return tree;
- };
- return d3_layout_hierarchyRebind(tree, hierarchy);
- };
- function d3_layout_treeSeparation(a, b) {
- return a.parent == b.parent ? 1 : 2;
- }
- function d3_layout_treeLeft(v) {
- var children = v.children;
- return children.length ? children[0] : v.t;
- }
- function d3_layout_treeRight(v) {
- var children = v.children, n;
- return (n = children.length) ? children[n - 1] : v.t;
- }
- function d3_layout_treeMove(wm, wp, shift) {
- var change = shift / (wp.i - wm.i);
- wp.c -= change;
- wp.s += shift;
- wm.c += change;
- wp.z += shift;
- wp.m += shift;
- }
- function d3_layout_treeShift(v) {
- var shift = 0, change = 0, children = v.children, i = children.length, w;
- while (--i >= 0) {
- w = children[i];
- w.z += shift;
- w.m += shift;
- shift += w.s + (change += w.c);
- }
- }
- function d3_layout_treeAncestor(vim, v, ancestor) {
- return vim.a.parent === v.parent ? vim.a : ancestor;
- }
- d3.layout.cluster = function() {
- var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = false;
- function cluster(d, i) {
- var nodes = hierarchy.call(this, d, i), root = nodes[0], previousNode, x = 0;
- d3_layout_hierarchyVisitAfter(root, function(node) {
- var children = node.children;
- if (children && children.length) {
- node.x = d3_layout_clusterX(children);
- node.y = d3_layout_clusterY(children);
- } else {
- node.x = previousNode ? x += separation(node, previousNode) : 0;
- node.y = 0;
- previousNode = node;
- }
- });
- var left = d3_layout_clusterLeft(root), right = d3_layout_clusterRight(root), x0 = left.x - separation(left, right) / 2, x1 = right.x + separation(right, left) / 2;
- d3_layout_hierarchyVisitAfter(root, nodeSize ? function(node) {
- node.x = (node.x - root.x) * size[0];
- node.y = (root.y - node.y) * size[1];
- } : function(node) {
- node.x = (node.x - x0) / (x1 - x0) * size[0];
- node.y = (1 - (root.y ? node.y / root.y : 1)) * size[1];
- });
- return nodes;
+
+ for (i = 0, oz = order(sz); i < n; ++i) {
+ sz[oz[i]].index = i;
}
- cluster.separation = function(x) {
- if (!arguments.length) return separation;
- separation = x;
- return cluster;
- };
- cluster.size = function(x) {
- if (!arguments.length) return nodeSize ? null : size;
- nodeSize = (size = x) == null;
- return cluster;
- };
- cluster.nodeSize = function(x) {
- if (!arguments.length) return nodeSize ? size : null;
- nodeSize = (size = x) != null;
- return cluster;
- };
- return d3_layout_hierarchyRebind(cluster, hierarchy);
- };
- function d3_layout_clusterY(children) {
- return 1 + d3.max(children, function(child) {
- return child.y;
- });
+
+ offset(sz, oz);
+ return sz;
}
- function d3_layout_clusterX(children) {
- return children.reduce(function(x, child) {
- return x + child.x;
- }, 0) / children.length;
+
+ stack.keys = function(_) {
+ return arguments.length ? (keys = typeof _ === "function" ? _ : constant$b(slice$6.call(_)), stack) : keys;
+ };
+
+ stack.value = function(_) {
+ return arguments.length ? (value = typeof _ === "function" ? _ : constant$b(+_), stack) : value;
+ };
+
+ stack.order = function(_) {
+ return arguments.length ? (order = _ == null ? none$2 : typeof _ === "function" ? _ : constant$b(slice$6.call(_)), stack) : order;
+ };
+
+ stack.offset = function(_) {
+ return arguments.length ? (offset = _ == null ? none$1 : _, stack) : offset;
+ };
+
+ return stack;
+}
+
+function expand(series, order) {
+ if (!((n = series.length) > 0)) return;
+ for (var i, n, j = 0, m = series[0].length, y; j < m; ++j) {
+ for (y = i = 0; i < n; ++i) y += series[i][j][1] || 0;
+ if (y) for (i = 0; i < n; ++i) series[i][j][1] /= y;
+ }
+ none$1(series, order);
+}
+
+function diverging$1(series, order) {
+ if (!((n = series.length) > 0)) return;
+ for (var i, j = 0, d, dy, yp, yn, n, m = series[order[0]].length; j < m; ++j) {
+ for (yp = yn = 0, i = 0; i < n; ++i) {
+ if ((dy = (d = series[order[i]][j])[1] - d[0]) >= 0) {
+ d[0] = yp, d[1] = yp += dy;
+ } else if (dy < 0) {
+ d[1] = yn, d[0] = yn += dy;
+ } else {
+ d[0] = yp;
+ }
+ }
}
- function d3_layout_clusterLeft(node) {
- var children = node.children;
- return children && children.length ? d3_layout_clusterLeft(children[0]) : node;
+}
+
+function silhouette(series, order) {
+ if (!((n = series.length) > 0)) return;
+ for (var j = 0, s0 = series[order[0]], n, m = s0.length; j < m; ++j) {
+ for (var i = 0, y = 0; i < n; ++i) y += series[i][j][1] || 0;
+ s0[j][1] += s0[j][0] = -y / 2;
+ }
+ none$1(series, order);
+}
+
+function wiggle(series, order) {
+ if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return;
+ for (var y = 0, j = 1, s0, m, n; j < m; ++j) {
+ for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) {
+ var si = series[order[i]],
+ sij0 = si[j][1] || 0,
+ sij1 = si[j - 1][1] || 0,
+ s3 = (sij0 - sij1) / 2;
+ for (var k = 0; k < i; ++k) {
+ var sk = series[order[k]],
+ skj0 = sk[j][1] || 0,
+ skj1 = sk[j - 1][1] || 0;
+ s3 += skj0 - skj1;
+ }
+ s1 += sij0, s2 += s3 * sij0;
+ }
+ s0[j - 1][1] += s0[j - 1][0] = y;
+ if (s1) y -= s2 / s1;
}
- function d3_layout_clusterRight(node) {
- var children = node.children, n;
- return children && (n = children.length) ? d3_layout_clusterRight(children[n - 1]) : node;
+ s0[j - 1][1] += s0[j - 1][0] = y;
+ none$1(series, order);
+}
+
+function appearance(series) {
+ var peaks = series.map(peak);
+ return none$2(series).sort(function(a, b) { return peaks[a] - peaks[b]; });
+}
+
+function peak(series) {
+ var i = -1, j = 0, n = series.length, vi, vj = -Infinity;
+ while (++i < n) if ((vi = +series[i][1]) > vj) vj = vi, j = i;
+ return j;
+}
+
+function ascending$3(series) {
+ var sums = series.map(sum$2);
+ return none$2(series).sort(function(a, b) { return sums[a] - sums[b]; });
+}
+
+function sum$2(series) {
+ var s = 0, i = -1, n = series.length, v;
+ while (++i < n) if (v = +series[i][1]) s += v;
+ return s;
+}
+
+function descending$2(series) {
+ return ascending$3(series).reverse();
+}
+
+function insideOut(series) {
+ var n = series.length,
+ i,
+ j,
+ sums = series.map(sum$2),
+ order = appearance(series),
+ top = 0,
+ bottom = 0,
+ tops = [],
+ bottoms = [];
+
+ for (i = 0; i < n; ++i) {
+ j = order[i];
+ if (top < bottom) {
+ top += sums[j];
+ tops.push(j);
+ } else {
+ bottom += sums[j];
+ bottoms.push(j);
+ }
}
- d3.layout.treemap = function() {
- var hierarchy = d3.layout.hierarchy(), round = Math.round, size = [ 1, 1 ], padding = null, pad = d3_layout_treemapPadNull, sticky = false, stickies, mode = "squarify", ratio = .5 * (1 + Math.sqrt(5));
- function scale(children, k) {
- var i = -1, n = children.length, child, area;
- while (++i < n) {
- area = (child = children[i]).value * (k < 0 ? 0 : k);
- child.area = isNaN(area) || area <= 0 ? 0 : area;
+
+ return bottoms.reverse().concat(tops);
+}
+
+function reverse(series) {
+ return none$2(series).reverse();
+}
+
+function constant$c(x) {
+ return function() {
+ return x;
+ };
+}
+
+function x$4(d) {
+ return d[0];
+}
+
+function y$4(d) {
+ return d[1];
+}
+
+function RedBlackTree() {
+ this._ = null; // root node
+}
+
+function RedBlackNode(node) {
+ node.U = // parent node
+ node.C = // color - true for red, false for black
+ node.L = // left node
+ node.R = // right node
+ node.P = // previous node
+ node.N = null; // next node
+}
+
+RedBlackTree.prototype = {
+ constructor: RedBlackTree,
+
+ insert: function(after, node) {
+ var parent, grandpa, uncle;
+
+ if (after) {
+ node.P = after;
+ node.N = after.N;
+ if (after.N) after.N.P = node;
+ after.N = node;
+ if (after.R) {
+ after = after.R;
+ while (after.L) after = after.L;
+ after.L = node;
+ } else {
+ after.R = node;
}
+ parent = after;
+ } else if (this._) {
+ after = RedBlackFirst(this._);
+ node.P = null;
+ node.N = after;
+ after.P = after.L = node;
+ parent = after;
+ } else {
+ node.P = node.N = null;
+ this._ = node;
+ parent = null;
}
- function squarify(node) {
- var children = node.children;
- if (children && children.length) {
- var rect = pad(node), row = [], remaining = children.slice(), child, best = Infinity, score, u = mode === "slice" ? rect.dx : mode === "dice" ? rect.dy : mode === "slice-dice" ? node.depth & 1 ? rect.dy : rect.dx : Math.min(rect.dx, rect.dy), n;
- scale(remaining, rect.dx * rect.dy / node.value);
- row.area = 0;
- while ((n = remaining.length) > 0) {
- row.push(child = remaining[n - 1]);
- row.area += child.area;
- if (mode !== "squarify" || (score = worst(row, u)) <= best) {
- remaining.pop();
- best = score;
- } else {
- row.area -= row.pop().area;
- position(row, u, rect, false);
- u = Math.min(rect.dx, rect.dy);
- row.length = row.area = 0;
- best = Infinity;
+ node.L = node.R = null;
+ node.U = parent;
+ node.C = true;
+
+ after = node;
+ while (parent && parent.C) {
+ grandpa = parent.U;
+ if (parent === grandpa.L) {
+ uncle = grandpa.R;
+ if (uncle && uncle.C) {
+ parent.C = uncle.C = false;
+ grandpa.C = true;
+ after = grandpa;
+ } else {
+ if (after === parent.R) {
+ RedBlackRotateLeft(this, parent);
+ after = parent;
+ parent = after.U;
}
+ parent.C = false;
+ grandpa.C = true;
+ RedBlackRotateRight(this, grandpa);
}
- if (row.length) {
- position(row, u, rect, true);
- row.length = row.area = 0;
+ } else {
+ uncle = grandpa.L;
+ if (uncle && uncle.C) {
+ parent.C = uncle.C = false;
+ grandpa.C = true;
+ after = grandpa;
+ } else {
+ if (after === parent.L) {
+ RedBlackRotateRight(this, parent);
+ after = parent;
+ parent = after.U;
+ }
+ parent.C = false;
+ grandpa.C = true;
+ RedBlackRotateLeft(this, grandpa);
}
- children.forEach(squarify);
}
+ parent = after.U;
}
- function stickify(node) {
- var children = node.children;
- if (children && children.length) {
- var rect = pad(node), remaining = children.slice(), child, row = [];
- scale(remaining, rect.dx * rect.dy / node.value);
- row.area = 0;
- while (child = remaining.pop()) {
- row.push(child);
- row.area += child.area;
- if (child.z != null) {
- position(row, child.z ? rect.dx : rect.dy, rect, !remaining.length);
- row.length = row.area = 0;
- }
- }
- children.forEach(stickify);
+ this._.C = false;
+ },
+
+ remove: function(node) {
+ if (node.N) node.N.P = node.P;
+ if (node.P) node.P.N = node.N;
+ node.N = node.P = null;
+
+ var parent = node.U,
+ sibling,
+ left = node.L,
+ right = node.R,
+ next,
+ red;
+
+ if (!left) next = right;
+ else if (!right) next = left;
+ else next = RedBlackFirst(right);
+
+ if (parent) {
+ if (parent.L === node) parent.L = next;
+ else parent.R = next;
+ } else {
+ this._ = next;
+ }
+
+ if (left && right) {
+ red = next.C;
+ next.C = node.C;
+ next.L = left;
+ left.U = next;
+ if (next !== right) {
+ parent = next.U;
+ next.U = node.U;
+ node = next.R;
+ parent.L = node;
+ next.R = right;
+ right.U = next;
+ } else {
+ next.U = parent;
+ parent = next;
+ node = next.R;
}
+ } else {
+ red = node.C;
+ node = next;
}
- function worst(row, u) {
- var s = row.area, r, rmax = 0, rmin = Infinity, i = -1, n = row.length;
- while (++i < n) {
- if (!(r = row[i].area)) continue;
- if (r < rmin) rmin = r;
- if (r > rmax) rmax = r;
- }
- s *= s;
- u *= u;
- return s ? Math.max(u * rmax * ratio / s, s / (u * rmin * ratio)) : Infinity;
- }
- function position(row, u, rect, flush) {
- var i = -1, n = row.length, x = rect.x, y = rect.y, v = u ? round(row.area / u) : 0, o;
- if (u == rect.dx) {
- if (flush || v > rect.dy) v = rect.dy;
- while (++i < n) {
- o = row[i];
- o.x = x;
- o.y = y;
- o.dy = v;
- x += o.dx = Math.min(rect.x + rect.dx - x, v ? round(o.area / v) : 0);
+
+ if (node) node.U = parent;
+ if (red) return;
+ if (node && node.C) { node.C = false; return; }
+
+ do {
+ if (node === this._) break;
+ if (node === parent.L) {
+ sibling = parent.R;
+ if (sibling.C) {
+ sibling.C = false;
+ parent.C = true;
+ RedBlackRotateLeft(this, parent);
+ sibling = parent.R;
+ }
+ if ((sibling.L && sibling.L.C)
+ || (sibling.R && sibling.R.C)) {
+ if (!sibling.R || !sibling.R.C) {
+ sibling.L.C = false;
+ sibling.C = true;
+ RedBlackRotateRight(this, sibling);
+ sibling = parent.R;
+ }
+ sibling.C = parent.C;
+ parent.C = sibling.R.C = false;
+ RedBlackRotateLeft(this, parent);
+ node = this._;
+ break;
}
- o.z = true;
- o.dx += rect.x + rect.dx - x;
- rect.y += v;
- rect.dy -= v;
} else {
- if (flush || v > rect.dx) v = rect.dx;
- while (++i < n) {
- o = row[i];
- o.x = x;
- o.y = y;
- o.dx = v;
- y += o.dy = Math.min(rect.y + rect.dy - y, v ? round(o.area / v) : 0);
+ sibling = parent.L;
+ if (sibling.C) {
+ sibling.C = false;
+ parent.C = true;
+ RedBlackRotateRight(this, parent);
+ sibling = parent.L;
}
- o.z = false;
- o.dy += rect.y + rect.dy - y;
- rect.x += v;
- rect.dx -= v;
- }
- }
- function treemap(d) {
- var nodes = stickies || hierarchy(d), root = nodes[0];
- root.x = 0;
- root.y = 0;
- root.dx = size[0];
- root.dy = size[1];
- if (stickies) hierarchy.revalue(root);
- scale([ root ], root.dx * root.dy / root.value);
- (stickies ? stickify : squarify)(root);
- if (sticky) stickies = nodes;
- return nodes;
- }
- treemap.size = function(x) {
- if (!arguments.length) return size;
- size = x;
- return treemap;
- };
- treemap.padding = function(x) {
- if (!arguments.length) return padding;
- function padFunction(node) {
- var p = x.call(treemap, node, node.depth);
- return p == null ? d3_layout_treemapPadNull(node) : d3_layout_treemapPad(node, typeof p === "number" ? [ p, p, p, p ] : p);
- }
- function padConstant(node) {
- return d3_layout_treemapPad(node, x);
- }
- var type;
- pad = (padding = x) == null ? d3_layout_treemapPadNull : (type = typeof x) === "function" ? padFunction : type === "number" ? (x = [ x, x, x, x ],
- padConstant) : padConstant;
- return treemap;
- };
- treemap.round = function(x) {
- if (!arguments.length) return round != Number;
- round = x ? Math.round : Number;
- return treemap;
- };
- treemap.sticky = function(x) {
- if (!arguments.length) return sticky;
- sticky = x;
- stickies = null;
- return treemap;
- };
- treemap.ratio = function(x) {
- if (!arguments.length) return ratio;
- ratio = x;
- return treemap;
- };
- treemap.mode = function(x) {
- if (!arguments.length) return mode;
- mode = x + "";
- return treemap;
- };
- return d3_layout_hierarchyRebind(treemap, hierarchy);
- };
- function d3_layout_treemapPadNull(node) {
- return {
- x: node.x,
- y: node.y,
- dx: node.dx,
- dy: node.dy
- };
- }
- function d3_layout_treemapPad(node, padding) {
- var x = node.x + padding[3], y = node.y + padding[0], dx = node.dx - padding[1] - padding[3], dy = node.dy - padding[0] - padding[2];
- if (dx < 0) {
- x += dx / 2;
- dx = 0;
- }
- if (dy < 0) {
- y += dy / 2;
- dy = 0;
- }
- return {
- x: x,
- y: y,
- dx: dx,
- dy: dy
- };
- }
- d3.random = {
- normal: function(µ, σ) {
- var n = arguments.length;
- if (n < 2) σ = 1;
- if (n < 1) µ = 0;
- return function() {
- var x, y, r;
- do {
- x = Math.random() * 2 - 1;
- y = Math.random() * 2 - 1;
- r = x * x + y * y;
- } while (!r || r > 1);
- return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r);
- };
- },
- logNormal: function() {
- var random = d3.random.normal.apply(d3, arguments);
- return function() {
- return Math.exp(random());
- };
- },
- bates: function(m) {
- var random = d3.random.irwinHall(m);
- return function() {
- return random() / m;
- };
- },
- irwinHall: function(m) {
- return function() {
- for (var s = 0, j = 0; j < m; j++) s += Math.random();
- return s;
- };
- }
- };
- d3.scale = {};
- function d3_scaleExtent(domain) {
- var start = domain[0], stop = domain[domain.length - 1];
- return start < stop ? [ start, stop ] : [ stop, start ];
+ if ((sibling.L && sibling.L.C)
+ || (sibling.R && sibling.R.C)) {
+ if (!sibling.L || !sibling.L.C) {
+ sibling.R.C = false;
+ sibling.C = true;
+ RedBlackRotateLeft(this, sibling);
+ sibling = parent.L;
+ }
+ sibling.C = parent.C;
+ parent.C = sibling.L.C = false;
+ RedBlackRotateRight(this, parent);
+ node = this._;
+ break;
+ }
+ }
+ sibling.C = true;
+ node = parent;
+ parent = parent.U;
+ } while (!node.C);
+
+ if (node) node.C = false;
}
- function d3_scaleRange(scale) {
- return scale.rangeExtent ? scale.rangeExtent() : d3_scaleExtent(scale.range());
+};
+
+function RedBlackRotateLeft(tree, node) {
+ var p = node,
+ q = node.R,
+ parent = p.U;
+
+ if (parent) {
+ if (parent.L === p) parent.L = q;
+ else parent.R = q;
+ } else {
+ tree._ = q;
}
- function d3_scale_bilinear(domain, range, uninterpolate, interpolate) {
- var u = uninterpolate(domain[0], domain[1]), i = interpolate(range[0], range[1]);
- return function(x) {
- return i(u(x));
- };
+
+ q.U = parent;
+ p.U = q;
+ p.R = q.L;
+ if (p.R) p.R.U = p;
+ q.L = p;
+}
+
+function RedBlackRotateRight(tree, node) {
+ var p = node,
+ q = node.L,
+ parent = p.U;
+
+ if (parent) {
+ if (parent.L === p) parent.L = q;
+ else parent.R = q;
+ } else {
+ tree._ = q;
}
- function d3_scale_nice(domain, nice) {
- var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], dx;
- if (x1 < x0) {
- dx = i0, i0 = i1, i1 = dx;
- dx = x0, x0 = x1, x1 = dx;
- }
- domain[i0] = nice.floor(x0);
- domain[i1] = nice.ceil(x1);
- return domain;
+
+ q.U = parent;
+ p.U = q;
+ p.L = q.R;
+ if (p.L) p.L.U = p;
+ q.R = p;
+}
+
+function RedBlackFirst(node) {
+ while (node.L) node = node.L;
+ return node;
+}
+
+function createEdge(left, right, v0, v1) {
+ var edge = [null, null],
+ index = edges.push(edge) - 1;
+ edge.left = left;
+ edge.right = right;
+ if (v0) setEdgeEnd(edge, left, right, v0);
+ if (v1) setEdgeEnd(edge, right, left, v1);
+ cells[left.index].halfedges.push(index);
+ cells[right.index].halfedges.push(index);
+ return edge;
+}
+
+function createBorderEdge(left, v0, v1) {
+ var edge = [v0, v1];
+ edge.left = left;
+ return edge;
+}
+
+function setEdgeEnd(edge, left, right, vertex) {
+ if (!edge[0] && !edge[1]) {
+ edge[0] = vertex;
+ edge.left = left;
+ edge.right = right;
+ } else if (edge.left === right) {
+ edge[1] = vertex;
+ } else {
+ edge[0] = vertex;
+ }
+}
+
+// Liang–Barsky line clipping.
+function clipEdge(edge, x0, y0, x1, y1) {
+ var a = edge[0],
+ b = edge[1],
+ ax = a[0],
+ ay = a[1],
+ bx = b[0],
+ by = b[1],
+ t0 = 0,
+ t1 = 1,
+ dx = bx - ax,
+ dy = by - ay,
+ r;
+
+ r = x0 - ax;
+ if (!dx && r > 0) return;
+ r /= dx;
+ if (dx < 0) {
+ if (r < t0) return;
+ if (r < t1) t1 = r;
+ } else if (dx > 0) {
+ if (r > t1) return;
+ if (r > t0) t0 = r;
}
- function d3_scale_niceStep(step) {
- return step ? {
- floor: function(x) {
- return Math.floor(x / step) * step;
- },
- ceil: function(x) {
- return Math.ceil(x / step) * step;
- }
- } : d3_scale_niceIdentity;
+
+ r = x1 - ax;
+ if (!dx && r < 0) return;
+ r /= dx;
+ if (dx < 0) {
+ if (r > t1) return;
+ if (r > t0) t0 = r;
+ } else if (dx > 0) {
+ if (r < t0) return;
+ if (r < t1) t1 = r;
}
- var d3_scale_niceIdentity = {
- floor: d3_identity,
- ceil: d3_identity
- };
- function d3_scale_polylinear(domain, range, uninterpolate, interpolate) {
- var u = [], i = [], j = 0, k = Math.min(domain.length, range.length) - 1;
- if (domain[k] < domain[0]) {
- domain = domain.slice().reverse();
- range = range.slice().reverse();
- }
- while (++j <= k) {
- u.push(uninterpolate(domain[j - 1], domain[j]));
- i.push(interpolate(range[j - 1], range[j]));
- }
- return function(x) {
- var j = d3.bisect(domain, x, 1, k) - 1;
- return i[j](u[j](x));
- };
+
+ r = y0 - ay;
+ if (!dy && r > 0) return;
+ r /= dy;
+ if (dy < 0) {
+ if (r < t0) return;
+ if (r < t1) t1 = r;
+ } else if (dy > 0) {
+ if (r > t1) return;
+ if (r > t0) t0 = r;
}
- d3.scale.linear = function() {
- return d3_scale_linear([ 0, 1 ], [ 0, 1 ], d3_interpolate, false);
- };
- function d3_scale_linear(domain, range, interpolate, clamp) {
- var output, input;
- function rescale() {
- var linear = Math.min(domain.length, range.length) > 2 ? d3_scale_polylinear : d3_scale_bilinear, uninterpolate = clamp ? d3_uninterpolateClamp : d3_uninterpolateNumber;
- output = linear(domain, range, uninterpolate, interpolate);
- input = linear(range, domain, uninterpolate, d3_interpolate);
- return scale;
- }
- function scale(x) {
- return output(x);
- }
- scale.invert = function(y) {
- return input(y);
- };
- scale.domain = function(x) {
- if (!arguments.length) return domain;
- domain = x.map(Number);
- return rescale();
- };
- scale.range = function(x) {
- if (!arguments.length) return range;
- range = x;
- return rescale();
- };
- scale.rangeRound = function(x) {
- return scale.range(x).interpolate(d3_interpolateRound);
- };
- scale.clamp = function(x) {
- if (!arguments.length) return clamp;
- clamp = x;
- return rescale();
- };
- scale.interpolate = function(x) {
- if (!arguments.length) return interpolate;
- interpolate = x;
- return rescale();
- };
- scale.ticks = function(m) {
- return d3_scale_linearTicks(domain, m);
- };
- scale.tickFormat = function(m, format) {
- return d3_scale_linearTickFormat(domain, m, format);
- };
- scale.nice = function(m) {
- d3_scale_linearNice(domain, m);
- return rescale();
- };
- scale.copy = function() {
- return d3_scale_linear(domain, range, interpolate, clamp);
- };
- return rescale();
+
+ r = y1 - ay;
+ if (!dy && r < 0) return;
+ r /= dy;
+ if (dy < 0) {
+ if (r > t1) return;
+ if (r > t0) t0 = r;
+ } else if (dy > 0) {
+ if (r < t0) return;
+ if (r < t1) t1 = r;
}
- function d3_scale_linearRebind(scale, linear) {
- return d3.rebind(scale, linear, "range", "rangeRound", "interpolate", "clamp");
- }
- function d3_scale_linearNice(domain, m) {
- return d3_scale_nice(domain, d3_scale_niceStep(d3_scale_linearTickRange(domain, m)[2]));
- }
- function d3_scale_linearTickRange(domain, m) {
- if (m == null) m = 10;
- var extent = d3_scaleExtent(domain), span = extent[1] - extent[0], step = Math.pow(10, Math.floor(Math.log(span / m) / Math.LN10)), err = m / span * step;
- if (err <= .15) step *= 10; else if (err <= .35) step *= 5; else if (err <= .75) step *= 2;
- extent[0] = Math.ceil(extent[0] / step) * step;
- extent[1] = Math.floor(extent[1] / step) * step + step * .5;
- extent[2] = step;
- return extent;
- }
- function d3_scale_linearTicks(domain, m) {
- return d3.range.apply(d3, d3_scale_linearTickRange(domain, m));
- }
- function d3_scale_linearTickFormat(domain, m, format) {
- var range = d3_scale_linearTickRange(domain, m);
- if (format) {
- var match = d3_format_re.exec(format);
- match.shift();
- if (match[8] === "s") {
- var prefix = d3.formatPrefix(Math.max(abs(range[0]), abs(range[1])));
- if (!match[7]) match[7] = "." + d3_scale_linearPrecision(prefix.scale(range[2]));
- match[8] = "f";
- format = d3.format(match.join(""));
- return function(d) {
- return format(prefix.scale(d)) + prefix.symbol;
- };
+
+ if (!(t0 > 0) && !(t1 < 1)) return true; // TODO Better check?
+
+ if (t0 > 0) edge[0] = [ax + t0 * dx, ay + t0 * dy];
+ if (t1 < 1) edge[1] = [ax + t1 * dx, ay + t1 * dy];
+ return true;
+}
+
+function connectEdge(edge, x0, y0, x1, y1) {
+ var v1 = edge[1];
+ if (v1) return true;
+
+ var v0 = edge[0],
+ left = edge.left,
+ right = edge.right,
+ lx = left[0],
+ ly = left[1],
+ rx = right[0],
+ ry = right[1],
+ fx = (lx + rx) / 2,
+ fy = (ly + ry) / 2,
+ fm,
+ fb;
+
+ if (ry === ly) {
+ if (fx < x0 || fx >= x1) return;
+ if (lx > rx) {
+ if (!v0) v0 = [fx, y0];
+ else if (v0[1] >= y1) return;
+ v1 = [fx, y1];
+ } else {
+ if (!v0) v0 = [fx, y1];
+ else if (v0[1] < y0) return;
+ v1 = [fx, y0];
+ }
+ } else {
+ fm = (lx - rx) / (ry - ly);
+ fb = fy - fm * fx;
+ if (fm < -1 || fm > 1) {
+ if (lx > rx) {
+ if (!v0) v0 = [(y0 - fb) / fm, y0];
+ else if (v0[1] >= y1) return;
+ v1 = [(y1 - fb) / fm, y1];
+ } else {
+ if (!v0) v0 = [(y1 - fb) / fm, y1];
+ else if (v0[1] < y0) return;
+ v1 = [(y0 - fb) / fm, y0];
}
- if (!match[7]) match[7] = "." + d3_scale_linearFormatPrecision(match[8], range);
- format = match.join("");
} else {
- format = ",." + d3_scale_linearPrecision(range[2]) + "f";
+ if (ly < ry) {
+ if (!v0) v0 = [x0, fm * x0 + fb];
+ else if (v0[0] >= x1) return;
+ v1 = [x1, fm * x1 + fb];
+ } else {
+ if (!v0) v0 = [x1, fm * x1 + fb];
+ else if (v0[0] < x0) return;
+ v1 = [x0, fm * x0 + fb];
+ }
}
- return d3.format(format);
- }
- var d3_scale_linearFormatSignificant = {
- s: 1,
- g: 1,
- p: 1,
- r: 1,
- e: 1
- };
- function d3_scale_linearPrecision(value) {
- return -Math.floor(Math.log(value) / Math.LN10 + .01);
}
- function d3_scale_linearFormatPrecision(type, range) {
- var p = d3_scale_linearPrecision(range[2]);
- return type in d3_scale_linearFormatSignificant ? Math.abs(p - d3_scale_linearPrecision(Math.max(abs(range[0]), abs(range[1])))) + +(type !== "e") : p - (type === "%") * 2;
+
+ edge[0] = v0;
+ edge[1] = v1;
+ return true;
+}
+
+function clipEdges(x0, y0, x1, y1) {
+ var i = edges.length,
+ edge;
+
+ while (i--) {
+ if (!connectEdge(edge = edges[i], x0, y0, x1, y1)
+ || !clipEdge(edge, x0, y0, x1, y1)
+ || !(Math.abs(edge[0][0] - edge[1][0]) > epsilon$4
+ || Math.abs(edge[0][1] - edge[1][1]) > epsilon$4)) {
+ delete edges[i];
+ }
}
- d3.scale.log = function() {
- return d3_scale_log(d3.scale.linear().domain([ 0, 1 ]), 10, true, [ 1, 10 ]);
+}
+
+function createCell(site) {
+ return cells[site.index] = {
+ site: site,
+ halfedges: []
};
- function d3_scale_log(linear, base, positive, domain) {
- function log(x) {
- return (positive ? Math.log(x < 0 ? 0 : x) : -Math.log(x > 0 ? 0 : -x)) / Math.log(base);
- }
- function pow(x) {
- return positive ? Math.pow(base, x) : -Math.pow(base, -x);
- }
- function scale(x) {
- return linear(log(x));
- }
- scale.invert = function(x) {
- return pow(linear.invert(x));
- };
- scale.domain = function(x) {
- if (!arguments.length) return domain;
- positive = x[0] >= 0;
- linear.domain((domain = x.map(Number)).map(log));
- return scale;
- };
- scale.base = function(_) {
- if (!arguments.length) return base;
- base = +_;
- linear.domain(domain.map(log));
- return scale;
- };
- scale.nice = function() {
- var niced = d3_scale_nice(domain.map(log), positive ? Math : d3_scale_logNiceNegative);
- linear.domain(niced);
- domain = niced.map(pow);
- return scale;
- };
- scale.ticks = function() {
- var extent = d3_scaleExtent(domain), ticks = [], u = extent[0], v = extent[1], i = Math.floor(log(u)), j = Math.ceil(log(v)), n = base % 1 ? 2 : base;
- if (isFinite(j - i)) {
- if (positive) {
- for (;i < j; i++) for (var k = 1; k < n; k++) ticks.push(pow(i) * k);
- ticks.push(pow(i));
- } else {
- ticks.push(pow(i));
- for (;i++ < j; ) for (var k = n - 1; k > 0; k--) ticks.push(pow(i) * k);
+}
+
+function cellHalfedgeAngle(cell, edge) {
+ var site = cell.site,
+ va = edge.left,
+ vb = edge.right;
+ if (site === vb) vb = va, va = site;
+ if (vb) return Math.atan2(vb[1] - va[1], vb[0] - va[0]);
+ if (site === va) va = edge[1], vb = edge[0];
+ else va = edge[0], vb = edge[1];
+ return Math.atan2(va[0] - vb[0], vb[1] - va[1]);
+}
+
+function cellHalfedgeStart(cell, edge) {
+ return edge[+(edge.left !== cell.site)];
+}
+
+function cellHalfedgeEnd(cell, edge) {
+ return edge[+(edge.left === cell.site)];
+}
+
+function sortCellHalfedges() {
+ for (var i = 0, n = cells.length, cell, halfedges, j, m; i < n; ++i) {
+ if ((cell = cells[i]) && (m = (halfedges = cell.halfedges).length)) {
+ var index = new Array(m),
+ array = new Array(m);
+ for (j = 0; j < m; ++j) index[j] = j, array[j] = cellHalfedgeAngle(cell, edges[halfedges[j]]);
+ index.sort(function(i, j) { return array[j] - array[i]; });
+ for (j = 0; j < m; ++j) array[j] = halfedges[index[j]];
+ for (j = 0; j < m; ++j) halfedges[j] = array[j];
+ }
+ }
+}
+
+function clipCells(x0, y0, x1, y1) {
+ var nCells = cells.length,
+ iCell,
+ cell,
+ site,
+ iHalfedge,
+ halfedges,
+ nHalfedges,
+ start,
+ startX,
+ startY,
+ end,
+ endX,
+ endY,
+ cover = true;
+
+ for (iCell = 0; iCell < nCells; ++iCell) {
+ if (cell = cells[iCell]) {
+ site = cell.site;
+ halfedges = cell.halfedges;
+ iHalfedge = halfedges.length;
+
+ // Remove any dangling clipped edges.
+ while (iHalfedge--) {
+ if (!edges[halfedges[iHalfedge]]) {
+ halfedges.splice(iHalfedge, 1);
}
- for (i = 0; ticks[i] < u; i++) {}
- for (j = ticks.length; ticks[j - 1] > v; j--) {}
- ticks = ticks.slice(i, j);
}
- return ticks;
- };
- scale.tickFormat = function(n, format) {
- if (!arguments.length) return d3_scale_logFormat;
- if (arguments.length < 2) format = d3_scale_logFormat; else if (typeof format !== "function") format = d3.format(format);
- var k = Math.max(.1, n / scale.ticks().length), f = positive ? (e = 1e-12, Math.ceil) : (e = -1e-12,
- Math.floor), e;
- return function(d) {
- return d / pow(f(log(d) + e)) <= k ? format(d) : "";
- };
- };
- scale.copy = function() {
- return d3_scale_log(linear.copy(), base, positive, domain);
- };
- return d3_scale_linearRebind(scale, linear);
- }
- var d3_scale_logFormat = d3.format(".0e"), d3_scale_logNiceNegative = {
- floor: function(x) {
- return -Math.ceil(-x);
- },
- ceil: function(x) {
- return -Math.floor(-x);
- }
- };
- d3.scale.pow = function() {
- return d3_scale_pow(d3.scale.linear(), 1, [ 0, 1 ]);
- };
- function d3_scale_pow(linear, exponent, domain) {
- var powp = d3_scale_powPow(exponent), powb = d3_scale_powPow(1 / exponent);
- function scale(x) {
- return linear(powp(x));
- }
- scale.invert = function(x) {
- return powb(linear.invert(x));
- };
- scale.domain = function(x) {
- if (!arguments.length) return domain;
- linear.domain((domain = x.map(Number)).map(powp));
- return scale;
- };
- scale.ticks = function(m) {
- return d3_scale_linearTicks(domain, m);
- };
- scale.tickFormat = function(m, format) {
- return d3_scale_linearTickFormat(domain, m, format);
- };
- scale.nice = function(m) {
- return scale.domain(d3_scale_linearNice(domain, m));
- };
- scale.exponent = function(x) {
- if (!arguments.length) return exponent;
- powp = d3_scale_powPow(exponent = x);
- powb = d3_scale_powPow(1 / exponent);
- linear.domain(domain.map(powp));
- return scale;
- };
- scale.copy = function() {
- return d3_scale_pow(linear.copy(), exponent, domain);
- };
- return d3_scale_linearRebind(scale, linear);
- }
- function d3_scale_powPow(e) {
- return function(x) {
- return x < 0 ? -Math.pow(-x, e) : Math.pow(x, e);
- };
- }
- d3.scale.sqrt = function() {
- return d3.scale.pow().exponent(.5);
- };
- d3.scale.ordinal = function() {
- return d3_scale_ordinal([], {
- t: "range",
- a: [ [] ]
- });
- };
- function d3_scale_ordinal(domain, ranger) {
- var index, range, rangeBand;
- function scale(x) {
- return range[((index.get(x) || (ranger.t === "range" ? index.set(x, domain.push(x)) : NaN)) - 1) % range.length];
- }
- function steps(start, step) {
- return d3.range(domain.length).map(function(i) {
- return start + step * i;
- });
+
+ // Insert any border edges as necessary.
+ iHalfedge = 0, nHalfedges = halfedges.length;
+ while (iHalfedge < nHalfedges) {
+ end = cellHalfedgeEnd(cell, edges[halfedges[iHalfedge]]), endX = end[0], endY = end[1];
+ start = cellHalfedgeStart(cell, edges[halfedges[++iHalfedge % nHalfedges]]), startX = start[0], startY = start[1];
+ if (Math.abs(endX - startX) > epsilon$4 || Math.abs(endY - startY) > epsilon$4) {
+ halfedges.splice(iHalfedge, 0, edges.push(createBorderEdge(site, end,
+ Math.abs(endX - x0) < epsilon$4 && y1 - endY > epsilon$4 ? [x0, Math.abs(startX - x0) < epsilon$4 ? startY : y1]
+ : Math.abs(endY - y1) < epsilon$4 && x1 - endX > epsilon$4 ? [Math.abs(startY - y1) < epsilon$4 ? startX : x1, y1]
+ : Math.abs(endX - x1) < epsilon$4 && endY - y0 > epsilon$4 ? [x1, Math.abs(startX - x1) < epsilon$4 ? startY : y0]
+ : Math.abs(endY - y0) < epsilon$4 && endX - x0 > epsilon$4 ? [Math.abs(startY - y0) < epsilon$4 ? startX : x0, y0]
+ : null)) - 1);
+ ++nHalfedges;
+ }
+ }
+
+ if (nHalfedges) cover = false;
}
- scale.domain = function(x) {
- if (!arguments.length) return domain;
- domain = [];
- index = new d3_Map();
- var i = -1, n = x.length, xi;
- while (++i < n) if (!index.has(xi = x[i])) index.set(xi, domain.push(xi));
- return scale[ranger.t].apply(scale, ranger.a);
- };
- scale.range = function(x) {
- if (!arguments.length) return range;
- range = x;
- rangeBand = 0;
- ranger = {
- t: "range",
- a: arguments
- };
- return scale;
- };
- scale.rangePoints = function(x, padding) {
- if (arguments.length < 2) padding = 0;
- var start = x[0], stop = x[1], step = (stop - start) / (Math.max(1, domain.length - 1) + padding);
- range = steps(domain.length < 2 ? (start + stop) / 2 : start + step * padding / 2, step);
- rangeBand = 0;
- ranger = {
- t: "rangePoints",
- a: arguments
- };
- return scale;
- };
- scale.rangeBands = function(x, padding, outerPadding) {
- if (arguments.length < 2) padding = 0;
- if (arguments.length < 3) outerPadding = padding;
- var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = (stop - start) / (domain.length - padding + 2 * outerPadding);
- range = steps(start + step * outerPadding, step);
- if (reverse) range.reverse();
- rangeBand = step * (1 - padding);
- ranger = {
- t: "rangeBands",
- a: arguments
- };
- return scale;
- };
- scale.rangeRoundBands = function(x, padding, outerPadding) {
- if (arguments.length < 2) padding = 0;
- if (arguments.length < 3) outerPadding = padding;
- var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = Math.floor((stop - start) / (domain.length - padding + 2 * outerPadding)), error = stop - start - (domain.length - padding) * step;
- range = steps(start + Math.round(error / 2), step);
- if (reverse) range.reverse();
- rangeBand = Math.round(step * (1 - padding));
- ranger = {
- t: "rangeRoundBands",
- a: arguments
- };
- return scale;
- };
- scale.rangeBand = function() {
- return rangeBand;
- };
- scale.rangeExtent = function() {
- return d3_scaleExtent(ranger.a[0]);
- };
- scale.copy = function() {
- return d3_scale_ordinal(domain, ranger);
- };
- return scale.domain(domain);
- }
- d3.scale.category10 = function() {
- return d3.scale.ordinal().range(d3_category10);
- };
- d3.scale.category20 = function() {
- return d3.scale.ordinal().range(d3_category20);
- };
- d3.scale.category20b = function() {
- return d3.scale.ordinal().range(d3_category20b);
- };
- d3.scale.category20c = function() {
- return d3.scale.ordinal().range(d3_category20c);
- };
- var d3_category10 = [ 2062260, 16744206, 2924588, 14034728, 9725885, 9197131, 14907330, 8355711, 12369186, 1556175 ].map(d3_rgbString);
- var d3_category20 = [ 2062260, 11454440, 16744206, 16759672, 2924588, 10018698, 14034728, 16750742, 9725885, 12955861, 9197131, 12885140, 14907330, 16234194, 8355711, 13092807, 12369186, 14408589, 1556175, 10410725 ].map(d3_rgbString);
- var d3_category20b = [ 3750777, 5395619, 7040719, 10264286, 6519097, 9216594, 11915115, 13556636, 9202993, 12426809, 15186514, 15190932, 8666169, 11356490, 14049643, 15177372, 8077683, 10834324, 13528509, 14589654 ].map(d3_rgbString);
- var d3_category20c = [ 3244733, 7057110, 10406625, 13032431, 15095053, 16616764, 16625259, 16634018, 3253076, 7652470, 10607003, 13101504, 7695281, 10394312, 12369372, 14342891, 6513507, 9868950, 12434877, 14277081 ].map(d3_rgbString);
- d3.scale.quantile = function() {
- return d3_scale_quantile([], []);
- };
- function d3_scale_quantile(domain, range) {
- var thresholds;
- function rescale() {
- var k = 0, q = range.length;
- thresholds = [];
- while (++k < q) thresholds[k - 1] = d3.quantile(domain, k / q);
- return scale;
- }
- function scale(x) {
- if (!isNaN(x = +x)) return range[d3.bisect(thresholds, x)];
- }
- scale.domain = function(x) {
- if (!arguments.length) return domain;
- domain = x.map(d3_number).filter(d3_numeric).sort(d3_ascending);
- return rescale();
- };
- scale.range = function(x) {
- if (!arguments.length) return range;
- range = x;
- return rescale();
- };
- scale.quantiles = function() {
- return thresholds;
- };
- scale.invertExtent = function(y) {
- y = range.indexOf(y);
- return y < 0 ? [ NaN, NaN ] : [ y > 0 ? thresholds[y - 1] : domain[0], y < thresholds.length ? thresholds[y] : domain[domain.length - 1] ];
- };
- scale.copy = function() {
- return d3_scale_quantile(domain, range);
- };
- return rescale();
}
- d3.scale.quantize = function() {
- return d3_scale_quantize(0, 1, [ 0, 1 ]);
- };
- function d3_scale_quantize(x0, x1, range) {
- var kx, i;
- function scale(x) {
- return range[Math.max(0, Math.min(i, Math.floor(kx * (x - x0))))];
+
+ // If there weren’t any edges, have the closest site cover the extent.
+ // It doesn’t matter which corner of the extent we measure!
+ if (cover) {
+ var dx, dy, d2, dc = Infinity;
+
+ for (iCell = 0, cover = null; iCell < nCells; ++iCell) {
+ if (cell = cells[iCell]) {
+ site = cell.site;
+ dx = site[0] - x0;
+ dy = site[1] - y0;
+ d2 = dx * dx + dy * dy;
+ if (d2 < dc) dc = d2, cover = cell;
+ }
}
- function rescale() {
- kx = range.length / (x1 - x0);
- i = range.length - 1;
- return scale;
+
+ if (cover) {
+ var v00 = [x0, y0], v01 = [x0, y1], v11 = [x1, y1], v10 = [x1, y0];
+ cover.halfedges.push(
+ edges.push(createBorderEdge(site = cover.site, v00, v01)) - 1,
+ edges.push(createBorderEdge(site, v01, v11)) - 1,
+ edges.push(createBorderEdge(site, v11, v10)) - 1,
+ edges.push(createBorderEdge(site, v10, v00)) - 1
+ );
}
- scale.domain = function(x) {
- if (!arguments.length) return [ x0, x1 ];
- x0 = +x[0];
- x1 = +x[x.length - 1];
- return rescale();
- };
- scale.range = function(x) {
- if (!arguments.length) return range;
- range = x;
- return rescale();
- };
- scale.invertExtent = function(y) {
- y = range.indexOf(y);
- y = y < 0 ? NaN : y / kx + x0;
- return [ y, y + 1 / kx ];
- };
- scale.copy = function() {
- return d3_scale_quantize(x0, x1, range);
- };
- return rescale();
}
- d3.scale.threshold = function() {
- return d3_scale_threshold([ .5 ], [ 0, 1 ]);
- };
- function d3_scale_threshold(domain, range) {
- function scale(x) {
- if (x <= x) return range[d3.bisect(domain, x)];
+
+ // Lastly delete any cells with no edges; these were entirely clipped.
+ for (iCell = 0; iCell < nCells; ++iCell) {
+ if (cell = cells[iCell]) {
+ if (!cell.halfedges.length) {
+ delete cells[iCell];
+ }
}
- scale.domain = function(_) {
- if (!arguments.length) return domain;
- domain = _;
- return scale;
- };
- scale.range = function(_) {
- if (!arguments.length) return range;
- range = _;
- return scale;
- };
- scale.invertExtent = function(y) {
- y = range.indexOf(y);
- return [ domain[y - 1], domain[y] ];
- };
- scale.copy = function() {
- return d3_scale_threshold(domain, range);
- };
- return scale;
}
- d3.scale.identity = function() {
- return d3_scale_identity([ 0, 1 ]);
- };
- function d3_scale_identity(domain) {
- function identity(x) {
- return +x;
+}
+
+var circlePool = [];
+
+var firstCircle;
+
+function Circle() {
+ RedBlackNode(this);
+ this.x =
+ this.y =
+ this.arc =
+ this.site =
+ this.cy = null;
+}
+
+function attachCircle(arc) {
+ var lArc = arc.P,
+ rArc = arc.N;
+
+ if (!lArc || !rArc) return;
+
+ var lSite = lArc.site,
+ cSite = arc.site,
+ rSite = rArc.site;
+
+ if (lSite === rSite) return;
+
+ var bx = cSite[0],
+ by = cSite[1],
+ ax = lSite[0] - bx,
+ ay = lSite[1] - by,
+ cx = rSite[0] - bx,
+ cy = rSite[1] - by;
+
+ var d = 2 * (ax * cy - ay * cx);
+ if (d >= -epsilon2$2) return;
+
+ var ha = ax * ax + ay * ay,
+ hc = cx * cx + cy * cy,
+ x = (cy * ha - ay * hc) / d,
+ y = (ax * hc - cx * ha) / d;
+
+ var circle = circlePool.pop() || new Circle;
+ circle.arc = arc;
+ circle.site = cSite;
+ circle.x = x + bx;
+ circle.y = (circle.cy = y + by) + Math.sqrt(x * x + y * y); // y bottom
+
+ arc.circle = circle;
+
+ var before = null,
+ node = circles._;
+
+ while (node) {
+ if (circle.y < node.y || (circle.y === node.y && circle.x <= node.x)) {
+ if (node.L) node = node.L;
+ else { before = node.P; break; }
+ } else {
+ if (node.R) node = node.R;
+ else { before = node; break; }
}
- identity.invert = identity;
- identity.domain = identity.range = function(x) {
- if (!arguments.length) return domain;
- domain = x.map(identity);
- return identity;
- };
- identity.ticks = function(m) {
- return d3_scale_linearTicks(domain, m);
- };
- identity.tickFormat = function(m, format) {
- return d3_scale_linearTickFormat(domain, m, format);
- };
- identity.copy = function() {
- return d3_scale_identity(domain);
- };
- return identity;
- }
- d3.svg = {};
- d3.svg.arc = function() {
- var innerRadius = d3_svg_arcInnerRadius, outerRadius = d3_svg_arcOuterRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle;
- function arc() {
- var r0 = innerRadius.apply(this, arguments), r1 = outerRadius.apply(this, arguments), a0 = startAngle.apply(this, arguments) + d3_svg_arcOffset, a1 = endAngle.apply(this, arguments) + d3_svg_arcOffset, da = (a1 < a0 && (da = a0,
- a0 = a1, a1 = da), a1 - a0), df = da < π ? "0" : "1", c0 = Math.cos(a0), s0 = Math.sin(a0), c1 = Math.cos(a1), s1 = Math.sin(a1);
- return da >= d3_svg_arcMax ? r0 ? "M0," + r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + -r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + r1 + "M0," + r0 + "A" + r0 + "," + r0 + " 0 1,0 0," + -r0 + "A" + r0 + "," + r0 + " 0 1,0 0," + r0 + "Z" : "M0," + r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + -r1 + "A" + r1 + "," + r1 + " 0 1,1 0," + r1 + "Z" : r0 ? "M" + r1 * c0 + "," + r1 * s0 + "A" + r1 + "," + r1 + " 0 " + df + ",1 " + r1 * c1 + "," + r1 * s1 + "L" + r0 * c1 + "," + r0 * s1 + "A" + r0 + "," + r0 + " 0 " + df + ",0 " + r0 * c0 + "," + r0 * s0 + "Z" : "M" + r1 * c0 + "," + r1 * s0 + "A" + r1 + "," + r1 + " 0 " + df + ",1 " + r1 * c1 + "," + r1 * s1 + "L0,0" + "Z";
- }
- arc.innerRadius = function(v) {
- if (!arguments.length) return innerRadius;
- innerRadius = d3_functor(v);
- return arc;
- };
- arc.outerRadius = function(v) {
- if (!arguments.length) return outerRadius;
- outerRadius = d3_functor(v);
- return arc;
- };
- arc.startAngle = function(v) {
- if (!arguments.length) return startAngle;
- startAngle = d3_functor(v);
- return arc;
- };
- arc.endAngle = function(v) {
- if (!arguments.length) return endAngle;
- endAngle = d3_functor(v);
- return arc;
- };
- arc.centroid = function() {
- var r = (innerRadius.apply(this, arguments) + outerRadius.apply(this, arguments)) / 2, a = (startAngle.apply(this, arguments) + endAngle.apply(this, arguments)) / 2 + d3_svg_arcOffset;
- return [ Math.cos(a) * r, Math.sin(a) * r ];
- };
- return arc;
- };
- var d3_svg_arcOffset = -halfπ, d3_svg_arcMax = τ - ε;
- function d3_svg_arcInnerRadius(d) {
- return d.innerRadius;
}
- function d3_svg_arcOuterRadius(d) {
- return d.outerRadius;
+
+ circles.insert(before, circle);
+ if (!before) firstCircle = circle;
+}
+
+function detachCircle(arc) {
+ var circle = arc.circle;
+ if (circle) {
+ if (!circle.P) firstCircle = circle.N;
+ circles.remove(circle);
+ circlePool.push(circle);
+ RedBlackNode(circle);
+ arc.circle = null;
+ }
+}
+
+var beachPool = [];
+
+function Beach() {
+ RedBlackNode(this);
+ this.edge =
+ this.site =
+ this.circle = null;
+}
+
+function createBeach(site) {
+ var beach = beachPool.pop() || new Beach;
+ beach.site = site;
+ return beach;
+}
+
+function detachBeach(beach) {
+ detachCircle(beach);
+ beaches.remove(beach);
+ beachPool.push(beach);
+ RedBlackNode(beach);
+}
+
+function removeBeach(beach) {
+ var circle = beach.circle,
+ x = circle.x,
+ y = circle.cy,
+ vertex = [x, y],
+ previous = beach.P,
+ next = beach.N,
+ disappearing = [beach];
+
+ detachBeach(beach);
+
+ var lArc = previous;
+ while (lArc.circle
+ && Math.abs(x - lArc.circle.x) < epsilon$4
+ && Math.abs(y - lArc.circle.cy) < epsilon$4) {
+ previous = lArc.P;
+ disappearing.unshift(lArc);
+ detachBeach(lArc);
+ lArc = previous;
}
- function d3_svg_arcStartAngle(d) {
- return d.startAngle;
+
+ disappearing.unshift(lArc);
+ detachCircle(lArc);
+
+ var rArc = next;
+ while (rArc.circle
+ && Math.abs(x - rArc.circle.x) < epsilon$4
+ && Math.abs(y - rArc.circle.cy) < epsilon$4) {
+ next = rArc.N;
+ disappearing.push(rArc);
+ detachBeach(rArc);
+ rArc = next;
}
- function d3_svg_arcEndAngle(d) {
- return d.endAngle;
+
+ disappearing.push(rArc);
+ detachCircle(rArc);
+
+ var nArcs = disappearing.length,
+ iArc;
+ for (iArc = 1; iArc < nArcs; ++iArc) {
+ rArc = disappearing[iArc];
+ lArc = disappearing[iArc - 1];
+ setEdgeEnd(rArc.edge, lArc.site, rArc.site, vertex);
}
- function d3_svg_line(projection) {
- var x = d3_geom_pointX, y = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, tension = .7;
- function line(data) {
- var segments = [], points = [], i = -1, n = data.length, d, fx = d3_functor(x), fy = d3_functor(y);
- function segment() {
- segments.push("M", interpolate(projection(points), tension));
- }
- while (++i < n) {
- if (defined.call(this, d = data[i], i)) {
- points.push([ +fx.call(this, d, i), +fy.call(this, d, i) ]);
- } else if (points.length) {
- segment();
- points = [];
+
+ lArc = disappearing[0];
+ rArc = disappearing[nArcs - 1];
+ rArc.edge = createEdge(lArc.site, rArc.site, null, vertex);
+
+ attachCircle(lArc);
+ attachCircle(rArc);
+}
+
+function addBeach(site) {
+ var x = site[0],
+ directrix = site[1],
+ lArc,
+ rArc,
+ dxl,
+ dxr,
+ node = beaches._;
+
+ while (node) {
+ dxl = leftBreakPoint(node, directrix) - x;
+ if (dxl > epsilon$4) node = node.L; else {
+ dxr = x - rightBreakPoint(node, directrix);
+ if (dxr > epsilon$4) {
+ if (!node.R) {
+ lArc = node;
+ break;
}
- }
- if (points.length) segment();
- return segments.length ? segments.join("") : null;
- }
- line.x = function(_) {
- if (!arguments.length) return x;
- x = _;
- return line;
- };
- line.y = function(_) {
- if (!arguments.length) return y;
- y = _;
- return line;
- };
- line.defined = function(_) {
- if (!arguments.length) return defined;
- defined = _;
- return line;
- };
- line.interpolate = function(_) {
- if (!arguments.length) return interpolateKey;
- if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key;
- return line;
- };
- line.tension = function(_) {
- if (!arguments.length) return tension;
- tension = _;
- return line;
- };
- return line;
- }
- d3.svg.line = function() {
- return d3_svg_line(d3_identity);
- };
- var d3_svg_lineInterpolators = d3.map({
- linear: d3_svg_lineLinear,
- "linear-closed": d3_svg_lineLinearClosed,
- step: d3_svg_lineStep,
- "step-before": d3_svg_lineStepBefore,
- "step-after": d3_svg_lineStepAfter,
- basis: d3_svg_lineBasis,
- "basis-open": d3_svg_lineBasisOpen,
- "basis-closed": d3_svg_lineBasisClosed,
- bundle: d3_svg_lineBundle,
- cardinal: d3_svg_lineCardinal,
- "cardinal-open": d3_svg_lineCardinalOpen,
- "cardinal-closed": d3_svg_lineCardinalClosed,
- monotone: d3_svg_lineMonotone
- });
- d3_svg_lineInterpolators.forEach(function(key, value) {
- value.key = key;
- value.closed = /-closed$/.test(key);
- });
- function d3_svg_lineLinear(points) {
- return points.join("L");
- }
- function d3_svg_lineLinearClosed(points) {
- return d3_svg_lineLinear(points) + "Z";
- }
- function d3_svg_lineStep(points) {
- var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ];
- while (++i < n) path.push("H", (p[0] + (p = points[i])[0]) / 2, "V", p[1]);
- if (n > 1) path.push("H", p[0]);
- return path.join("");
- }
- function d3_svg_lineStepBefore(points) {
- var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ];
- while (++i < n) path.push("V", (p = points[i])[1], "H", p[0]);
- return path.join("");
- }
- function d3_svg_lineStepAfter(points) {
- var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ];
- while (++i < n) path.push("H", (p = points[i])[0], "V", p[1]);
- return path.join("");
- }
- function d3_svg_lineCardinalOpen(points, tension) {
- return points.length < 4 ? d3_svg_lineLinear(points) : points[1] + d3_svg_lineHermite(points.slice(1, points.length - 1), d3_svg_lineCardinalTangents(points, tension));
- }
- function d3_svg_lineCardinalClosed(points, tension) {
- return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite((points.push(points[0]),
- points), d3_svg_lineCardinalTangents([ points[points.length - 2] ].concat(points, [ points[1] ]), tension));
- }
- function d3_svg_lineCardinal(points, tension) {
- return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineCardinalTangents(points, tension));
- }
- function d3_svg_lineHermite(points, tangents) {
- if (tangents.length < 1 || points.length != tangents.length && points.length != tangents.length + 2) {
- return d3_svg_lineLinear(points);
- }
- var quad = points.length != tangents.length, path = "", p0 = points[0], p = points[1], t0 = tangents[0], t = t0, pi = 1;
- if (quad) {
- path += "Q" + (p[0] - t0[0] * 2 / 3) + "," + (p[1] - t0[1] * 2 / 3) + "," + p[0] + "," + p[1];
- p0 = points[1];
- pi = 2;
- }
- if (tangents.length > 1) {
- t = tangents[1];
- p = points[pi];
- pi++;
- path += "C" + (p0[0] + t0[0]) + "," + (p0[1] + t0[1]) + "," + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1];
- for (var i = 2; i < tangents.length; i++, pi++) {
- p = points[pi];
- t = tangents[i];
- path += "S" + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1];
- }
- }
- if (quad) {
- var lp = points[pi];
- path += "Q" + (p[0] + t[0] * 2 / 3) + "," + (p[1] + t[1] * 2 / 3) + "," + lp[0] + "," + lp[1];
- }
- return path;
- }
- function d3_svg_lineCardinalTangents(points, tension) {
- var tangents = [], a = (1 - tension) / 2, p0, p1 = points[0], p2 = points[1], i = 1, n = points.length;
- while (++i < n) {
- p0 = p1;
- p1 = p2;
- p2 = points[i];
- tangents.push([ a * (p2[0] - p0[0]), a * (p2[1] - p0[1]) ]);
- }
- return tangents;
- }
- function d3_svg_lineBasis(points) {
- if (points.length < 3) return d3_svg_lineLinear(points);
- var i = 1, n = points.length, pi = points[0], x0 = pi[0], y0 = pi[1], px = [ x0, x0, x0, (pi = points[1])[0] ], py = [ y0, y0, y0, pi[1] ], path = [ x0, ",", y0, "L", d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ];
- points.push(points[n - 1]);
- while (++i <= n) {
- pi = points[i];
- px.shift();
- px.push(pi[0]);
- py.shift();
- py.push(pi[1]);
- d3_svg_lineBasisBezier(path, px, py);
- }
- points.pop();
- path.push("L", pi);
- return path.join("");
- }
- function d3_svg_lineBasisOpen(points) {
- if (points.length < 4) return d3_svg_lineLinear(points);
- var path = [], i = -1, n = points.length, pi, px = [ 0 ], py = [ 0 ];
- while (++i < 3) {
- pi = points[i];
- px.push(pi[0]);
- py.push(pi[1]);
- }
- path.push(d3_svg_lineDot4(d3_svg_lineBasisBezier3, px) + "," + d3_svg_lineDot4(d3_svg_lineBasisBezier3, py));
- --i;
- while (++i < n) {
- pi = points[i];
- px.shift();
- px.push(pi[0]);
- py.shift();
- py.push(pi[1]);
- d3_svg_lineBasisBezier(path, px, py);
- }
- return path.join("");
- }
- function d3_svg_lineBasisClosed(points) {
- var path, i = -1, n = points.length, m = n + 4, pi, px = [], py = [];
- while (++i < 4) {
- pi = points[i % n];
- px.push(pi[0]);
- py.push(pi[1]);
- }
- path = [ d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ];
- --i;
- while (++i < m) {
- pi = points[i % n];
- px.shift();
- px.push(pi[0]);
- py.shift();
- py.push(pi[1]);
- d3_svg_lineBasisBezier(path, px, py);
- }
- return path.join("");
- }
- function d3_svg_lineBundle(points, tension) {
- var n = points.length - 1;
- if (n) {
- var x0 = points[0][0], y0 = points[0][1], dx = points[n][0] - x0, dy = points[n][1] - y0, i = -1, p, t;
- while (++i <= n) {
- p = points[i];
- t = i / n;
- p[0] = tension * p[0] + (1 - tension) * (x0 + t * dx);
- p[1] = tension * p[1] + (1 - tension) * (y0 + t * dy);
+ node = node.R;
+ } else {
+ if (dxl > -epsilon$4) {
+ lArc = node.P;
+ rArc = node;
+ } else if (dxr > -epsilon$4) {
+ lArc = node;
+ rArc = node.N;
+ } else {
+ lArc = rArc = node;
+ }
+ break;
}
}
- return d3_svg_lineBasis(points);
- }
- function d3_svg_lineDot4(a, b) {
- return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
}
- var d3_svg_lineBasisBezier1 = [ 0, 2 / 3, 1 / 3, 0 ], d3_svg_lineBasisBezier2 = [ 0, 1 / 3, 2 / 3, 0 ], d3_svg_lineBasisBezier3 = [ 0, 1 / 6, 2 / 3, 1 / 6 ];
- function d3_svg_lineBasisBezier(path, x, y) {
- path.push("C", d3_svg_lineDot4(d3_svg_lineBasisBezier1, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier1, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, y));
- }
- function d3_svg_lineSlope(p0, p1) {
- return (p1[1] - p0[1]) / (p1[0] - p0[0]);
+
+ createCell(site);
+ var newArc = createBeach(site);
+ beaches.insert(lArc, newArc);
+
+ if (!lArc && !rArc) return;
+
+ if (lArc === rArc) {
+ detachCircle(lArc);
+ rArc = createBeach(lArc.site);
+ beaches.insert(newArc, rArc);
+ newArc.edge = rArc.edge = createEdge(lArc.site, newArc.site);
+ attachCircle(lArc);
+ attachCircle(rArc);
+ return;
}
- function d3_svg_lineFiniteDifferences(points) {
- var i = 0, j = points.length - 1, m = [], p0 = points[0], p1 = points[1], d = m[0] = d3_svg_lineSlope(p0, p1);
- while (++i < j) {
- m[i] = (d + (d = d3_svg_lineSlope(p0 = p1, p1 = points[i + 1]))) / 2;
- }
- m[i] = d;
- return m;
+
+ if (!rArc) { // && lArc
+ newArc.edge = createEdge(lArc.site, newArc.site);
+ return;
}
- function d3_svg_lineMonotoneTangents(points) {
- var tangents = [], d, a, b, s, m = d3_svg_lineFiniteDifferences(points), i = -1, j = points.length - 1;
- while (++i < j) {
- d = d3_svg_lineSlope(points[i], points[i + 1]);
- if (abs(d) < ε) {
- m[i] = m[i + 1] = 0;
- } else {
- a = m[i] / d;
- b = m[i + 1] / d;
- s = a * a + b * b;
- if (s > 9) {
- s = d * 3 / Math.sqrt(s);
- m[i] = s * a;
- m[i + 1] = s * b;
- }
+
+ // else lArc !== rArc
+ detachCircle(lArc);
+ detachCircle(rArc);
+
+ var lSite = lArc.site,
+ ax = lSite[0],
+ ay = lSite[1],
+ bx = site[0] - ax,
+ by = site[1] - ay,
+ rSite = rArc.site,
+ cx = rSite[0] - ax,
+ cy = rSite[1] - ay,
+ d = 2 * (bx * cy - by * cx),
+ hb = bx * bx + by * by,
+ hc = cx * cx + cy * cy,
+ vertex = [(cy * hb - by * hc) / d + ax, (bx * hc - cx * hb) / d + ay];
+
+ setEdgeEnd(rArc.edge, lSite, rSite, vertex);
+ newArc.edge = createEdge(lSite, site, null, vertex);
+ rArc.edge = createEdge(site, rSite, null, vertex);
+ attachCircle(lArc);
+ attachCircle(rArc);
+}
+
+function leftBreakPoint(arc, directrix) {
+ var site = arc.site,
+ rfocx = site[0],
+ rfocy = site[1],
+ pby2 = rfocy - directrix;
+
+ if (!pby2) return rfocx;
+
+ var lArc = arc.P;
+ if (!lArc) return -Infinity;
+
+ site = lArc.site;
+ var lfocx = site[0],
+ lfocy = site[1],
+ plby2 = lfocy - directrix;
+
+ if (!plby2) return lfocx;
+
+ var hl = lfocx - rfocx,
+ aby2 = 1 / pby2 - 1 / plby2,
+ b = hl / plby2;
+
+ if (aby2) return (-b + Math.sqrt(b * b - 2 * aby2 * (hl * hl / (-2 * plby2) - lfocy + plby2 / 2 + rfocy - pby2 / 2))) / aby2 + rfocx;
+
+ return (rfocx + lfocx) / 2;
+}
+
+function rightBreakPoint(arc, directrix) {
+ var rArc = arc.N;
+ if (rArc) return leftBreakPoint(rArc, directrix);
+ var site = arc.site;
+ return site[1] === directrix ? site[0] : Infinity;
+}
+
+var epsilon$4 = 1e-6;
+var epsilon2$2 = 1e-12;
+var beaches;
+var cells;
+var circles;
+var edges;
+
+function triangleArea(a, b, c) {
+ return (a[0] - c[0]) * (b[1] - a[1]) - (a[0] - b[0]) * (c[1] - a[1]);
+}
+
+function lexicographic(a, b) {
+ return b[1] - a[1]
+ || b[0] - a[0];
+}
+
+function Diagram(sites, extent) {
+ var site = sites.sort(lexicographic).pop(),
+ x,
+ y,
+ circle;
+
+ edges = [];
+ cells = new Array(sites.length);
+ beaches = new RedBlackTree;
+ circles = new RedBlackTree;
+
+ while (true) {
+ circle = firstCircle;
+ if (site && (!circle || site[1] < circle.y || (site[1] === circle.y && site[0] < circle.x))) {
+ if (site[0] !== x || site[1] !== y) {
+ addBeach(site);
+ x = site[0], y = site[1];
}
+ site = sites.pop();
+ } else if (circle) {
+ removeBeach(circle.arc);
+ } else {
+ break;
}
- i = -1;
- while (++i <= j) {
- s = (points[Math.min(j, i + 1)][0] - points[Math.max(0, i - 1)][0]) / (6 * (1 + m[i] * m[i]));
- tangents.push([ s || 0, m[i] * s || 0 ]);
- }
- return tangents;
}
- function d3_svg_lineMonotone(points) {
- return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineMonotoneTangents(points));
+
+ sortCellHalfedges();
+
+ if (extent) {
+ var x0 = +extent[0][0],
+ y0 = +extent[0][1],
+ x1 = +extent[1][0],
+ y1 = +extent[1][1];
+ clipEdges(x0, y0, x1, y1);
+ clipCells(x0, y0, x1, y1);
}
- d3.svg.line.radial = function() {
- var line = d3_svg_line(d3_svg_lineRadial);
- line.radius = line.x, delete line.x;
- line.angle = line.y, delete line.y;
- return line;
- };
- function d3_svg_lineRadial(points) {
- var point, i = -1, n = points.length, r, a;
- while (++i < n) {
- point = points[i];
- r = point[0];
- a = point[1] + d3_svg_arcOffset;
- point[0] = r * Math.cos(a);
- point[1] = r * Math.sin(a);
- }
- return points;
- }
- function d3_svg_area(projection) {
- var x0 = d3_geom_pointX, x1 = d3_geom_pointX, y0 = 0, y1 = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, interpolateReverse = interpolate, L = "L", tension = .7;
- function area(data) {
- var segments = [], points0 = [], points1 = [], i = -1, n = data.length, d, fx0 = d3_functor(x0), fy0 = d3_functor(y0), fx1 = x0 === x1 ? function() {
- return x;
- } : d3_functor(x1), fy1 = y0 === y1 ? function() {
- return y;
- } : d3_functor(y1), x, y;
- function segment() {
- segments.push("M", interpolate(projection(points1), tension), L, interpolateReverse(projection(points0.reverse()), tension), "Z");
- }
- while (++i < n) {
- if (defined.call(this, d = data[i], i)) {
- points0.push([ x = +fx0.call(this, d, i), y = +fy0.call(this, d, i) ]);
- points1.push([ +fx1.call(this, d, i), +fy1.call(this, d, i) ]);
- } else if (points0.length) {
- segment();
- points0 = [];
- points1 = [];
+
+ this.edges = edges;
+ this.cells = cells;
+
+ beaches =
+ circles =
+ edges =
+ cells = null;
+}
+
+Diagram.prototype = {
+ constructor: Diagram,
+
+ polygons: function() {
+ var edges = this.edges;
+
+ return this.cells.map(function(cell) {
+ var polygon = cell.halfedges.map(function(i) { return cellHalfedgeStart(cell, edges[i]); });
+ polygon.data = cell.site.data;
+ return polygon;
+ });
+ },
+
+ triangles: function() {
+ var triangles = [],
+ edges = this.edges;
+
+ this.cells.forEach(function(cell, i) {
+ if (!(m = (halfedges = cell.halfedges).length)) return;
+ var site = cell.site,
+ halfedges,
+ j = -1,
+ m,
+ s0,
+ e1 = edges[halfedges[m - 1]],
+ s1 = e1.left === site ? e1.right : e1.left;
+
+ while (++j < m) {
+ s0 = s1;
+ e1 = edges[halfedges[j]];
+ s1 = e1.left === site ? e1.right : e1.left;
+ if (s0 && s1 && i < s0.index && i < s1.index && triangleArea(site, s0, s1) < 0) {
+ triangles.push([site.data, s0.data, s1.data]);
}
}
- if (points0.length) segment();
- return segments.length ? segments.join("") : null;
- }
- area.x = function(_) {
- if (!arguments.length) return x1;
- x0 = x1 = _;
- return area;
- };
- area.x0 = function(_) {
- if (!arguments.length) return x0;
- x0 = _;
- return area;
- };
- area.x1 = function(_) {
- if (!arguments.length) return x1;
- x1 = _;
- return area;
- };
- area.y = function(_) {
- if (!arguments.length) return y1;
- y0 = y1 = _;
- return area;
- };
- area.y0 = function(_) {
- if (!arguments.length) return y0;
- y0 = _;
- return area;
- };
- area.y1 = function(_) {
- if (!arguments.length) return y1;
- y1 = _;
- return area;
- };
- area.defined = function(_) {
- if (!arguments.length) return defined;
- defined = _;
- return area;
- };
- area.interpolate = function(_) {
- if (!arguments.length) return interpolateKey;
- if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key;
- interpolateReverse = interpolate.reverse || interpolate;
- L = interpolate.closed ? "M" : "L";
- return area;
- };
- area.tension = function(_) {
- if (!arguments.length) return tension;
- tension = _;
- return area;
- };
- return area;
- }
- d3_svg_lineStepBefore.reverse = d3_svg_lineStepAfter;
- d3_svg_lineStepAfter.reverse = d3_svg_lineStepBefore;
- d3.svg.area = function() {
- return d3_svg_area(d3_identity);
- };
- d3.svg.area.radial = function() {
- var area = d3_svg_area(d3_svg_lineRadial);
- area.radius = area.x, delete area.x;
- area.innerRadius = area.x0, delete area.x0;
- area.outerRadius = area.x1, delete area.x1;
- area.angle = area.y, delete area.y;
- area.startAngle = area.y0, delete area.y0;
- area.endAngle = area.y1, delete area.y1;
- return area;
- };
- d3.svg.chord = function() {
- var source = d3_source, target = d3_target, radius = d3_svg_chordRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle;
- function chord(d, i) {
- var s = subgroup(this, source, d, i), t = subgroup(this, target, d, i);
- return "M" + s.p0 + arc(s.r, s.p1, s.a1 - s.a0) + (equals(s, t) ? curve(s.r, s.p1, s.r, s.p0) : curve(s.r, s.p1, t.r, t.p0) + arc(t.r, t.p1, t.a1 - t.a0) + curve(t.r, t.p1, s.r, s.p0)) + "Z";
- }
- function subgroup(self, f, d, i) {
- var subgroup = f.call(self, d, i), r = radius.call(self, subgroup, i), a0 = startAngle.call(self, subgroup, i) + d3_svg_arcOffset, a1 = endAngle.call(self, subgroup, i) + d3_svg_arcOffset;
+ });
+
+ return triangles;
+ },
+
+ links: function() {
+ return this.edges.filter(function(edge) {
+ return edge.right;
+ }).map(function(edge) {
return {
- r: r,
- a0: a0,
- a1: a1,
- p0: [ r * Math.cos(a0), r * Math.sin(a0) ],
- p1: [ r * Math.cos(a1), r * Math.sin(a1) ]
+ source: edge.left.data,
+ target: edge.right.data
};
- }
- function equals(a, b) {
- return a.a0 == b.a0 && a.a1 == b.a1;
- }
- function arc(r, p, a) {
- return "A" + r + "," + r + " 0 " + +(a > π) + ",1 " + p;
- }
- function curve(r0, p0, r1, p1) {
- return "Q 0,0 " + p1;
- }
- chord.radius = function(v) {
- if (!arguments.length) return radius;
- radius = d3_functor(v);
- return chord;
- };
- chord.source = function(v) {
- if (!arguments.length) return source;
- source = d3_functor(v);
- return chord;
- };
- chord.target = function(v) {
- if (!arguments.length) return target;
- target = d3_functor(v);
- return chord;
- };
- chord.startAngle = function(v) {
- if (!arguments.length) return startAngle;
- startAngle = d3_functor(v);
- return chord;
- };
- chord.endAngle = function(v) {
- if (!arguments.length) return endAngle;
- endAngle = d3_functor(v);
- return chord;
- };
- return chord;
- };
- function d3_svg_chordRadius(d) {
- return d.radius;
- }
- d3.svg.diagonal = function() {
- var source = d3_source, target = d3_target, projection = d3_svg_diagonalProjection;
- function diagonal(d, i) {
- var p0 = source.call(this, d, i), p3 = target.call(this, d, i), m = (p0.y + p3.y) / 2, p = [ p0, {
- x: p0.x,
- y: m
- }, {
- x: p3.x,
- y: m
- }, p3 ];
- p = p.map(projection);
- return "M" + p[0] + "C" + p[1] + " " + p[2] + " " + p[3];
- }
- diagonal.source = function(x) {
- if (!arguments.length) return source;
- source = d3_functor(x);
- return diagonal;
- };
- diagonal.target = function(x) {
- if (!arguments.length) return target;
- target = d3_functor(x);
- return diagonal;
- };
- diagonal.projection = function(x) {
- if (!arguments.length) return projection;
- projection = x;
- return diagonal;
- };
- return diagonal;
+ });
+ },
+
+ find: function(x, y, radius) {
+ var that = this, i0, i1 = that._found || 0, n = that.cells.length, cell;
+
+ // Use the previously-found cell, or start with an arbitrary one.
+ while (!(cell = that.cells[i1])) if (++i1 >= n) return null;
+ var dx = x - cell.site[0], dy = y - cell.site[1], d2 = dx * dx + dy * dy;
+
+ // Traverse the half-edges to find a closer cell, if any.
+ do {
+ cell = that.cells[i0 = i1], i1 = null;
+ cell.halfedges.forEach(function(e) {
+ var edge = that.edges[e], v = edge.left;
+ if ((v === cell.site || !v) && !(v = edge.right)) return;
+ var vx = x - v[0], vy = y - v[1], v2 = vx * vx + vy * vy;
+ if (v2 < d2) d2 = v2, i1 = v.index;
+ });
+ } while (i1 !== null);
+
+ that._found = i0;
+
+ return radius == null || d2 <= radius * radius ? cell.site : null;
+ }
+};
+
+function voronoi() {
+ var x$$1 = x$4,
+ y$$1 = y$4,
+ extent = null;
+
+ function voronoi(data) {
+ return new Diagram(data.map(function(d, i) {
+ var s = [Math.round(x$$1(d, i, data) / epsilon$4) * epsilon$4, Math.round(y$$1(d, i, data) / epsilon$4) * epsilon$4];
+ s.index = i;
+ s.data = d;
+ return s;
+ }), extent);
+ }
+
+ voronoi.polygons = function(data) {
+ return voronoi(data).polygons();
+ };
+
+ voronoi.links = function(data) {
+ return voronoi(data).links();
+ };
+
+ voronoi.triangles = function(data) {
+ return voronoi(data).triangles();
+ };
+
+ voronoi.x = function(_) {
+ return arguments.length ? (x$$1 = typeof _ === "function" ? _ : constant$c(+_), voronoi) : x$$1;
+ };
+
+ voronoi.y = function(_) {
+ return arguments.length ? (y$$1 = typeof _ === "function" ? _ : constant$c(+_), voronoi) : y$$1;
+ };
+
+ voronoi.extent = function(_) {
+ return arguments.length ? (extent = _ == null ? null : [[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]], voronoi) : extent && [[extent[0][0], extent[0][1]], [extent[1][0], extent[1][1]]];
+ };
+
+ voronoi.size = function(_) {
+ return arguments.length ? (extent = _ == null ? null : [[0, 0], [+_[0], +_[1]]], voronoi) : extent && [extent[1][0] - extent[0][0], extent[1][1] - extent[0][1]];
};
- function d3_svg_diagonalProjection(d) {
- return [ d.x, d.y ];
- }
- d3.svg.diagonal.radial = function() {
- var diagonal = d3.svg.diagonal(), projection = d3_svg_diagonalProjection, projection_ = diagonal.projection;
- diagonal.projection = function(x) {
- return arguments.length ? projection_(d3_svg_diagonalRadialProjection(projection = x)) : projection;
- };
- return diagonal;
+
+ return voronoi;
+}
+
+function constant$d(x) {
+ return function() {
+ return x;
};
- function d3_svg_diagonalRadialProjection(projection) {
- return function() {
- var d = projection.apply(this, arguments), r = d[0], a = d[1] + d3_svg_arcOffset;
- return [ r * Math.cos(a), r * Math.sin(a) ];
- };
+}
+
+function ZoomEvent(target, type, transform) {
+ this.target = target;
+ this.type = type;
+ this.transform = transform;
+}
+
+function Transform(k, x, y) {
+ this.k = k;
+ this.x = x;
+ this.y = y;
+}
+
+Transform.prototype = {
+ constructor: Transform,
+ scale: function(k) {
+ return k === 1 ? this : new Transform(this.k * k, this.x, this.y);
+ },
+ translate: function(x, y) {
+ return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);
+ },
+ apply: function(point) {
+ return [point[0] * this.k + this.x, point[1] * this.k + this.y];
+ },
+ applyX: function(x) {
+ return x * this.k + this.x;
+ },
+ applyY: function(y) {
+ return y * this.k + this.y;
+ },
+ invert: function(location) {
+ return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];
+ },
+ invertX: function(x) {
+ return (x - this.x) / this.k;
+ },
+ invertY: function(y) {
+ return (y - this.y) / this.k;
+ },
+ rescaleX: function(x) {
+ return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));
+ },
+ rescaleY: function(y) {
+ return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));
+ },
+ toString: function() {
+ return "translate(" + this.x + "," + this.y + ") scale(" + this.k + ")";
+ }
+};
+
+var identity$9 = new Transform(1, 0, 0);
+
+transform$1.prototype = Transform.prototype;
+
+function transform$1(node) {
+ return node.__zoom || identity$9;
+}
+
+function nopropagation$2() {
+ exports.event.stopImmediatePropagation();
+}
+
+function noevent$2() {
+ exports.event.preventDefault();
+ exports.event.stopImmediatePropagation();
+}
+
+// Ignore right-click, since that should open the context menu.
+function defaultFilter$2() {
+ return !exports.event.button;
+}
+
+function defaultExtent$1() {
+ var e = this, w, h;
+ if (e instanceof SVGElement) {
+ e = e.ownerSVGElement || e;
+ w = e.width.baseVal.value;
+ h = e.height.baseVal.value;
+ } else {
+ w = e.clientWidth;
+ h = e.clientHeight;
+ }
+ return [[0, 0], [w, h]];
+}
+
+function defaultTransform() {
+ return this.__zoom || identity$9;
+}
+
+function defaultWheelDelta() {
+ return -exports.event.deltaY * (exports.event.deltaMode ? 120 : 1) / 500;
+}
+
+function defaultTouchable$1() {
+ return "ontouchstart" in this;
+}
+
+function defaultConstrain(transform, extent, translateExtent) {
+ var dx0 = transform.invertX(extent[0][0]) - translateExtent[0][0],
+ dx1 = transform.invertX(extent[1][0]) - translateExtent[1][0],
+ dy0 = transform.invertY(extent[0][1]) - translateExtent[0][1],
+ dy1 = transform.invertY(extent[1][1]) - translateExtent[1][1];
+ return transform.translate(
+ dx1 > dx0 ? (dx0 + dx1) / 2 : Math.min(0, dx0) || Math.max(0, dx1),
+ dy1 > dy0 ? (dy0 + dy1) / 2 : Math.min(0, dy0) || Math.max(0, dy1)
+ );
+}
+
+function zoom() {
+ var filter = defaultFilter$2,
+ extent = defaultExtent$1,
+ constrain = defaultConstrain,
+ wheelDelta = defaultWheelDelta,
+ touchable = defaultTouchable$1,
+ scaleExtent = [0, Infinity],
+ translateExtent = [[-Infinity, -Infinity], [Infinity, Infinity]],
+ duration = 250,
+ interpolate = interpolateZoom,
+ gestures = [],
+ listeners = dispatch("start", "zoom", "end"),
+ touchstarting,
+ touchending,
+ touchDelay = 500,
+ wheelDelay = 150,
+ clickDistance2 = 0;
+
+ function zoom(selection$$1) {
+ selection$$1
+ .property("__zoom", defaultTransform)
+ .on("wheel.zoom", wheeled)
+ .on("mousedown.zoom", mousedowned)
+ .on("dblclick.zoom", dblclicked)
+ .filter(touchable)
+ .on("touchstart.zoom", touchstarted)
+ .on("touchmove.zoom", touchmoved)
+ .on("touchend.zoom touchcancel.zoom", touchended)
+ .style("touch-action", "none")
+ .style("-webkit-tap-highlight-color", "rgba(0,0,0,0)");
}
- d3.svg.symbol = function() {
- var type = d3_svg_symbolType, size = d3_svg_symbolSize;
- function symbol(d, i) {
- return (d3_svg_symbols.get(type.call(this, d, i)) || d3_svg_symbolCircle)(size.call(this, d, i));
+
+ zoom.transform = function(collection, transform) {
+ var selection$$1 = collection.selection ? collection.selection() : collection;
+ selection$$1.property("__zoom", defaultTransform);
+ if (collection !== selection$$1) {
+ schedule(collection, transform);
+ } else {
+ selection$$1.interrupt().each(function() {
+ gesture(this, arguments)
+ .start()
+ .zoom(null, typeof transform === "function" ? transform.apply(this, arguments) : transform)
+ .end();
+ });
}
- symbol.type = function(x) {
- if (!arguments.length) return type;
- type = d3_functor(x);
- return symbol;
- };
- symbol.size = function(x) {
- if (!arguments.length) return size;
- size = d3_functor(x);
- return symbol;
- };
- return symbol;
};
- function d3_svg_symbolSize() {
- return 64;
+
+ zoom.scaleBy = function(selection$$1, k) {
+ zoom.scaleTo(selection$$1, function() {
+ var k0 = this.__zoom.k,
+ k1 = typeof k === "function" ? k.apply(this, arguments) : k;
+ return k0 * k1;
+ });
+ };
+
+ zoom.scaleTo = function(selection$$1, k) {
+ zoom.transform(selection$$1, function() {
+ var e = extent.apply(this, arguments),
+ t0 = this.__zoom,
+ p0 = centroid(e),
+ p1 = t0.invert(p0),
+ k1 = typeof k === "function" ? k.apply(this, arguments) : k;
+ return constrain(translate(scale(t0, k1), p0, p1), e, translateExtent);
+ });
+ };
+
+ zoom.translateBy = function(selection$$1, x, y) {
+ zoom.transform(selection$$1, function() {
+ return constrain(this.__zoom.translate(
+ typeof x === "function" ? x.apply(this, arguments) : x,
+ typeof y === "function" ? y.apply(this, arguments) : y
+ ), extent.apply(this, arguments), translateExtent);
+ });
+ };
+
+ zoom.translateTo = function(selection$$1, x, y) {
+ zoom.transform(selection$$1, function() {
+ var e = extent.apply(this, arguments),
+ t = this.__zoom,
+ p = centroid(e);
+ return constrain(identity$9.translate(p[0], p[1]).scale(t.k).translate(
+ typeof x === "function" ? -x.apply(this, arguments) : -x,
+ typeof y === "function" ? -y.apply(this, arguments) : -y
+ ), e, translateExtent);
+ });
+ };
+
+ function scale(transform, k) {
+ k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], k));
+ return k === transform.k ? transform : new Transform(k, transform.x, transform.y);
}
- function d3_svg_symbolType() {
- return "circle";
+
+ function translate(transform, p0, p1) {
+ var x = p0[0] - p1[0] * transform.k, y = p0[1] - p1[1] * transform.k;
+ return x === transform.x && y === transform.y ? transform : new Transform(transform.k, x, y);
}
- function d3_svg_symbolCircle(size) {
- var r = Math.sqrt(size / π);
- return "M0," + r + "A" + r + "," + r + " 0 1,1 0," + -r + "A" + r + "," + r + " 0 1,1 0," + r + "Z";
+
+ function centroid(extent) {
+ return [(+extent[0][0] + +extent[1][0]) / 2, (+extent[0][1] + +extent[1][1]) / 2];
}
- var d3_svg_symbols = d3.map({
- circle: d3_svg_symbolCircle,
- cross: function(size) {
- var r = Math.sqrt(size / 5) / 2;
- return "M" + -3 * r + "," + -r + "H" + -r + "V" + -3 * r + "H" + r + "V" + -r + "H" + 3 * r + "V" + r + "H" + r + "V" + 3 * r + "H" + -r + "V" + r + "H" + -3 * r + "Z";
- },
- diamond: function(size) {
- var ry = Math.sqrt(size / (2 * d3_svg_symbolTan30)), rx = ry * d3_svg_symbolTan30;
- return "M0," + -ry + "L" + rx + ",0" + " 0," + ry + " " + -rx + ",0" + "Z";
- },
- square: function(size) {
- var r = Math.sqrt(size) / 2;
- return "M" + -r + "," + -r + "L" + r + "," + -r + " " + r + "," + r + " " + -r + "," + r + "Z";
- },
- "triangle-down": function(size) {
- var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2;
- return "M0," + ry + "L" + rx + "," + -ry + " " + -rx + "," + -ry + "Z";
- },
- "triangle-up": function(size) {
- var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2;
- return "M0," + -ry + "L" + rx + "," + ry + " " + -rx + "," + ry + "Z";
- }
- });
- d3.svg.symbolTypes = d3_svg_symbols.keys();
- var d3_svg_symbolSqrt3 = Math.sqrt(3), d3_svg_symbolTan30 = Math.tan(30 * d3_radians);
- function d3_transition(groups, id) {
- d3_subclass(groups, d3_transitionPrototype);
- groups.id = id;
- return groups;
- }
- var d3_transitionPrototype = [], d3_transitionId = 0, d3_transitionInheritId, d3_transitionInherit;
- d3_transitionPrototype.call = d3_selectionPrototype.call;
- d3_transitionPrototype.empty = d3_selectionPrototype.empty;
- d3_transitionPrototype.node = d3_selectionPrototype.node;
- d3_transitionPrototype.size = d3_selectionPrototype.size;
- d3.transition = function(selection) {
- return arguments.length ? d3_transitionInheritId ? selection.transition() : selection : d3_selectionRoot.transition();
- };
- d3.transition.prototype = d3_transitionPrototype;
- d3_transitionPrototype.select = function(selector) {
- var id = this.id, subgroups = [], subgroup, subnode, node;
- selector = d3_selection_selector(selector);
- for (var j = -1, m = this.length; ++j < m; ) {
- subgroups.push(subgroup = []);
- for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
- if ((node = group[i]) && (subnode = selector.call(node, node.__data__, i, j))) {
- if ("__data__" in node) subnode.__data__ = node.__data__;
- d3_transitionNode(subnode, i, id, node.__transition__[id]);
- subgroup.push(subnode);
- } else {
- subgroup.push(null);
- }
+
+ function schedule(transition$$1, transform, center) {
+ transition$$1
+ .on("start.zoom", function() { gesture(this, arguments).start(); })
+ .on("interrupt.zoom end.zoom", function() { gesture(this, arguments).end(); })
+ .tween("zoom", function() {
+ var that = this,
+ args = arguments,
+ g = gesture(that, args),
+ e = extent.apply(that, args),
+ p = center || centroid(e),
+ w = Math.max(e[1][0] - e[0][0], e[1][1] - e[0][1]),
+ a = that.__zoom,
+ b = typeof transform === "function" ? transform.apply(that, args) : transform,
+ i = interpolate(a.invert(p).concat(w / a.k), b.invert(p).concat(w / b.k));
+ return function(t) {
+ if (t === 1) t = b; // Avoid rounding error on end.
+ else { var l = i(t), k = w / l[2]; t = new Transform(k, p[0] - l[0] * k, p[1] - l[1] * k); }
+ g.zoom(null, t);
+ };
+ });
+ }
+
+ function gesture(that, args) {
+ for (var i = 0, n = gestures.length, g; i < n; ++i) {
+ if ((g = gestures[i]).that === that) {
+ return g;
}
}
- return d3_transition(subgroups, id);
- };
- d3_transitionPrototype.selectAll = function(selector) {
- var id = this.id, subgroups = [], subgroup, subnodes, node, subnode, transition;
- selector = d3_selection_selectorAll(selector);
- for (var j = -1, m = this.length; ++j < m; ) {
- for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
- if (node = group[i]) {
- transition = node.__transition__[id];
- subnodes = selector.call(node, node.__data__, i, j);
- subgroups.push(subgroup = []);
- for (var k = -1, o = subnodes.length; ++k < o; ) {
- if (subnode = subnodes[k]) d3_transitionNode(subnode, k, id, transition);
- subgroup.push(subnode);
- }
- }
+ return new Gesture(that, args);
+ }
+
+ function Gesture(that, args) {
+ this.that = that;
+ this.args = args;
+ this.index = -1;
+ this.active = 0;
+ this.extent = extent.apply(that, args);
+ }
+
+ Gesture.prototype = {
+ start: function() {
+ if (++this.active === 1) {
+ this.index = gestures.push(this) - 1;
+ this.emit("start");
}
- }
- return d3_transition(subgroups, id);
- };
- d3_transitionPrototype.filter = function(filter) {
- var subgroups = [], subgroup, group, node;
- if (typeof filter !== "function") filter = d3_selection_filter(filter);
- for (var j = 0, m = this.length; j < m; j++) {
- subgroups.push(subgroup = []);
- for (var group = this[j], i = 0, n = group.length; i < n; i++) {
- if ((node = group[i]) && filter.call(node, node.__data__, i, j)) {
- subgroup.push(node);
- }
+ return this;
+ },
+ zoom: function(key, transform) {
+ if (this.mouse && key !== "mouse") this.mouse[1] = transform.invert(this.mouse[0]);
+ if (this.touch0 && key !== "touch") this.touch0[1] = transform.invert(this.touch0[0]);
+ if (this.touch1 && key !== "touch") this.touch1[1] = transform.invert(this.touch1[0]);
+ this.that.__zoom = transform;
+ this.emit("zoom");
+ return this;
+ },
+ end: function() {
+ if (--this.active === 0) {
+ gestures.splice(this.index, 1);
+ this.index = -1;
+ this.emit("end");
}
- }
- return d3_transition(subgroups, this.id);
- };
- d3_transitionPrototype.tween = function(name, tween) {
- var id = this.id;
- if (arguments.length < 2) return this.node().__transition__[id].tween.get(name);
- return d3_selection_each(this, tween == null ? function(node) {
- node.__transition__[id].tween.remove(name);
- } : function(node) {
- node.__transition__[id].tween.set(name, tween);
- });
- };
- function d3_transition_tween(groups, name, value, tween) {
- var id = groups.id;
- return d3_selection_each(groups, typeof value === "function" ? function(node, i, j) {
- node.__transition__[id].tween.set(name, tween(value.call(node, node.__data__, i, j)));
- } : (value = tween(value), function(node) {
- node.__transition__[id].tween.set(name, value);
- }));
- }
- d3_transitionPrototype.attr = function(nameNS, value) {
- if (arguments.length < 2) {
- for (value in nameNS) this.attr(value, nameNS[value]);
return this;
+ },
+ emit: function(type) {
+ customEvent(new ZoomEvent(zoom, type, this.that.__zoom), listeners.apply, listeners, [type, this.that, this.args]);
}
- var interpolate = nameNS == "transform" ? d3_interpolateTransform : d3_interpolate, name = d3.ns.qualify(nameNS);
- function attrNull() {
- this.removeAttribute(name);
+ };
+
+ function wheeled() {
+ if (!filter.apply(this, arguments)) return;
+ var g = gesture(this, arguments),
+ t = this.__zoom,
+ k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], t.k * Math.pow(2, wheelDelta.apply(this, arguments)))),
+ p = mouse(this);
+
+ // If the mouse is in the same location as before, reuse it.
+ // If there were recent wheel events, reset the wheel idle timeout.
+ if (g.wheel) {
+ if (g.mouse[0][0] !== p[0] || g.mouse[0][1] !== p[1]) {
+ g.mouse[1] = t.invert(g.mouse[0] = p);
+ }
+ clearTimeout(g.wheel);
}
- function attrNullNS() {
- this.removeAttributeNS(name.space, name.local);
+
+ // If this wheel event won’t trigger a transform change, ignore it.
+ else if (t.k === k) return;
+
+ // Otherwise, capture the mouse point and location at the start.
+ else {
+ g.mouse = [p, t.invert(p)];
+ interrupt(this);
+ g.start();
}
- function attrTween(b) {
- return b == null ? attrNull : (b += "", function() {
- var a = this.getAttribute(name), i;
- return a !== b && (i = interpolate(a, b), function(t) {
- this.setAttribute(name, i(t));
- });
- });
+
+ noevent$2();
+ g.wheel = setTimeout(wheelidled, wheelDelay);
+ g.zoom("mouse", constrain(translate(scale(t, k), g.mouse[0], g.mouse[1]), g.extent, translateExtent));
+
+ function wheelidled() {
+ g.wheel = null;
+ g.end();
}
- function attrTweenNS(b) {
- return b == null ? attrNullNS : (b += "", function() {
- var a = this.getAttributeNS(name.space, name.local), i;
- return a !== b && (i = interpolate(a, b), function(t) {
- this.setAttributeNS(name.space, name.local, i(t));
- });
- });
+ }
+
+ function mousedowned() {
+ if (touchending || !filter.apply(this, arguments)) return;
+ var g = gesture(this, arguments),
+ v = select(exports.event.view).on("mousemove.zoom", mousemoved, true).on("mouseup.zoom", mouseupped, true),
+ p = mouse(this),
+ x0 = exports.event.clientX,
+ y0 = exports.event.clientY;
+
+ dragDisable(exports.event.view);
+ nopropagation$2();
+ g.mouse = [p, this.__zoom.invert(p)];
+ interrupt(this);
+ g.start();
+
+ function mousemoved() {
+ noevent$2();
+ if (!g.moved) {
+ var dx = exports.event.clientX - x0, dy = exports.event.clientY - y0;
+ g.moved = dx * dx + dy * dy > clickDistance2;
+ }
+ g.zoom("mouse", constrain(translate(g.that.__zoom, g.mouse[0] = mouse(g.that), g.mouse[1]), g.extent, translateExtent));
}
- return d3_transition_tween(this, "attr." + nameNS, value, name.local ? attrTweenNS : attrTween);
- };
- d3_transitionPrototype.attrTween = function(nameNS, tween) {
- var name = d3.ns.qualify(nameNS);
- function attrTween(d, i) {
- var f = tween.call(this, d, i, this.getAttribute(name));
- return f && function(t) {
- this.setAttribute(name, f(t));
- };
+
+ function mouseupped() {
+ v.on("mousemove.zoom mouseup.zoom", null);
+ yesdrag(exports.event.view, g.moved);
+ noevent$2();
+ g.end();
}
- function attrTweenNS(d, i) {
- var f = tween.call(this, d, i, this.getAttributeNS(name.space, name.local));
- return f && function(t) {
- this.setAttributeNS(name.space, name.local, f(t));
- };
+ }
+
+ function dblclicked() {
+ if (!filter.apply(this, arguments)) return;
+ var t0 = this.__zoom,
+ p0 = mouse(this),
+ p1 = t0.invert(p0),
+ k1 = t0.k * (exports.event.shiftKey ? 0.5 : 2),
+ t1 = constrain(translate(scale(t0, k1), p0, p1), extent.apply(this, arguments), translateExtent);
+
+ noevent$2();
+ if (duration > 0) select(this).transition().duration(duration).call(schedule, t1, p0);
+ else select(this).call(zoom.transform, t1);
+ }
+
+ function touchstarted() {
+ if (!filter.apply(this, arguments)) return;
+ var g = gesture(this, arguments),
+ touches$$1 = exports.event.changedTouches,
+ started,
+ n = touches$$1.length, i, t, p;
+
+ nopropagation$2();
+ for (i = 0; i < n; ++i) {
+ t = touches$$1[i], p = touch(this, touches$$1, t.identifier);
+ p = [p, this.__zoom.invert(p), t.identifier];
+ if (!g.touch0) g.touch0 = p, started = true;
+ else if (!g.touch1) g.touch1 = p;
}
- return this.tween("attr." + nameNS, name.local ? attrTweenNS : attrTween);
- };
- d3_transitionPrototype.style = function(name, value, priority) {
- var n = arguments.length;
- if (n < 3) {
- if (typeof name !== "string") {
- if (n < 2) value = "";
- for (priority in name) this.style(priority, name[priority], value);
- return this;
+
+ // If this is a dbltap, reroute to the (optional) dblclick.zoom handler.
+ if (touchstarting) {
+ touchstarting = clearTimeout(touchstarting);
+ if (!g.touch1) {
+ g.end();
+ p = select(this).on("dblclick.zoom");
+ if (p) p.apply(this, arguments);
+ return;
}
- priority = "";
- }
- function styleNull() {
- this.style.removeProperty(name);
- }
- function styleString(b) {
- return b == null ? styleNull : (b += "", function() {
- var a = d3_window.getComputedStyle(this, null).getPropertyValue(name), i;
- return a !== b && (i = d3_interpolate(a, b), function(t) {
- this.style.setProperty(name, i(t), priority);
- });
- });
}
- return d3_transition_tween(this, "style." + name, value, styleString);
- };
- d3_transitionPrototype.styleTween = function(name, tween, priority) {
- if (arguments.length < 3) priority = "";
- function styleTween(d, i) {
- var f = tween.call(this, d, i, d3_window.getComputedStyle(this, null).getPropertyValue(name));
- return f && function(t) {
- this.style.setProperty(name, f(t), priority);
- };
+
+ if (started) {
+ touchstarting = setTimeout(function() { touchstarting = null; }, touchDelay);
+ interrupt(this);
+ g.start();
}
- return this.tween("style." + name, styleTween);
+ }
+
+ function touchmoved() {
+ var g = gesture(this, arguments),
+ touches$$1 = exports.event.changedTouches,
+ n = touches$$1.length, i, t, p, l;
+
+ noevent$2();
+ if (touchstarting) touchstarting = clearTimeout(touchstarting);
+ for (i = 0; i < n; ++i) {
+ t = touches$$1[i], p = touch(this, touches$$1, t.identifier);
+ if (g.touch0 && g.touch0[2] === t.identifier) g.touch0[0] = p;
+ else if (g.touch1 && g.touch1[2] === t.identifier) g.touch1[0] = p;
+ }
+ t = g.that.__zoom;
+ if (g.touch1) {
+ var p0 = g.touch0[0], l0 = g.touch0[1],
+ p1 = g.touch1[0], l1 = g.touch1[1],
+ dp = (dp = p1[0] - p0[0]) * dp + (dp = p1[1] - p0[1]) * dp,
+ dl = (dl = l1[0] - l0[0]) * dl + (dl = l1[1] - l0[1]) * dl;
+ t = scale(t, Math.sqrt(dp / dl));
+ p = [(p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2];
+ l = [(l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2];
+ }
+ else if (g.touch0) p = g.touch0[0], l = g.touch0[1];
+ else return;
+ g.zoom("touch", constrain(translate(t, p, l), g.extent, translateExtent));
+ }
+
+ function touchended() {
+ var g = gesture(this, arguments),
+ touches$$1 = exports.event.changedTouches,
+ n = touches$$1.length, i, t;
+
+ nopropagation$2();
+ if (touchending) clearTimeout(touchending);
+ touchending = setTimeout(function() { touchending = null; }, touchDelay);
+ for (i = 0; i < n; ++i) {
+ t = touches$$1[i];
+ if (g.touch0 && g.touch0[2] === t.identifier) delete g.touch0;
+ else if (g.touch1 && g.touch1[2] === t.identifier) delete g.touch1;
+ }
+ if (g.touch1 && !g.touch0) g.touch0 = g.touch1, delete g.touch1;
+ if (g.touch0) g.touch0[1] = this.__zoom.invert(g.touch0[0]);
+ else g.end();
+ }
+
+ zoom.wheelDelta = function(_) {
+ return arguments.length ? (wheelDelta = typeof _ === "function" ? _ : constant$d(+_), zoom) : wheelDelta;
};
- d3_transitionPrototype.text = function(value) {
- return d3_transition_tween(this, "text", value, d3_transition_text);
+
+ zoom.filter = function(_) {
+ return arguments.length ? (filter = typeof _ === "function" ? _ : constant$d(!!_), zoom) : filter;
};
- function d3_transition_text(b) {
- if (b == null) b = "";
- return function() {
- this.textContent = b;
- };
- }
- d3_transitionPrototype.remove = function() {
- return this.each("end.transition", function() {
- var p;
- if (this.__transition__.count < 2 && (p = this.parentNode)) p.removeChild(this);
- });
+
+ zoom.touchable = function(_) {
+ return arguments.length ? (touchable = typeof _ === "function" ? _ : constant$d(!!_), zoom) : touchable;
};
- d3_transitionPrototype.ease = function(value) {
- var id = this.id;
- if (arguments.length < 1) return this.node().__transition__[id].ease;
- if (typeof value !== "function") value = d3.ease.apply(d3, arguments);
- return d3_selection_each(this, function(node) {
- node.__transition__[id].ease = value;
- });
+
+ zoom.extent = function(_) {
+ return arguments.length ? (extent = typeof _ === "function" ? _ : constant$d([[+_[0][0], +_[0][1]], [+_[1][0], +_[1][1]]]), zoom) : extent;
};
- d3_transitionPrototype.delay = function(value) {
- var id = this.id;
- if (arguments.length < 1) return this.node().__transition__[id].delay;
- return d3_selection_each(this, typeof value === "function" ? function(node, i, j) {
- node.__transition__[id].delay = +value.call(node, node.__data__, i, j);
- } : (value = +value, function(node) {
- node.__transition__[id].delay = value;
- }));
+
+ zoom.scaleExtent = function(_) {
+ return arguments.length ? (scaleExtent[0] = +_[0], scaleExtent[1] = +_[1], zoom) : [scaleExtent[0], scaleExtent[1]];
};
- d3_transitionPrototype.duration = function(value) {
- var id = this.id;
- if (arguments.length < 1) return this.node().__transition__[id].duration;
- return d3_selection_each(this, typeof value === "function" ? function(node, i, j) {
- node.__transition__[id].duration = Math.max(1, value.call(node, node.__data__, i, j));
- } : (value = Math.max(1, value), function(node) {
- node.__transition__[id].duration = value;
- }));
+
+ zoom.translateExtent = function(_) {
+ return arguments.length ? (translateExtent[0][0] = +_[0][0], translateExtent[1][0] = +_[1][0], translateExtent[0][1] = +_[0][1], translateExtent[1][1] = +_[1][1], zoom) : [[translateExtent[0][0], translateExtent[0][1]], [translateExtent[1][0], translateExtent[1][1]]];
};
- d3_transitionPrototype.each = function(type, listener) {
- var id = this.id;
- if (arguments.length < 2) {
- var inherit = d3_transitionInherit, inheritId = d3_transitionInheritId;
- d3_transitionInheritId = id;
- d3_selection_each(this, function(node, i, j) {
- d3_transitionInherit = node.__transition__[id];
- type.call(node, node.__data__, i, j);
- });
- d3_transitionInherit = inherit;
- d3_transitionInheritId = inheritId;
- } else {
- d3_selection_each(this, function(node) {
- var transition = node.__transition__[id];
- (transition.event || (transition.event = d3.dispatch("start", "end"))).on(type, listener);
- });
- }
- return this;
+
+ zoom.constrain = function(_) {
+ return arguments.length ? (constrain = _, zoom) : constrain;
};
- d3_transitionPrototype.transition = function() {
- var id0 = this.id, id1 = ++d3_transitionId, subgroups = [], subgroup, group, node, transition;
- for (var j = 0, m = this.length; j < m; j++) {
- subgroups.push(subgroup = []);
- for (var group = this[j], i = 0, n = group.length; i < n; i++) {
- if (node = group[i]) {
- transition = Object.create(node.__transition__[id0]);
- transition.delay += transition.duration;
- d3_transitionNode(node, i, id1, transition);
- }
- subgroup.push(node);
- }
- }
- return d3_transition(subgroups, id1);
- };
- function d3_transitionNode(node, i, id, inherit) {
- var lock = node.__transition__ || (node.__transition__ = {
- active: 0,
- count: 0
- }), transition = lock[id];
- if (!transition) {
- var time = inherit.time;
- transition = lock[id] = {
- tween: new d3_Map(),
- time: time,
- ease: inherit.ease,
- delay: inherit.delay,
- duration: inherit.duration
- };
- ++lock.count;
- d3.timer(function(elapsed) {
- var d = node.__data__, ease = transition.ease, delay = transition.delay, duration = transition.duration, timer = d3_timer_active, tweened = [];
- timer.t = delay + time;
- if (delay <= elapsed) return start(elapsed - delay);
- timer.c = start;
- function start(elapsed) {
- if (lock.active > id) return stop();
- lock.active = id;
- transition.event && transition.event.start.call(node, d, i);
- transition.tween.forEach(function(key, value) {
- if (value = value.call(node, d, i)) {
- tweened.push(value);
- }
- });
- d3.timer(function() {
- timer.c = tick(elapsed || 1) ? d3_true : tick;
- return 1;
- }, 0, time);
- }
- function tick(elapsed) {
- if (lock.active !== id) return stop();
- var t = elapsed / duration, e = ease(t), n = tweened.length;
- while (n > 0) {
- tweened[--n].call(node, e);
- }
- if (t >= 1) {
- transition.event && transition.event.end.call(node, d, i);
- return stop();
- }
- }
- function stop() {
- if (--lock.count) delete lock[id]; else delete node.__transition__;
- return 1;
- }
- }, 0, time);
- }
- }
- d3.svg.axis = function() {
- var scale = d3.scale.linear(), orient = d3_svg_axisDefaultOrient, innerTickSize = 6, outerTickSize = 6, tickPadding = 3, tickArguments_ = [ 10 ], tickValues = null, tickFormat_;
- function axis(g) {
- g.each(function() {
- var g = d3.select(this);
- var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = scale.copy();
- var ticks = tickValues == null ? scale1.ticks ? scale1.ticks.apply(scale1, tickArguments_) : scale1.domain() : tickValues, tickFormat = tickFormat_ == null ? scale1.tickFormat ? scale1.tickFormat.apply(scale1, tickArguments_) : d3_identity : tickFormat_, tick = g.selectAll(".tick").data(ticks, scale1), tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick").style("opacity", ε), tickExit = d3.transition(tick.exit()).style("opacity", ε).remove(), tickUpdate = d3.transition(tick.order()).style("opacity", 1), tickSpacing = Math.max(innerTickSize, 0) + tickPadding, tickTransform;
- var range = d3_scaleRange(scale1), path = g.selectAll(".domain").data([ 0 ]), pathUpdate = (path.enter().append("path").attr("class", "domain"),
- d3.transition(path));
- tickEnter.append("line");
- tickEnter.append("text");
- var lineEnter = tickEnter.select("line"), lineUpdate = tickUpdate.select("line"), text = tick.select("text").text(tickFormat), textEnter = tickEnter.select("text"), textUpdate = tickUpdate.select("text"), sign = orient === "top" || orient === "left" ? -1 : 1, x1, x2, y1, y2;
- if (orient === "bottom" || orient === "top") {
- tickTransform = d3_svg_axisX, x1 = "x", y1 = "y", x2 = "x2", y2 = "y2";
- text.attr("dy", sign < 0 ? "0em" : ".71em").style("text-anchor", "middle");
- pathUpdate.attr("d", "M" + range[0] + "," + sign * outerTickSize + "V0H" + range[1] + "V" + sign * outerTickSize);
- } else {
- tickTransform = d3_svg_axisY, x1 = "y", y1 = "x", x2 = "y2", y2 = "x2";
- text.attr("dy", ".32em").style("text-anchor", sign < 0 ? "end" : "start");
- pathUpdate.attr("d", "M" + sign * outerTickSize + "," + range[0] + "H0V" + range[1] + "H" + sign * outerTickSize);
- }
- lineEnter.attr(y2, sign * innerTickSize);
- textEnter.attr(y1, sign * tickSpacing);
- lineUpdate.attr(x2, 0).attr(y2, sign * innerTickSize);
- textUpdate.attr(x1, 0).attr(y1, sign * tickSpacing);
- if (scale1.rangeBand) {
- var x = scale1, dx = x.rangeBand() / 2;
- scale0 = scale1 = function(d) {
- return x(d) + dx;
- };
- } else if (scale0.rangeBand) {
- scale0 = scale1;
- } else {
- tickExit.call(tickTransform, scale1, scale0);
- }
- tickEnter.call(tickTransform, scale0, scale1);
- tickUpdate.call(tickTransform, scale1, scale1);
- });
- }
- axis.scale = function(x) {
- if (!arguments.length) return scale;
- scale = x;
- return axis;
- };
- axis.orient = function(x) {
- if (!arguments.length) return orient;
- orient = x in d3_svg_axisOrients ? x + "" : d3_svg_axisDefaultOrient;
- return axis;
- };
- axis.ticks = function() {
- if (!arguments.length) return tickArguments_;
- tickArguments_ = arguments;
- return axis;
- };
- axis.tickValues = function(x) {
- if (!arguments.length) return tickValues;
- tickValues = x;
- return axis;
- };
- axis.tickFormat = function(x) {
- if (!arguments.length) return tickFormat_;
- tickFormat_ = x;
- return axis;
- };
- axis.tickSize = function(x) {
- var n = arguments.length;
- if (!n) return innerTickSize;
- innerTickSize = +x;
- outerTickSize = +arguments[n - 1];
- return axis;
- };
- axis.innerTickSize = function(x) {
- if (!arguments.length) return innerTickSize;
- innerTickSize = +x;
- return axis;
- };
- axis.outerTickSize = function(x) {
- if (!arguments.length) return outerTickSize;
- outerTickSize = +x;
- return axis;
- };
- axis.tickPadding = function(x) {
- if (!arguments.length) return tickPadding;
- tickPadding = +x;
- return axis;
- };
- axis.tickSubdivide = function() {
- return arguments.length && axis;
- };
- return axis;
- };
- var d3_svg_axisDefaultOrient = "bottom", d3_svg_axisOrients = {
- top: 1,
- right: 1,
- bottom: 1,
- left: 1
- };
- function d3_svg_axisX(selection, x0, x1) {
- selection.attr("transform", function(d) {
- var v0 = x0(d);
- return "translate(" + (isFinite(v0) ? v0 : x1(d)) + ",0)";
- });
- }
- function d3_svg_axisY(selection, y0, y1) {
- selection.attr("transform", function(d) {
- var v0 = y0(d);
- return "translate(0," + (isFinite(v0) ? v0 : y1(d)) + ")";
- });
- }
- d3.svg.brush = function() {
- var event = d3_eventDispatch(brush, "brushstart", "brush", "brushend"), x = null, y = null, xExtent = [ 0, 0 ], yExtent = [ 0, 0 ], xExtentDomain, yExtentDomain, xClamp = true, yClamp = true, resizes = d3_svg_brushResizes[0];
- function brush(g) {
- g.each(function() {
- var g = d3.select(this).style("pointer-events", "all").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)").on("mousedown.brush", brushstart).on("touchstart.brush", brushstart);
- var background = g.selectAll(".background").data([ 0 ]);
- background.enter().append("rect").attr("class", "background").style("visibility", "hidden").style("cursor", "crosshair");
- g.selectAll(".extent").data([ 0 ]).enter().append("rect").attr("class", "extent").style("cursor", "move");
- var resize = g.selectAll(".resize").data(resizes, d3_identity);
- resize.exit().remove();
- resize.enter().append("g").attr("class", function(d) {
- return "resize " + d;
- }).style("cursor", function(d) {
- return d3_svg_brushCursor[d];
- }).append("rect").attr("x", function(d) {
- return /[ew]$/.test(d) ? -3 : null;
- }).attr("y", function(d) {
- return /^[ns]/.test(d) ? -3 : null;
- }).attr("width", 6).attr("height", 6).style("visibility", "hidden");
- resize.style("display", brush.empty() ? "none" : null);
- var gUpdate = d3.transition(g), backgroundUpdate = d3.transition(background), range;
- if (x) {
- range = d3_scaleRange(x);
- backgroundUpdate.attr("x", range[0]).attr("width", range[1] - range[0]);
- redrawX(gUpdate);
- }
- if (y) {
- range = d3_scaleRange(y);
- backgroundUpdate.attr("y", range[0]).attr("height", range[1] - range[0]);
- redrawY(gUpdate);
- }
- redraw(gUpdate);
- });
- }
- brush.event = function(g) {
- g.each(function() {
- var event_ = event.of(this, arguments), extent1 = {
- x: xExtent,
- y: yExtent,
- i: xExtentDomain,
- j: yExtentDomain
- }, extent0 = this.__chart__ || extent1;
- this.__chart__ = extent1;
- if (d3_transitionInheritId) {
- d3.select(this).transition().each("start.brush", function() {
- xExtentDomain = extent0.i;
- yExtentDomain = extent0.j;
- xExtent = extent0.x;
- yExtent = extent0.y;
- event_({
- type: "brushstart"
- });
- }).tween("brush:brush", function() {
- var xi = d3_interpolateArray(xExtent, extent1.x), yi = d3_interpolateArray(yExtent, extent1.y);
- xExtentDomain = yExtentDomain = null;
- return function(t) {
- xExtent = extent1.x = xi(t);
- yExtent = extent1.y = yi(t);
- event_({
- type: "brush",
- mode: "resize"
- });
- };
- }).each("end.brush", function() {
- xExtentDomain = extent1.i;
- yExtentDomain = extent1.j;
- event_({
- type: "brush",
- mode: "resize"
- });
- event_({
- type: "brushend"
- });
- });
- } else {
- event_({
- type: "brushstart"
- });
- event_({
- type: "brush",
- mode: "resize"
- });
- event_({
- type: "brushend"
- });
- }
- });
- };
- function redraw(g) {
- g.selectAll(".resize").attr("transform", function(d) {
- return "translate(" + xExtent[+/e$/.test(d)] + "," + yExtent[+/^s/.test(d)] + ")";
- });
- }
- function redrawX(g) {
- g.select(".extent").attr("x", xExtent[0]);
- g.selectAll(".extent,.n>rect,.s>rect").attr("width", xExtent[1] - xExtent[0]);
- }
- function redrawY(g) {
- g.select(".extent").attr("y", yExtent[0]);
- g.selectAll(".extent,.e>rect,.w>rect").attr("height", yExtent[1] - yExtent[0]);
- }
- function brushstart() {
- var target = this, eventTarget = d3.select(d3.event.target), event_ = event.of(target, arguments), g = d3.select(target), resizing = eventTarget.datum(), resizingX = !/^(n|s)$/.test(resizing) && x, resizingY = !/^(e|w)$/.test(resizing) && y, dragging = eventTarget.classed("extent"), dragRestore = d3_event_dragSuppress(), center, origin = d3.mouse(target), offset;
- var w = d3.select(d3_window).on("keydown.brush", keydown).on("keyup.brush", keyup);
- if (d3.event.changedTouches) {
- w.on("touchmove.brush", brushmove).on("touchend.brush", brushend);
- } else {
- w.on("mousemove.brush", brushmove).on("mouseup.brush", brushend);
- }
- g.interrupt().selectAll("*").interrupt();
- if (dragging) {
- origin[0] = xExtent[0] - origin[0];
- origin[1] = yExtent[0] - origin[1];
- } else if (resizing) {
- var ex = +/w$/.test(resizing), ey = +/^n/.test(resizing);
- offset = [ xExtent[1 - ex] - origin[0], yExtent[1 - ey] - origin[1] ];
- origin[0] = xExtent[ex];
- origin[1] = yExtent[ey];
- } else if (d3.event.altKey) center = origin.slice();
- g.style("pointer-events", "none").selectAll(".resize").style("display", null);
- d3.select("body").style("cursor", eventTarget.style("cursor"));
- event_({
- type: "brushstart"
- });
- brushmove();
- function keydown() {
- if (d3.event.keyCode == 32) {
- if (!dragging) {
- center = null;
- origin[0] -= xExtent[1];
- origin[1] -= yExtent[1];
- dragging = 2;
- }
- d3_eventPreventDefault();
- }
- }
- function keyup() {
- if (d3.event.keyCode == 32 && dragging == 2) {
- origin[0] += xExtent[1];
- origin[1] += yExtent[1];
- dragging = 0;
- d3_eventPreventDefault();
- }
- }
- function brushmove() {
- var point = d3.mouse(target), moved = false;
- if (offset) {
- point[0] += offset[0];
- point[1] += offset[1];
- }
- if (!dragging) {
- if (d3.event.altKey) {
- if (!center) center = [ (xExtent[0] + xExtent[1]) / 2, (yExtent[0] + yExtent[1]) / 2 ];
- origin[0] = xExtent[+(point[0] < center[0])];
- origin[1] = yExtent[+(point[1] < center[1])];
- } else center = null;
- }
- if (resizingX && move1(point, x, 0)) {
- redrawX(g);
- moved = true;
- }
- if (resizingY && move1(point, y, 1)) {
- redrawY(g);
- moved = true;
- }
- if (moved) {
- redraw(g);
- event_({
- type: "brush",
- mode: dragging ? "move" : "resize"
- });
- }
- }
- function move1(point, scale, i) {
- var range = d3_scaleRange(scale), r0 = range[0], r1 = range[1], position = origin[i], extent = i ? yExtent : xExtent, size = extent[1] - extent[0], min, max;
- if (dragging) {
- r0 -= position;
- r1 -= size + position;
- }
- min = (i ? yClamp : xClamp) ? Math.max(r0, Math.min(r1, point[i])) : point[i];
- if (dragging) {
- max = (min += position) + size;
- } else {
- if (center) position = Math.max(r0, Math.min(r1, 2 * center[i] - min));
- if (position < min) {
- max = min;
- min = position;
- } else {
- max = position;
- }
- }
- if (extent[0] != min || extent[1] != max) {
- if (i) yExtentDomain = null; else xExtentDomain = null;
- extent[0] = min;
- extent[1] = max;
- return true;
- }
- }
- function brushend() {
- brushmove();
- g.style("pointer-events", "all").selectAll(".resize").style("display", brush.empty() ? "none" : null);
- d3.select("body").style("cursor", null);
- w.on("mousemove.brush", null).on("mouseup.brush", null).on("touchmove.brush", null).on("touchend.brush", null).on("keydown.brush", null).on("keyup.brush", null);
- dragRestore();
- event_({
- type: "brushend"
- });
- }
- }
- brush.x = function(z) {
- if (!arguments.length) return x;
- x = z;
- resizes = d3_svg_brushResizes[!x << 1 | !y];
- return brush;
- };
- brush.y = function(z) {
- if (!arguments.length) return y;
- y = z;
- resizes = d3_svg_brushResizes[!x << 1 | !y];
- return brush;
- };
- brush.clamp = function(z) {
- if (!arguments.length) return x && y ? [ xClamp, yClamp ] : x ? xClamp : y ? yClamp : null;
- if (x && y) xClamp = !!z[0], yClamp = !!z[1]; else if (x) xClamp = !!z; else if (y) yClamp = !!z;
- return brush;
- };
- brush.extent = function(z) {
- var x0, x1, y0, y1, t;
- if (!arguments.length) {
- if (x) {
- if (xExtentDomain) {
- x0 = xExtentDomain[0], x1 = xExtentDomain[1];
- } else {
- x0 = xExtent[0], x1 = xExtent[1];
- if (x.invert) x0 = x.invert(x0), x1 = x.invert(x1);
- if (x1 < x0) t = x0, x0 = x1, x1 = t;
- }
- }
- if (y) {
- if (yExtentDomain) {
- y0 = yExtentDomain[0], y1 = yExtentDomain[1];
- } else {
- y0 = yExtent[0], y1 = yExtent[1];
- if (y.invert) y0 = y.invert(y0), y1 = y.invert(y1);
- if (y1 < y0) t = y0, y0 = y1, y1 = t;
- }
- }
- return x && y ? [ [ x0, y0 ], [ x1, y1 ] ] : x ? [ x0, x1 ] : y && [ y0, y1 ];
- }
- if (x) {
- x0 = z[0], x1 = z[1];
- if (y) x0 = x0[0], x1 = x1[0];
- xExtentDomain = [ x0, x1 ];
- if (x.invert) x0 = x(x0), x1 = x(x1);
- if (x1 < x0) t = x0, x0 = x1, x1 = t;
- if (x0 != xExtent[0] || x1 != xExtent[1]) xExtent = [ x0, x1 ];
- }
- if (y) {
- y0 = z[0], y1 = z[1];
- if (x) y0 = y0[1], y1 = y1[1];
- yExtentDomain = [ y0, y1 ];
- if (y.invert) y0 = y(y0), y1 = y(y1);
- if (y1 < y0) t = y0, y0 = y1, y1 = t;
- if (y0 != yExtent[0] || y1 != yExtent[1]) yExtent = [ y0, y1 ];
- }
- return brush;
- };
- brush.clear = function() {
- if (!brush.empty()) {
- xExtent = [ 0, 0 ], yExtent = [ 0, 0 ];
- xExtentDomain = yExtentDomain = null;
- }
- return brush;
- };
- brush.empty = function() {
- return !!x && xExtent[0] == xExtent[1] || !!y && yExtent[0] == yExtent[1];
- };
- return d3.rebind(brush, event, "on");
- };
- var d3_svg_brushCursor = {
- n: "ns-resize",
- e: "ew-resize",
- s: "ns-resize",
- w: "ew-resize",
- nw: "nwse-resize",
- ne: "nesw-resize",
- se: "nwse-resize",
- sw: "nesw-resize"
- };
- var d3_svg_brushResizes = [ [ "n", "e", "s", "w", "nw", "ne", "se", "sw" ], [ "e", "w" ], [ "n", "s" ], [] ];
- var d3_time_format = d3_time.format = d3_locale_enUS.timeFormat;
- var d3_time_formatUtc = d3_time_format.utc;
- var d3_time_formatIso = d3_time_formatUtc("%Y-%m-%dT%H:%M:%S.%LZ");
- d3_time_format.iso = Date.prototype.toISOString && +new Date("2000-01-01T00:00:00.000Z") ? d3_time_formatIsoNative : d3_time_formatIso;
- function d3_time_formatIsoNative(date) {
- return date.toISOString();
- }
- d3_time_formatIsoNative.parse = function(string) {
- var date = new Date(string);
- return isNaN(date) ? null : date;
- };
- d3_time_formatIsoNative.toString = d3_time_formatIso.toString;
- d3_time.second = d3_time_interval(function(date) {
- return new d3_date(Math.floor(date / 1e3) * 1e3);
- }, function(date, offset) {
- date.setTime(date.getTime() + Math.floor(offset) * 1e3);
- }, function(date) {
- return date.getSeconds();
- });
- d3_time.seconds = d3_time.second.range;
- d3_time.seconds.utc = d3_time.second.utc.range;
- d3_time.minute = d3_time_interval(function(date) {
- return new d3_date(Math.floor(date / 6e4) * 6e4);
- }, function(date, offset) {
- date.setTime(date.getTime() + Math.floor(offset) * 6e4);
- }, function(date) {
- return date.getMinutes();
- });
- d3_time.minutes = d3_time.minute.range;
- d3_time.minutes.utc = d3_time.minute.utc.range;
- d3_time.hour = d3_time_interval(function(date) {
- var timezone = date.getTimezoneOffset() / 60;
- return new d3_date((Math.floor(date / 36e5 - timezone) + timezone) * 36e5);
- }, function(date, offset) {
- date.setTime(date.getTime() + Math.floor(offset) * 36e5);
- }, function(date) {
- return date.getHours();
- });
- d3_time.hours = d3_time.hour.range;
- d3_time.hours.utc = d3_time.hour.utc.range;
- d3_time.month = d3_time_interval(function(date) {
- date = d3_time.day(date);
- date.setDate(1);
- return date;
- }, function(date, offset) {
- date.setMonth(date.getMonth() + offset);
- }, function(date) {
- return date.getMonth();
- });
- d3_time.months = d3_time.month.range;
- d3_time.months.utc = d3_time.month.utc.range;
- function d3_time_scale(linear, methods, format) {
- function scale(x) {
- return linear(x);
- }
- scale.invert = function(x) {
- return d3_time_scaleDate(linear.invert(x));
- };
- scale.domain = function(x) {
- if (!arguments.length) return linear.domain().map(d3_time_scaleDate);
- linear.domain(x);
- return scale;
- };
- function tickMethod(extent, count) {
- var span = extent[1] - extent[0], target = span / count, i = d3.bisect(d3_time_scaleSteps, target);
- return i == d3_time_scaleSteps.length ? [ methods.year, d3_scale_linearTickRange(extent.map(function(d) {
- return d / 31536e6;
- }), count)[2] ] : !i ? [ d3_time_scaleMilliseconds, d3_scale_linearTickRange(extent, count)[2] ] : methods[target / d3_time_scaleSteps[i - 1] < d3_time_scaleSteps[i] / target ? i - 1 : i];
- }
- scale.nice = function(interval, skip) {
- var domain = scale.domain(), extent = d3_scaleExtent(domain), method = interval == null ? tickMethod(extent, 10) : typeof interval === "number" && tickMethod(extent, interval);
- if (method) interval = method[0], skip = method[1];
- function skipped(date) {
- return !isNaN(date) && !interval.range(date, d3_time_scaleDate(+date + 1), skip).length;
- }
- return scale.domain(d3_scale_nice(domain, skip > 1 ? {
- floor: function(date) {
- while (skipped(date = interval.floor(date))) date = d3_time_scaleDate(date - 1);
- return date;
- },
- ceil: function(date) {
- while (skipped(date = interval.ceil(date))) date = d3_time_scaleDate(+date + 1);
- return date;
- }
- } : interval));
- };
- scale.ticks = function(interval, skip) {
- var extent = d3_scaleExtent(scale.domain()), method = interval == null ? tickMethod(extent, 10) : typeof interval === "number" ? tickMethod(extent, interval) : !interval.range && [ {
- range: interval
- }, skip ];
- if (method) interval = method[0], skip = method[1];
- return interval.range(extent[0], d3_time_scaleDate(+extent[1] + 1), skip < 1 ? 1 : skip);
- };
- scale.tickFormat = function() {
- return format;
- };
- scale.copy = function() {
- return d3_time_scale(linear.copy(), methods, format);
- };
- return d3_scale_linearRebind(scale, linear);
- }
- function d3_time_scaleDate(t) {
- return new Date(t);
- }
- var d3_time_scaleSteps = [ 1e3, 5e3, 15e3, 3e4, 6e4, 3e5, 9e5, 18e5, 36e5, 108e5, 216e5, 432e5, 864e5, 1728e5, 6048e5, 2592e6, 7776e6, 31536e6 ];
- var d3_time_scaleLocalMethods = [ [ d3_time.second, 1 ], [ d3_time.second, 5 ], [ d3_time.second, 15 ], [ d3_time.second, 30 ], [ d3_time.minute, 1 ], [ d3_time.minute, 5 ], [ d3_time.minute, 15 ], [ d3_time.minute, 30 ], [ d3_time.hour, 1 ], [ d3_time.hour, 3 ], [ d3_time.hour, 6 ], [ d3_time.hour, 12 ], [ d3_time.day, 1 ], [ d3_time.day, 2 ], [ d3_time.week, 1 ], [ d3_time.month, 1 ], [ d3_time.month, 3 ], [ d3_time.year, 1 ] ];
- var d3_time_scaleLocalFormat = d3_time_format.multi([ [ ".%L", function(d) {
- return d.getMilliseconds();
- } ], [ ":%S", function(d) {
- return d.getSeconds();
- } ], [ "%I:%M", function(d) {
- return d.getMinutes();
- } ], [ "%I %p", function(d) {
- return d.getHours();
- } ], [ "%a %d", function(d) {
- return d.getDay() && d.getDate() != 1;
- } ], [ "%b %d", function(d) {
- return d.getDate() != 1;
- } ], [ "%B", function(d) {
- return d.getMonth();
- } ], [ "%Y", d3_true ] ]);
- var d3_time_scaleMilliseconds = {
- range: function(start, stop, step) {
- return d3.range(Math.ceil(start / step) * step, +stop, step).map(d3_time_scaleDate);
- },
- floor: d3_identity,
- ceil: d3_identity
+
+ zoom.duration = function(_) {
+ return arguments.length ? (duration = +_, zoom) : duration;
};
- d3_time_scaleLocalMethods.year = d3_time.year;
- d3_time.scale = function() {
- return d3_time_scale(d3.scale.linear(), d3_time_scaleLocalMethods, d3_time_scaleLocalFormat);
+
+ zoom.interpolate = function(_) {
+ return arguments.length ? (interpolate = _, zoom) : interpolate;
};
- var d3_time_scaleUtcMethods = d3_time_scaleLocalMethods.map(function(m) {
- return [ m[0].utc, m[1] ];
- });
- var d3_time_scaleUtcFormat = d3_time_formatUtc.multi([ [ ".%L", function(d) {
- return d.getUTCMilliseconds();
- } ], [ ":%S", function(d) {
- return d.getUTCSeconds();
- } ], [ "%I:%M", function(d) {
- return d.getUTCMinutes();
- } ], [ "%I %p", function(d) {
- return d.getUTCHours();
- } ], [ "%a %d", function(d) {
- return d.getUTCDay() && d.getUTCDate() != 1;
- } ], [ "%b %d", function(d) {
- return d.getUTCDate() != 1;
- } ], [ "%B", function(d) {
- return d.getUTCMonth();
- } ], [ "%Y", d3_true ] ]);
- d3_time_scaleUtcMethods.year = d3_time.year.utc;
- d3_time.scale.utc = function() {
- return d3_time_scale(d3.scale.linear(), d3_time_scaleUtcMethods, d3_time_scaleUtcFormat);
- };
- d3.text = d3_xhrType(function(request) {
- return request.responseText;
- });
- d3.json = function(url, callback) {
- return d3_xhr(url, "application/json", d3_json, callback);
+
+ zoom.on = function() {
+ var value = listeners.on.apply(listeners, arguments);
+ return value === listeners ? zoom : value;
};
- function d3_json(request) {
- return JSON.parse(request.responseText);
- }
- d3.html = function(url, callback) {
- return d3_xhr(url, "text/html", d3_html, callback);
+
+ zoom.clickDistance = function(_) {
+ return arguments.length ? (clickDistance2 = (_ = +_) * _, zoom) : Math.sqrt(clickDistance2);
};
- function d3_html(request) {
- var range = d3_document.createRange();
- range.selectNode(d3_document.body);
- return range.createContextualFragment(request.responseText);
- }
- d3.xml = d3_xhrType(function(request) {
- return request.responseXML;
- });
- if (typeof define === "function" && define.amd) define(d3); else if (typeof module === "object" && module.exports) module.exports = d3;
- this.d3 = d3;
-}();
+
+ return zoom;
+}
+
+exports.version = version;
+exports.bisect = bisectRight;
+exports.bisectRight = bisectRight;
+exports.bisectLeft = bisectLeft;
+exports.ascending = ascending;
+exports.bisector = bisector;
+exports.cross = cross;
+exports.descending = descending;
+exports.deviation = deviation;
+exports.extent = extent;
+exports.histogram = histogram;
+exports.thresholdFreedmanDiaconis = freedmanDiaconis;
+exports.thresholdScott = scott;
+exports.thresholdSturges = thresholdSturges;
+exports.max = max;
+exports.mean = mean;
+exports.median = median;
+exports.merge = merge;
+exports.min = min;
+exports.pairs = pairs;
+exports.permute = permute;
+exports.quantile = threshold;
+exports.range = sequence;
+exports.scan = scan;
+exports.shuffle = shuffle;
+exports.sum = sum;
+exports.ticks = ticks;
+exports.tickIncrement = tickIncrement;
+exports.tickStep = tickStep;
+exports.transpose = transpose;
+exports.variance = variance;
+exports.zip = zip;
+exports.axisTop = axisTop;
+exports.axisRight = axisRight;
+exports.axisBottom = axisBottom;
+exports.axisLeft = axisLeft;
+exports.brush = brush;
+exports.brushX = brushX;
+exports.brushY = brushY;
+exports.brushSelection = brushSelection;
+exports.chord = chord;
+exports.ribbon = ribbon;
+exports.nest = nest;
+exports.set = set$2;
+exports.map = map$1;
+exports.keys = keys;
+exports.values = values;
+exports.entries = entries;
+exports.color = color;
+exports.rgb = rgb;
+exports.hsl = hsl;
+exports.lab = lab;
+exports.hcl = hcl;
+exports.lch = lch;
+exports.gray = gray;
+exports.cubehelix = cubehelix;
+exports.contours = contours;
+exports.contourDensity = density;
+exports.dispatch = dispatch;
+exports.drag = drag;
+exports.dragDisable = dragDisable;
+exports.dragEnable = yesdrag;
+exports.dsvFormat = dsvFormat;
+exports.csvParse = csvParse;
+exports.csvParseRows = csvParseRows;
+exports.csvFormat = csvFormat;
+exports.csvFormatBody = csvFormatBody;
+exports.csvFormatRows = csvFormatRows;
+exports.tsvParse = tsvParse;
+exports.tsvParseRows = tsvParseRows;
+exports.tsvFormat = tsvFormat;
+exports.tsvFormatBody = tsvFormatBody;
+exports.tsvFormatRows = tsvFormatRows;
+exports.autoType = autoType;
+exports.easeLinear = linear$1;
+exports.easeQuad = quadInOut;
+exports.easeQuadIn = quadIn;
+exports.easeQuadOut = quadOut;
+exports.easeQuadInOut = quadInOut;
+exports.easeCubic = cubicInOut;
+exports.easeCubicIn = cubicIn;
+exports.easeCubicOut = cubicOut;
+exports.easeCubicInOut = cubicInOut;
+exports.easePoly = polyInOut;
+exports.easePolyIn = polyIn;
+exports.easePolyOut = polyOut;
+exports.easePolyInOut = polyInOut;
+exports.easeSin = sinInOut;
+exports.easeSinIn = sinIn;
+exports.easeSinOut = sinOut;
+exports.easeSinInOut = sinInOut;
+exports.easeExp = expInOut;
+exports.easeExpIn = expIn;
+exports.easeExpOut = expOut;
+exports.easeExpInOut = expInOut;
+exports.easeCircle = circleInOut;
+exports.easeCircleIn = circleIn;
+exports.easeCircleOut = circleOut;
+exports.easeCircleInOut = circleInOut;
+exports.easeBounce = bounceOut;
+exports.easeBounceIn = bounceIn;
+exports.easeBounceOut = bounceOut;
+exports.easeBounceInOut = bounceInOut;
+exports.easeBack = backInOut;
+exports.easeBackIn = backIn;
+exports.easeBackOut = backOut;
+exports.easeBackInOut = backInOut;
+exports.easeElastic = elasticOut;
+exports.easeElasticIn = elasticIn;
+exports.easeElasticOut = elasticOut;
+exports.easeElasticInOut = elasticInOut;
+exports.blob = blob;
+exports.buffer = buffer;
+exports.dsv = dsv;
+exports.csv = csv$1;
+exports.tsv = tsv$1;
+exports.image = image;
+exports.json = json;
+exports.text = text;
+exports.xml = xml;
+exports.html = html;
+exports.svg = svg;
+exports.forceCenter = center$1;
+exports.forceCollide = collide;
+exports.forceLink = link;
+exports.forceManyBody = manyBody;
+exports.forceRadial = radial;
+exports.forceSimulation = simulation;
+exports.forceX = x$2;
+exports.forceY = y$2;
+exports.formatDefaultLocale = defaultLocale;
+exports.formatLocale = formatLocale;
+exports.formatSpecifier = formatSpecifier;
+exports.precisionFixed = precisionFixed;
+exports.precisionPrefix = precisionPrefix;
+exports.precisionRound = precisionRound;
+exports.geoArea = area$1;
+exports.geoBounds = bounds;
+exports.geoCentroid = centroid;
+exports.geoCircle = circle;
+exports.geoClipAntimeridian = clipAntimeridian;
+exports.geoClipCircle = clipCircle;
+exports.geoClipExtent = extent$1;
+exports.geoClipRectangle = clipRectangle;
+exports.geoContains = contains$1;
+exports.geoDistance = distance;
+exports.geoGraticule = graticule;
+exports.geoGraticule10 = graticule10;
+exports.geoInterpolate = interpolate$1;
+exports.geoLength = length$1;
+exports.geoPath = index$1;
+exports.geoAlbers = albers;
+exports.geoAlbersUsa = albersUsa;
+exports.geoAzimuthalEqualArea = azimuthalEqualArea;
+exports.geoAzimuthalEqualAreaRaw = azimuthalEqualAreaRaw;
+exports.geoAzimuthalEquidistant = azimuthalEquidistant;
+exports.geoAzimuthalEquidistantRaw = azimuthalEquidistantRaw;
+exports.geoConicConformal = conicConformal;
+exports.geoConicConformalRaw = conicConformalRaw;
+exports.geoConicEqualArea = conicEqualArea;
+exports.geoConicEqualAreaRaw = conicEqualAreaRaw;
+exports.geoConicEquidistant = conicEquidistant;
+exports.geoConicEquidistantRaw = conicEquidistantRaw;
+exports.geoEqualEarth = equalEarth;
+exports.geoEqualEarthRaw = equalEarthRaw;
+exports.geoEquirectangular = equirectangular;
+exports.geoEquirectangularRaw = equirectangularRaw;
+exports.geoGnomonic = gnomonic;
+exports.geoGnomonicRaw = gnomonicRaw;
+exports.geoIdentity = identity$5;
+exports.geoProjection = projection;
+exports.geoProjectionMutator = projectionMutator;
+exports.geoMercator = mercator;
+exports.geoMercatorRaw = mercatorRaw;
+exports.geoNaturalEarth1 = naturalEarth1;
+exports.geoNaturalEarth1Raw = naturalEarth1Raw;
+exports.geoOrthographic = orthographic;
+exports.geoOrthographicRaw = orthographicRaw;
+exports.geoStereographic = stereographic;
+exports.geoStereographicRaw = stereographicRaw;
+exports.geoTransverseMercator = transverseMercator;
+exports.geoTransverseMercatorRaw = transverseMercatorRaw;
+exports.geoRotation = rotation;
+exports.geoStream = geoStream;
+exports.geoTransform = transform;
+exports.cluster = cluster;
+exports.hierarchy = hierarchy;
+exports.pack = index$2;
+exports.packSiblings = siblings;
+exports.packEnclose = enclose;
+exports.partition = partition;
+exports.stratify = stratify;
+exports.tree = tree;
+exports.treemap = index$3;
+exports.treemapBinary = binary;
+exports.treemapDice = treemapDice;
+exports.treemapSlice = treemapSlice;
+exports.treemapSliceDice = sliceDice;
+exports.treemapSquarify = squarify;
+exports.treemapResquarify = resquarify;
+exports.interpolate = interpolateValue;
+exports.interpolateArray = array$1;
+exports.interpolateBasis = basis$1;
+exports.interpolateBasisClosed = basisClosed;
+exports.interpolateDate = date;
+exports.interpolateDiscrete = discrete;
+exports.interpolateHue = hue$1;
+exports.interpolateNumber = interpolateNumber;
+exports.interpolateObject = object;
+exports.interpolateRound = interpolateRound;
+exports.interpolateString = interpolateString;
+exports.interpolateTransformCss = interpolateTransformCss;
+exports.interpolateTransformSvg = interpolateTransformSvg;
+exports.interpolateZoom = interpolateZoom;
+exports.interpolateRgb = interpolateRgb;
+exports.interpolateRgbBasis = rgbBasis;
+exports.interpolateRgbBasisClosed = rgbBasisClosed;
+exports.interpolateHsl = hsl$2;
+exports.interpolateHslLong = hslLong;
+exports.interpolateLab = lab$1;
+exports.interpolateHcl = hcl$2;
+exports.interpolateHclLong = hclLong;
+exports.interpolateCubehelix = cubehelix$2;
+exports.interpolateCubehelixLong = cubehelixLong;
+exports.piecewise = piecewise;
+exports.quantize = quantize;
+exports.path = path;
+exports.polygonArea = area$2;
+exports.polygonCentroid = centroid$1;
+exports.polygonHull = hull;
+exports.polygonContains = contains$2;
+exports.polygonLength = length$2;
+exports.quadtree = quadtree;
+exports.randomUniform = uniform;
+exports.randomNormal = normal;
+exports.randomLogNormal = logNormal;
+exports.randomBates = bates;
+exports.randomIrwinHall = irwinHall;
+exports.randomExponential = exponential$1;
+exports.scaleBand = band;
+exports.scalePoint = point$1;
+exports.scaleIdentity = identity$7;
+exports.scaleLinear = linear$2;
+exports.scaleLog = log$1;
+exports.scaleSymlog = symlog;
+exports.scaleOrdinal = ordinal;
+exports.scaleImplicit = implicit;
+exports.scalePow = pow$1;
+exports.scaleSqrt = sqrt$1;
+exports.scaleQuantile = quantile$$1;
+exports.scaleQuantize = quantize$1;
+exports.scaleThreshold = threshold$1;
+exports.scaleTime = time;
+exports.scaleUtc = utcTime;
+exports.scaleSequential = sequential;
+exports.scaleSequentialLog = sequentialLog;
+exports.scaleSequentialPow = sequentialPow;
+exports.scaleSequentialSqrt = sequentialSqrt;
+exports.scaleSequentialSymlog = sequentialSymlog;
+exports.scaleSequentialQuantile = sequentialQuantile;
+exports.scaleDiverging = diverging;
+exports.scaleDivergingLog = divergingLog;
+exports.scaleDivergingPow = divergingPow;
+exports.scaleDivergingSqrt = divergingSqrt;
+exports.scaleDivergingSymlog = divergingSymlog;
+exports.tickFormat = tickFormat;
+exports.schemeCategory10 = category10;
+exports.schemeAccent = Accent;
+exports.schemeDark2 = Dark2;
+exports.schemePaired = Paired;
+exports.schemePastel1 = Pastel1;
+exports.schemePastel2 = Pastel2;
+exports.schemeSet1 = Set1;
+exports.schemeSet2 = Set2;
+exports.schemeSet3 = Set3;
+exports.interpolateBrBG = BrBG;
+exports.schemeBrBG = scheme;
+exports.interpolatePRGn = PRGn;
+exports.schemePRGn = scheme$1;
+exports.interpolatePiYG = PiYG;
+exports.schemePiYG = scheme$2;
+exports.interpolatePuOr = PuOr;
+exports.schemePuOr = scheme$3;
+exports.interpolateRdBu = RdBu;
+exports.schemeRdBu = scheme$4;
+exports.interpolateRdGy = RdGy;
+exports.schemeRdGy = scheme$5;
+exports.interpolateRdYlBu = RdYlBu;
+exports.schemeRdYlBu = scheme$6;
+exports.interpolateRdYlGn = RdYlGn;
+exports.schemeRdYlGn = scheme$7;
+exports.interpolateSpectral = Spectral;
+exports.schemeSpectral = scheme$8;
+exports.interpolateBuGn = BuGn;
+exports.schemeBuGn = scheme$9;
+exports.interpolateBuPu = BuPu;
+exports.schemeBuPu = scheme$a;
+exports.interpolateGnBu = GnBu;
+exports.schemeGnBu = scheme$b;
+exports.interpolateOrRd = OrRd;
+exports.schemeOrRd = scheme$c;
+exports.interpolatePuBuGn = PuBuGn;
+exports.schemePuBuGn = scheme$d;
+exports.interpolatePuBu = PuBu;
+exports.schemePuBu = scheme$e;
+exports.interpolatePuRd = PuRd;
+exports.schemePuRd = scheme$f;
+exports.interpolateRdPu = RdPu;
+exports.schemeRdPu = scheme$g;
+exports.interpolateYlGnBu = YlGnBu;
+exports.schemeYlGnBu = scheme$h;
+exports.interpolateYlGn = YlGn;
+exports.schemeYlGn = scheme$i;
+exports.interpolateYlOrBr = YlOrBr;
+exports.schemeYlOrBr = scheme$j;
+exports.interpolateYlOrRd = YlOrRd;
+exports.schemeYlOrRd = scheme$k;
+exports.interpolateBlues = Blues;
+exports.schemeBlues = scheme$l;
+exports.interpolateGreens = Greens;
+exports.schemeGreens = scheme$m;
+exports.interpolateGreys = Greys;
+exports.schemeGreys = scheme$n;
+exports.interpolatePurples = Purples;
+exports.schemePurples = scheme$o;
+exports.interpolateReds = Reds;
+exports.schemeReds = scheme$p;
+exports.interpolateOranges = Oranges;
+exports.schemeOranges = scheme$q;
+exports.interpolateCubehelixDefault = cubehelix$3;
+exports.interpolateRainbow = rainbow;
+exports.interpolateWarm = warm;
+exports.interpolateCool = cool;
+exports.interpolateSinebow = sinebow;
+exports.interpolateViridis = viridis;
+exports.interpolateMagma = magma;
+exports.interpolateInferno = inferno;
+exports.interpolatePlasma = plasma;
+exports.create = create;
+exports.creator = creator;
+exports.local = local;
+exports.matcher = matcher;
+exports.mouse = mouse;
+exports.namespace = namespace;
+exports.namespaces = namespaces;
+exports.clientPoint = point;
+exports.select = select;
+exports.selectAll = selectAll;
+exports.selection = selection;
+exports.selector = selector;
+exports.selectorAll = selectorAll;
+exports.style = styleValue;
+exports.touch = touch;
+exports.touches = touches;
+exports.window = defaultView;
+exports.customEvent = customEvent;
+exports.arc = arc;
+exports.area = area$3;
+exports.line = line;
+exports.pie = pie;
+exports.areaRadial = areaRadial;
+exports.radialArea = areaRadial;
+exports.lineRadial = lineRadial$1;
+exports.radialLine = lineRadial$1;
+exports.pointRadial = pointRadial;
+exports.linkHorizontal = linkHorizontal;
+exports.linkVertical = linkVertical;
+exports.linkRadial = linkRadial;
+exports.symbol = symbol;
+exports.symbols = symbols;
+exports.symbolCircle = circle$2;
+exports.symbolCross = cross$2;
+exports.symbolDiamond = diamond;
+exports.symbolSquare = square;
+exports.symbolStar = star;
+exports.symbolTriangle = triangle;
+exports.symbolWye = wye;
+exports.curveBasisClosed = basisClosed$1;
+exports.curveBasisOpen = basisOpen;
+exports.curveBasis = basis$2;
+exports.curveBundle = bundle;
+exports.curveCardinalClosed = cardinalClosed;
+exports.curveCardinalOpen = cardinalOpen;
+exports.curveCardinal = cardinal;
+exports.curveCatmullRomClosed = catmullRomClosed;
+exports.curveCatmullRomOpen = catmullRomOpen;
+exports.curveCatmullRom = catmullRom;
+exports.curveLinearClosed = linearClosed;
+exports.curveLinear = curveLinear;
+exports.curveMonotoneX = monotoneX;
+exports.curveMonotoneY = monotoneY;
+exports.curveNatural = natural;
+exports.curveStep = step;
+exports.curveStepAfter = stepAfter;
+exports.curveStepBefore = stepBefore;
+exports.stack = stack;
+exports.stackOffsetExpand = expand;
+exports.stackOffsetDiverging = diverging$1;
+exports.stackOffsetNone = none$1;
+exports.stackOffsetSilhouette = silhouette;
+exports.stackOffsetWiggle = wiggle;
+exports.stackOrderAppearance = appearance;
+exports.stackOrderAscending = ascending$3;
+exports.stackOrderDescending = descending$2;
+exports.stackOrderInsideOut = insideOut;
+exports.stackOrderNone = none$2;
+exports.stackOrderReverse = reverse;
+exports.timeInterval = newInterval;
+exports.timeMillisecond = millisecond;
+exports.timeMilliseconds = milliseconds;
+exports.utcMillisecond = millisecond;
+exports.utcMilliseconds = milliseconds;
+exports.timeSecond = second;
+exports.timeSeconds = seconds;
+exports.utcSecond = second;
+exports.utcSeconds = seconds;
+exports.timeMinute = minute;
+exports.timeMinutes = minutes;
+exports.timeHour = hour;
+exports.timeHours = hours;
+exports.timeDay = day;
+exports.timeDays = days;
+exports.timeWeek = sunday;
+exports.timeWeeks = sundays;
+exports.timeSunday = sunday;
+exports.timeSundays = sundays;
+exports.timeMonday = monday;
+exports.timeMondays = mondays;
+exports.timeTuesday = tuesday;
+exports.timeTuesdays = tuesdays;
+exports.timeWednesday = wednesday;
+exports.timeWednesdays = wednesdays;
+exports.timeThursday = thursday;
+exports.timeThursdays = thursdays;
+exports.timeFriday = friday;
+exports.timeFridays = fridays;
+exports.timeSaturday = saturday;
+exports.timeSaturdays = saturdays;
+exports.timeMonth = month;
+exports.timeMonths = months;
+exports.timeYear = year;
+exports.timeYears = years;
+exports.utcMinute = utcMinute;
+exports.utcMinutes = utcMinutes;
+exports.utcHour = utcHour;
+exports.utcHours = utcHours;
+exports.utcDay = utcDay;
+exports.utcDays = utcDays;
+exports.utcWeek = utcSunday;
+exports.utcWeeks = utcSundays;
+exports.utcSunday = utcSunday;
+exports.utcSundays = utcSundays;
+exports.utcMonday = utcMonday;
+exports.utcMondays = utcMondays;
+exports.utcTuesday = utcTuesday;
+exports.utcTuesdays = utcTuesdays;
+exports.utcWednesday = utcWednesday;
+exports.utcWednesdays = utcWednesdays;
+exports.utcThursday = utcThursday;
+exports.utcThursdays = utcThursdays;
+exports.utcFriday = utcFriday;
+exports.utcFridays = utcFridays;
+exports.utcSaturday = utcSaturday;
+exports.utcSaturdays = utcSaturdays;
+exports.utcMonth = utcMonth;
+exports.utcMonths = utcMonths;
+exports.utcYear = utcYear;
+exports.utcYears = utcYears;
+exports.timeFormatDefaultLocale = defaultLocale$1;
+exports.timeFormatLocale = formatLocale$1;
+exports.isoFormat = formatIso;
+exports.isoParse = parseIso;
+exports.now = now;
+exports.timer = timer;
+exports.timerFlush = timerFlush;
+exports.timeout = timeout$1;
+exports.interval = interval$1;
+exports.transition = transition;
+exports.active = active;
+exports.interrupt = interrupt;
+exports.voronoi = voronoi;
+exports.zoom = zoom;
+exports.zoomTransform = transform$1;
+exports.zoomIdentity = identity$9;
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+})));
diff --git a/x2engine/js/d3/d3.min.js b/x2engine/js/d3/d3.min.js
index 88550ae51..1309c949e 100644
--- a/x2engine/js/d3/d3.min.js
+++ b/x2engine/js/d3/d3.min.js
@@ -1,5 +1,2 @@
-!function(){function n(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function t(n){return null!=n&&!isNaN(n)}function e(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function r(n){return n.length}function u(n){for(var t=1;n*t%1;)t*=10;return t}function i(n,t){try{for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}catch(r){n.prototype=t}}function o(){}function a(n){return ia+n in this}function c(n){return n=ia+n,n in this&&delete this[n]}function s(){var n=[];return this.forEach(function(t){n.push(t)}),n}function l(){var n=0;for(var t in this)t.charCodeAt(0)===oa&&++n;return n}function f(){for(var n in this)if(n.charCodeAt(0)===oa)return!1;return!0}function h(){}function g(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function p(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.substring(1);for(var e=0,r=aa.length;r>e;++e){var u=aa[e]+t;if(u in n)return u}}function v(){}function d(){}function m(n){function t(){for(var t,r=e,u=-1,i=r.length;++ue;e++)for(var u,i=n[e],o=0,a=i.length;a>o;o++)(u=i[o])&&t(u,o,e);return n}function U(n){return sa(n,da),n}function j(n){var t,e;return function(r,u,i){var o,a=n[i].update,c=a.length;for(i!=e&&(e=i,t=0),u>=t&&(t=u+1);!(o=a[t])&&++t0&&(n=n.substring(0,a));var s=ya.get(n);return s&&(n=s,c=Y),a?t?u:r:t?v:i}function O(n,t){return function(e){var r=Zo.event;Zo.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{Zo.event=r}}}function Y(n,t){var e=O(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function I(){var n=".dragsuppress-"+ ++Ma,t="click"+n,e=Zo.select(Wo).on("touchmove"+n,y).on("dragstart"+n,y).on("selectstart"+n,y);if(xa){var r=Bo.style,u=r[xa];r[xa]="none"}return function(i){function o(){e.on(t,null)}e.on(n,null),xa&&(r[xa]=u),i&&(e.on(t,function(){y(),o()},!0),setTimeout(o,0))}}function Z(n,t){t.changedTouches&&(t=t.changedTouches[0]);var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();if(0>_a&&(Wo.scrollX||Wo.scrollY)){e=Zo.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var u=e[0][0].getScreenCTM();_a=!(u.f||u.e),e.remove()}return _a?(r.x=t.pageX,r.y=t.pageY):(r.x=t.clientX,r.y=t.clientY),r=r.matrixTransform(n.getScreenCTM().inverse()),[r.x,r.y]}var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}function V(){return Zo.event.changedTouches[0].identifier}function X(){return Zo.event.target}function $(){return Wo}function B(n){return n>0?1:0>n?-1:0}function W(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function J(n){return n>1?0:-1>n?ba:Math.acos(n)}function G(n){return n>1?Sa:-1>n?-Sa:Math.asin(n)}function K(n){return((n=Math.exp(n))-1/n)/2}function Q(n){return((n=Math.exp(n))+1/n)/2}function nt(n){return((n=Math.exp(2*n))-1)/(n+1)}function tt(n){return(n=Math.sin(n/2))*n}function et(){}function rt(n,t,e){return this instanceof rt?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof rt?new rt(n.h,n.s,n.l):mt(""+n,yt,rt):new rt(n,t,e)}function ut(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?i+(o-i)*n/60:180>n?o:240>n?i+(o-i)*(240-n)/60:i}function u(n){return Math.round(255*r(n))}var i,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,o=.5>=e?e*(1+t):e+t-e*t,i=2*e-o,new gt(u(n+120),u(n),u(n-120))}function it(n,t,e){return this instanceof it?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof it?new it(n.h,n.c,n.l):n instanceof at?st(n.l,n.a,n.b):st((n=xt((n=Zo.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new it(n,t,e)}function ot(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new at(e,Math.cos(n*=Aa)*t,Math.sin(n)*t)}function at(n,t,e){return this instanceof at?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof at?new at(n.l,n.a,n.b):n instanceof it?ot(n.l,n.c,n.h):xt((n=gt(n)).r,n.g,n.b):new at(n,t,e)}function ct(n,t,e){var r=(n+16)/116,u=r+t/500,i=r-e/200;return u=lt(u)*ja,r=lt(r)*Ha,i=lt(i)*Fa,new gt(ht(3.2404542*u-1.5371385*r-.4985314*i),ht(-.969266*u+1.8760108*r+.041556*i),ht(.0556434*u-.2040259*r+1.0572252*i))}function st(n,t,e){return n>0?new it(Math.atan2(e,t)*Ca,Math.sqrt(t*t+e*e),n):new it(0/0,0/0,n)}function lt(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function ft(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function ht(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function gt(n,t,e){return this instanceof gt?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof gt?new gt(n.r,n.g,n.b):mt(""+n,gt,ut):new gt(n,t,e)}function pt(n){return new gt(n>>16,255&n>>8,255&n)}function vt(n){return pt(n)+""}function dt(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function mt(n,t,e){var r,u,i,o=0,a=0,c=0;if(r=/([a-z]+)\((.*)\)/i.exec(n))switch(u=r[2].split(","),r[1]){case"hsl":return e(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(_t(u[0]),_t(u[1]),_t(u[2]))}return(i=Ia.get(n))?t(i.r,i.g,i.b):(null==n||"#"!==n.charAt(0)||isNaN(i=parseInt(n.substring(1),16))||(4===n.length?(o=(3840&i)>>4,o=o>>4|o,a=240&i,a=a>>4|a,c=15&i,c=c<<4|c):7===n.length&&(o=(16711680&i)>>16,a=(65280&i)>>8,c=255&i)),t(o,a,c))}function yt(n,t,e){var r,u,i=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-i,c=(o+i)/2;return a?(u=.5>c?a/(o+i):a/(2-o-i),r=n==o?(t-e)/a+(e>t?6:0):t==o?(e-n)/a+2:(n-t)/a+4,r*=60):(r=0/0,u=c>0&&1>c?0:r),new rt(r,u,c)}function xt(n,t,e){n=Mt(n),t=Mt(t),e=Mt(e);var r=ft((.4124564*n+.3575761*t+.1804375*e)/ja),u=ft((.2126729*n+.7151522*t+.072175*e)/Ha),i=ft((.0193339*n+.119192*t+.9503041*e)/Fa);return at(116*u-16,500*(r-u),200*(u-i))}function Mt(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function _t(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function bt(n){return"function"==typeof n?n:function(){return n}}function wt(n){return n}function St(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),kt(t,e,n,r)}}function kt(n,t,e,r){function u(){var n,t=c.status;if(!t&&c.responseText||t>=200&&300>t||304===t){try{n=e.call(i,c)}catch(r){return o.error.call(i,r),void 0}o.load.call(i,n)}else o.error.call(i,c)}var i={},o=Zo.dispatch("beforesend","progress","load","error"),a={},c=new XMLHttpRequest,s=null;return!Wo.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(n)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=u:c.onreadystatechange=function(){c.readyState>3&&u()},c.onprogress=function(n){var t=Zo.event;Zo.event=n;try{o.progress.call(i,c)}finally{Zo.event=t}},i.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?a[n]:(null==t?delete a[n]:a[n]=t+"",i)},i.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",i):t},i.responseType=function(n){return arguments.length?(s=n,i):s},i.response=function(n){return e=n,i},["get","post"].forEach(function(n){i[n]=function(){return i.send.apply(i,[n].concat(Xo(arguments)))}}),i.send=function(e,r,u){if(2===arguments.length&&"function"==typeof r&&(u=r,r=null),c.open(e,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),c.setRequestHeader)for(var l in a)c.setRequestHeader(l,a[l]);return null!=t&&c.overrideMimeType&&c.overrideMimeType(t),null!=s&&(c.responseType=s),null!=u&&i.on("error",u).on("load",function(n){u(null,n)}),o.beforesend.call(i,c),c.send(null==r?null:r),i},i.abort=function(){return c.abort(),i},Zo.rebind(i,o,"on"),null==r?i:i.get(Et(r))}function Et(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function At(){var n=Ct(),t=Nt()-n;t>24?(isFinite(t)&&(clearTimeout($a),$a=setTimeout(At,t)),Xa=0):(Xa=1,Wa(At))}function Ct(){var n=Date.now();for(Ba=Za;Ba;)n>=Ba.t&&(Ba.f=Ba.c(n-Ba.t)),Ba=Ba.n;return n}function Nt(){for(var n,t=Za,e=1/0;t;)t.f?t=n?n.n=t.n:Za=t.n:(t.t8?function(n){return n/e}:function(n){return n*e},symbol:n}}function Tt(n){var t=n.decimal,e=n.thousands,r=n.grouping,u=n.currency,i=r?function(n){for(var t=n.length,u=[],i=0,o=r[0];t>0&&o>0;)u.push(n.substring(t-=o,t+o)),o=r[i=(i+1)%r.length];return u.reverse().join(e)}:wt;return function(n){var e=Ga.exec(n),r=e[1]||" ",o=e[2]||">",a=e[3]||"",c=e[4]||"",s=e[5],l=+e[6],f=e[7],h=e[8],g=e[9],p=1,v="",d="",m=!1;switch(h&&(h=+h.substring(1)),(s||"0"===r&&"="===o)&&(s=r="0",o="=",f&&(l-=Math.floor((l-1)/4))),g){case"n":f=!0,g="g";break;case"%":p=100,d="%",g="f";break;case"p":p=100,d="%",g="r";break;case"b":case"o":case"x":case"X":"#"===c&&(v="0"+g.toLowerCase());case"c":case"d":m=!0,h=0;break;case"s":p=-1,g="r"}"$"===c&&(v=u[0],d=u[1]),"r"!=g||h||(g="g"),null!=h&&("g"==g?h=Math.max(1,Math.min(21,h)):("e"==g||"f"==g)&&(h=Math.max(0,Math.min(20,h)))),g=Ka.get(g)||qt;var y=s&&f;return function(n){var e=d;if(m&&n%1)return"";var u=0>n||0===n&&0>1/n?(n=-n,"-"):a;if(0>p){var c=Zo.formatPrefix(n,h);n=c.scale(n),e=c.symbol+d}else n*=p;n=g(n,h);var x=n.lastIndexOf("."),M=0>x?n:n.substring(0,x),_=0>x?"":t+n.substring(x+1);!s&&f&&(M=i(M));var b=v.length+M.length+_.length+(y?0:u.length),w=l>b?new Array(b=l-b+1).join(r):"";return y&&(M=i(w+M)),u+=v,n=M+_,("<"===o?u+n+w:">"===o?w+u+n:"^"===o?w.substring(0,b>>=1)+u+n+w.substring(b):u+(y?n:w+n))+e}}}function qt(n){return n+""}function Rt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Dt(n,t,e){function r(t){var e=n(t),r=i(e,1);return r-t>t-e?e:r}function u(e){return t(e=n(new nc(e-1)),1),e}function i(n,e){return t(n=new nc(+n),e),n}function o(n,r,i){var o=u(n),a=[];if(i>1)for(;r>o;)e(o)%i||a.push(new Date(+o)),t(o,1);else for(;r>o;)a.push(new Date(+o)),t(o,1);return a}function a(n,t,e){try{nc=Rt;var r=new Rt;return r._=n,o(r,t,e)}finally{nc=Date}}n.floor=n,n.round=r,n.ceil=u,n.offset=i,n.range=o;var c=n.utc=Pt(n);return c.floor=c,c.round=Pt(r),c.ceil=Pt(u),c.offset=Pt(i),c.range=a,n}function Pt(n){return function(t,e){try{nc=Rt;var r=new Rt;return r._=t,n(r,e)._}finally{nc=Date}}}function Ut(n){function t(n){function t(t){for(var e,u,i,o=[],a=-1,c=0;++aa;){if(r>=s)return-1;if(u=t.charCodeAt(a++),37===u){if(o=t.charAt(a++),i=N[o in ec?t.charAt(a++):o],!i||(r=i(n,e,r))<0)return-1}else if(u!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){b.lastIndex=0;var r=b.exec(t.substring(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){M.lastIndex=0;var r=M.exec(t.substring(e));return r?(n.w=_.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){E.lastIndex=0;var r=E.exec(t.substring(e));return r?(n.m=A.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,e){S.lastIndex=0;var r=S.exec(t.substring(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,r){return e(n,C.c.toString(),t,r)}function c(n,t,r){return e(n,C.x.toString(),t,r)}function s(n,t,r){return e(n,C.X.toString(),t,r)}function l(n,t,e){var r=x.get(t.substring(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var f=n.dateTime,h=n.date,g=n.time,p=n.periods,v=n.days,d=n.shortDays,m=n.months,y=n.shortMonths;t.utc=function(n){function e(n){try{nc=Rt;var t=new nc;return t._=n,r(t)}finally{nc=Date}}var r=t(n);return e.parse=function(n){try{nc=Rt;var t=r.parse(n);return t&&t._}finally{nc=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=re;var x=Zo.map(),M=Ht(v),_=Ft(v),b=Ht(d),w=Ft(d),S=Ht(m),k=Ft(m),E=Ht(y),A=Ft(y);p.forEach(function(n,t){x.set(n.toLowerCase(),t)});var C={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return y[n.getMonth()]},B:function(n){return m[n.getMonth()]},c:t(f),d:function(n,t){return jt(n.getDate(),t,2)},e:function(n,t){return jt(n.getDate(),t,2)},H:function(n,t){return jt(n.getHours(),t,2)},I:function(n,t){return jt(n.getHours()%12||12,t,2)},j:function(n,t){return jt(1+Qa.dayOfYear(n),t,3)},L:function(n,t){return jt(n.getMilliseconds(),t,3)},m:function(n,t){return jt(n.getMonth()+1,t,2)},M:function(n,t){return jt(n.getMinutes(),t,2)},p:function(n){return p[+(n.getHours()>=12)]},S:function(n,t){return jt(n.getSeconds(),t,2)},U:function(n,t){return jt(Qa.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return jt(Qa.mondayOfYear(n),t,2)},x:t(h),X:t(g),y:function(n,t){return jt(n.getFullYear()%100,t,2)},Y:function(n,t){return jt(n.getFullYear()%1e4,t,4)},Z:te,"%":function(){return"%"}},N={a:r,A:u,b:i,B:o,c:a,d:Wt,e:Wt,H:Gt,I:Gt,j:Jt,L:ne,m:Bt,M:Kt,p:l,S:Qt,U:Yt,w:Ot,W:It,x:c,X:s,y:Vt,Y:Zt,Z:Xt,"%":ee};return t}function jt(n,t,e){var r=0>n?"-":"",u=(r?-n:n)+"",i=u.length;return r+(e>i?new Array(e-i+1).join(t)+u:u)}function Ht(n){return new RegExp("^(?:"+n.map(Zo.requote).join("|")+")","i")}function Ft(n){for(var t=new o,e=-1,r=n.length;++e68?1900:2e3)}function Bt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function Wt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function Jt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function Gt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function Kt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function Qt(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function ne(n,t,e){rc.lastIndex=0;var r=rc.exec(t.substring(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function te(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=~~(ua(t)/60),u=ua(t)%60;return e+jt(r,"0",2)+jt(u,"0",2)}function ee(n,t,e){uc.lastIndex=0;var r=uc.exec(t.substring(e,e+1));return r?e+r[0].length:-1}function re(n){for(var t=n.length,e=-1;++e=0?1:-1,a=o*e,c=Math.cos(t),s=Math.sin(t),l=i*s,f=u*c+l*Math.cos(a),h=l*o*Math.sin(a);lc.add(Math.atan2(h,f)),r=n,u=c,i=s}var t,e,r,u,i;fc.point=function(o,a){fc.point=n,r=(t=o)*Aa,u=Math.cos(a=(e=a)*Aa/2+ba/4),i=Math.sin(a)},fc.lineEnd=function(){n(t,e)}}function le(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function fe(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function he(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function ge(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function pe(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function ve(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function de(n){return[Math.atan2(n[1],n[0]),G(n[2])]}function me(n,t){return ua(n[0]-t[0])a;++a)u.point((e=n[a])[0],e[1]);return u.lineEnd(),void 0}var c=new Ee(e,n,null,!0),s=new Ee(e,null,c,!1);c.o=s,i.push(c),o.push(s),c=new Ee(r,n,null,!1),s=new Ee(r,null,c,!0),c.o=s,i.push(c),o.push(s)}}),o.sort(t),ke(i),ke(o),i.length){for(var a=0,c=e,s=o.length;s>a;++a)o[a].e=c=!c;for(var l,f,h=i[0];;){for(var g=h,p=!0;g.v;)if((g=g.n)===h)return;l=g.z,u.lineStart();do{if(g.v=g.o.v=!0,g.e){if(p)for(var a=0,s=l.length;s>a;++a)u.point((f=l[a])[0],f[1]);else r(g.x,g.n.x,1,u);g=g.n}else{if(p){l=g.p.z;for(var a=l.length-1;a>=0;--a)u.point((f=l[a])[0],f[1])}else r(g.x,g.p.x,-1,u);g=g.p}g=g.o,l=g.z,p=!p}while(!g.v);u.lineEnd()}}}function ke(n){if(t=n.length){for(var t,e,r=0,u=n[0];++r0){for(_||(i.polygonStart(),_=!0),i.lineStart();++o1&&2&t&&e.push(e.pop().concat(e.shift())),g.push(e.filter(Ce))}var g,p,v,d=t(i),m=u.invert(r[0],r[1]),y={point:o,lineStart:c,lineEnd:s,polygonStart:function(){y.point=l,y.lineStart=f,y.lineEnd=h,g=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=c,y.lineEnd=s,g=Zo.merge(g);var n=Le(m,p);g.length?(_||(i.polygonStart(),_=!0),Se(g,ze,n,e,i)):n&&(_||(i.polygonStart(),_=!0),i.lineStart(),e(null,null,1,i),i.lineEnd()),_&&(i.polygonEnd(),_=!1),g=p=null},sphere:function(){i.polygonStart(),i.lineStart(),e(null,null,1,i),i.lineEnd(),i.polygonEnd()}},x=Ne(),M=t(x),_=!1;return y}}function Ce(n){return n.length>1}function Ne(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:v,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function ze(n,t){return((n=n.x)[0]<0?n[1]-Sa-ka:Sa-n[1])-((t=t.x)[0]<0?t[1]-Sa-ka:Sa-t[1])}function Le(n,t){var e=n[0],r=n[1],u=[Math.sin(e),-Math.cos(e),0],i=0,o=0;lc.reset();for(var a=0,c=t.length;c>a;++a){var s=t[a],l=s.length;if(l)for(var f=s[0],h=f[0],g=f[1]/2+ba/4,p=Math.sin(g),v=Math.cos(g),d=1;;){d===l&&(d=0),n=s[d];var m=n[0],y=n[1]/2+ba/4,x=Math.sin(y),M=Math.cos(y),_=m-h,b=_>=0?1:-1,w=b*_,S=w>ba,k=p*x;if(lc.add(Math.atan2(k*b*Math.sin(w),v*M+k*Math.cos(w))),i+=S?_+b*wa:_,S^h>=e^m>=e){var E=he(le(f),le(n));ve(E);var A=he(u,E);ve(A);var C=(S^_>=0?-1:1)*G(A[2]);(r>C||r===C&&(E[0]||E[1]))&&(o+=S^_>=0?1:-1)}if(!d++)break;h=m,p=x,v=M,f=n}}return(-ka>i||ka>i&&0>lc)^1&o}function Te(n){var t,e=0/0,r=0/0,u=0/0;return{lineStart:function(){n.lineStart(),t=1},point:function(i,o){var a=i>0?ba:-ba,c=ua(i-e);ua(c-ba)0?Sa:-Sa),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(i,r),t=0):u!==a&&c>=ba&&(ua(e-u)ka?Math.atan((Math.sin(t)*(i=Math.cos(r))*Math.sin(e)-Math.sin(r)*(u=Math.cos(t))*Math.sin(n))/(u*i*o)):(t+r)/2}function Re(n,t,e,r){var u;if(null==n)u=e*Sa,r.point(-ba,u),r.point(0,u),r.point(ba,u),r.point(ba,0),r.point(ba,-u),r.point(0,-u),r.point(-ba,-u),r.point(-ba,0),r.point(-ba,u);else if(ua(n[0]-t[0])>ka){var i=n[0]i}function e(n){var e,i,c,s,l;return{lineStart:function(){s=c=!1,l=1},point:function(f,h){var g,p=[f,h],v=t(f,h),d=o?v?0:u(f,h):v?u(f+(0>f?ba:-ba),h):0;if(!e&&(s=c=v)&&n.lineStart(),v!==c&&(g=r(e,p),(me(e,g)||me(p,g))&&(p[0]+=ka,p[1]+=ka,v=t(p[0],p[1]))),v!==c)l=0,v?(n.lineStart(),g=r(p,e),n.point(g[0],g[1])):(g=r(e,p),n.point(g[0],g[1]),n.lineEnd()),e=g;else if(a&&e&&o^v){var m;d&i||!(m=r(p,e,!0))||(l=0,o?(n.lineStart(),n.point(m[0][0],m[0][1]),n.point(m[1][0],m[1][1]),n.lineEnd()):(n.point(m[1][0],m[1][1]),n.lineEnd(),n.lineStart(),n.point(m[0][0],m[0][1])))}!v||e&&me(e,p)||n.point(p[0],p[1]),e=p,c=v,i=d},lineEnd:function(){c&&n.lineEnd(),e=null},clean:function(){return l|(s&&c)<<1}}}function r(n,t,e){var r=le(n),u=le(t),o=[1,0,0],a=he(r,u),c=fe(a,a),s=a[0],l=c-s*s;if(!l)return!e&&n;var f=i*c/l,h=-i*s/l,g=he(o,a),p=pe(o,f),v=pe(a,h);ge(p,v);var d=g,m=fe(p,d),y=fe(d,d),x=m*m-y*(fe(p,p)-1);if(!(0>x)){var M=Math.sqrt(x),_=pe(d,(-m-M)/y);if(ge(_,p),_=de(_),!e)return _;var b,w=n[0],S=t[0],k=n[1],E=t[1];w>S&&(b=w,w=S,S=b);var A=S-w,C=ua(A-ba)A;if(!C&&k>E&&(b=k,k=E,E=b),N?C?k+E>0^_[1]<(ua(_[0]-w)ba^(w<=_[0]&&_[0]<=S)){var z=pe(d,(-m+M)/y);return ge(z,p),[_,de(z)]}}}function u(t,e){var r=o?n:ba-n,u=0;return-r>t?u|=1:t>r&&(u|=2),-r>e?u|=4:e>r&&(u|=8),u}var i=Math.cos(n),o=i>0,a=ua(i)>ka,c=sr(n,6*Aa);return Ae(t,e,c,o?[0,-n]:[-ba,n-ba])}function Pe(n,t,e,r){return function(u){var i,o=u.a,a=u.b,c=o.x,s=o.y,l=a.x,f=a.y,h=0,g=1,p=l-c,v=f-s;if(i=n-c,p||!(i>0)){if(i/=p,0>p){if(h>i)return;g>i&&(g=i)}else if(p>0){if(i>g)return;i>h&&(h=i)}if(i=e-c,p||!(0>i)){if(i/=p,0>p){if(i>g)return;i>h&&(h=i)}else if(p>0){if(h>i)return;g>i&&(g=i)}if(i=t-s,v||!(i>0)){if(i/=v,0>v){if(h>i)return;g>i&&(g=i)}else if(v>0){if(i>g)return;i>h&&(h=i)}if(i=r-s,v||!(0>i)){if(i/=v,0>v){if(i>g)return;i>h&&(h=i)}else if(v>0){if(h>i)return;g>i&&(g=i)}return h>0&&(u.a={x:c+h*p,y:s+h*v}),1>g&&(u.b={x:c+g*p,y:s+g*v}),u}}}}}}function Ue(n,t,e,r){function u(r,u){return ua(r[0]-n)0?0:3:ua(r[0]-e)0?2:1:ua(r[1]-t)0?1:0:u>0?3:2}function i(n,t){return o(n.x,t.x)}function o(n,t){var e=u(n,1),r=u(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(a){function c(n){for(var t=0,e=d.length,r=n[1],u=0;e>u;++u)for(var i,o=1,a=d[u],c=a.length,s=a[0];c>o;++o)i=a[o],s[1]<=r?i[1]>r&&W(s,i,n)>0&&++t:i[1]<=r&&W(s,i,n)<0&&--t,s=i;return 0!==t}function s(i,a,c,s){var l=0,f=0;if(null==i||(l=u(i,c))!==(f=u(a,c))||o(i,a)<0^c>0){do s.point(0===l||3===l?n:e,l>1?r:t);while((l=(l+c+4)%4)!==f)}else s.point(a[0],a[1])}function l(u,i){return u>=n&&e>=u&&i>=t&&r>=i}function f(n,t){l(n,t)&&a.point(n,t)}function h(){N.point=p,d&&d.push(m=[]),S=!0,w=!1,_=b=0/0}function g(){v&&(p(y,x),M&&w&&A.rejoin(),v.push(A.buffer())),N.point=f,w&&a.lineEnd()}function p(n,t){n=Math.max(-kc,Math.min(kc,n)),t=Math.max(-kc,Math.min(kc,t));var e=l(n,t);if(d&&m.push([n,t]),S)y=n,x=t,M=e,S=!1,e&&(a.lineStart(),a.point(n,t));else if(e&&w)a.point(n,t);else{var r={a:{x:_,y:b},b:{x:n,y:t}};C(r)?(w||(a.lineStart(),a.point(r.a.x,r.a.y)),a.point(r.b.x,r.b.y),e||a.lineEnd(),k=!1):e&&(a.lineStart(),a.point(n,t),k=!1)}_=n,b=t,w=e}var v,d,m,y,x,M,_,b,w,S,k,E=a,A=Ne(),C=Pe(n,t,e,r),N={point:f,lineStart:h,lineEnd:g,polygonStart:function(){a=A,v=[],d=[],k=!0},polygonEnd:function(){a=E,v=Zo.merge(v);var t=c([n,r]),e=k&&t,u=v.length;(e||u)&&(a.polygonStart(),e&&(a.lineStart(),s(null,null,1,a),a.lineEnd()),u&&Se(v,i,t,s,a),a.polygonEnd()),v=d=m=null}};return N}}function je(n,t){function e(e,r){return e=n(e,r),t(e[0],e[1])}return n.invert&&t.invert&&(e.invert=function(e,r){return e=t.invert(e,r),e&&n.invert(e[0],e[1])}),e}function He(n){var t=0,e=ba/3,r=tr(n),u=r(t,e);return u.parallels=function(n){return arguments.length?r(t=n[0]*ba/180,e=n[1]*ba/180):[180*(t/ba),180*(e/ba)]},u}function Fe(n,t){function e(n,t){var e=Math.sqrt(i-2*u*Math.sin(t))/u;return[e*Math.sin(n*=u),o-e*Math.cos(n)]}var r=Math.sin(n),u=(r+Math.sin(t))/2,i=1+r*(2*u-r),o=Math.sqrt(i)/u;return e.invert=function(n,t){var e=o-t;return[Math.atan2(n,e)/u,G((i-(n*n+e*e)*u*u)/(2*u))]},e}function Oe(){function n(n,t){Ac+=u*n-r*t,r=n,u=t}var t,e,r,u;Tc.point=function(i,o){Tc.point=n,t=r=i,e=u=o},Tc.lineEnd=function(){n(t,e)}}function Ye(n,t){Cc>n&&(Cc=n),n>zc&&(zc=n),Nc>t&&(Nc=t),t>Lc&&(Lc=t)}function Ie(){function n(n,t){o.push("M",n,",",t,i)}function t(n,t){o.push("M",n,",",t),a.point=e}function e(n,t){o.push("L",n,",",t)}function r(){a.point=n}function u(){o.push("Z")}var i=Ze(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:r,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=r,a.point=n},pointRadius:function(n){return i=Ze(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function Ze(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function Ve(n,t){pc+=n,vc+=t,++dc}function Xe(){function n(n,r){var u=n-t,i=r-e,o=Math.sqrt(u*u+i*i);mc+=o*(t+n)/2,yc+=o*(e+r)/2,xc+=o,Ve(t=n,e=r)}var t,e;Rc.point=function(r,u){Rc.point=n,Ve(t=r,e=u)}}function $e(){Rc.point=Ve}function Be(){function n(n,t){var e=n-r,i=t-u,o=Math.sqrt(e*e+i*i);mc+=o*(r+n)/2,yc+=o*(u+t)/2,xc+=o,o=u*n-r*t,Mc+=o*(r+n),_c+=o*(u+t),bc+=3*o,Ve(r=n,u=t)}var t,e,r,u;Rc.point=function(i,o){Rc.point=n,Ve(t=r=i,e=u=o)},Rc.lineEnd=function(){n(t,e)}}function We(n){function t(t,e){n.moveTo(t,e),n.arc(t,e,o,0,wa)}function e(t,e){n.moveTo(t,e),a.point=r}function r(t,e){n.lineTo(t,e)}function u(){a.point=t}function i(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=e},lineEnd:u,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=u,a.point=t},pointRadius:function(n){return o=n,a},result:v};return a}function Je(n){function t(n){return(a?r:e)(n)}function e(t){return Qe(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){x=0/0,S.point=i,t.lineStart()}function i(e,r){var i=le([e,r]),o=n(e,r);u(x,M,y,_,b,w,x=o[0],M=o[1],y=e,_=i[0],b=i[1],w=i[2],a,t),t.point(x,M)}function o(){S.point=e,t.lineEnd()}function c(){r(),S.point=s,S.lineEnd=l}function s(n,t){i(f=n,h=t),g=x,p=M,v=_,d=b,m=w,S.point=i}function l(){u(x,M,y,_,b,w,g,p,f,v,d,m,a,t),S.lineEnd=o,o()}var f,h,g,p,v,d,m,y,x,M,_,b,w,S={point:e,lineStart:r,lineEnd:o,polygonStart:function(){t.polygonStart(),S.lineStart=c},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function u(t,e,r,a,c,s,l,f,h,g,p,v,d,m){var y=l-t,x=f-e,M=y*y+x*x;if(M>4*i&&d--){var _=a+g,b=c+p,w=s+v,S=Math.sqrt(_*_+b*b+w*w),k=Math.asin(w/=S),E=ua(ua(w)-1)i||ua((y*z+x*L)/M-.5)>.3||o>a*g+c*p+s*v)&&(u(t,e,r,a,c,s,C,N,E,_/=S,b/=S,w,d,m),m.point(C,N),u(C,N,E,_,b,w,l,f,h,g,p,v,d,m))}}var i=.5,o=Math.cos(30*Aa),a=16;
-return t.precision=function(n){return arguments.length?(a=(i=n*n)>0&&16,t):Math.sqrt(i)},t}function Ge(n){var t=Je(function(t,e){return n([t*Ca,e*Ca])});return function(n){return er(t(n))}}function Ke(n){this.stream=n}function Qe(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function nr(n){return tr(function(){return n})()}function tr(n){function t(n){return n=a(n[0]*Aa,n[1]*Aa),[n[0]*h+c,s-n[1]*h]}function e(n){return n=a.invert((n[0]-c)/h,(s-n[1])/h),n&&[n[0]*Ca,n[1]*Ca]}function r(){a=je(o=ir(m,y,x),i);var n=i(v,d);return c=g-n[0]*h,s=p+n[1]*h,u()}function u(){return l&&(l.valid=!1,l=null),t}var i,o,a,c,s,l,f=Je(function(n,t){return n=i(n,t),[n[0]*h+c,s-n[1]*h]}),h=150,g=480,p=250,v=0,d=0,m=0,y=0,x=0,M=Sc,_=wt,b=null,w=null;return t.stream=function(n){return l&&(l.valid=!1),l=er(M(o,f(_(n)))),l.valid=!0,l},t.clipAngle=function(n){return arguments.length?(M=null==n?(b=n,Sc):De((b=+n)*Aa),u()):b},t.clipExtent=function(n){return arguments.length?(w=n,_=n?Ue(n[0][0],n[0][1],n[1][0],n[1][1]):wt,u()):w},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(g=+n[0],p=+n[1],r()):[g,p]},t.center=function(n){return arguments.length?(v=n[0]%360*Aa,d=n[1]%360*Aa,r()):[v*Ca,d*Ca]},t.rotate=function(n){return arguments.length?(m=n[0]%360*Aa,y=n[1]%360*Aa,x=n.length>2?n[2]%360*Aa:0,r()):[m*Ca,y*Ca,x*Ca]},Zo.rebind(t,f,"precision"),function(){return i=n.apply(this,arguments),t.invert=i.invert&&e,r()}}function er(n){return Qe(n,function(t,e){n.point(t*Aa,e*Aa)})}function rr(n,t){return[n,t]}function ur(n,t){return[n>ba?n-wa:-ba>n?n+wa:n,t]}function ir(n,t,e){return n?t||e?je(ar(n),cr(t,e)):ar(n):t||e?cr(t,e):ur}function or(n){return function(t,e){return t+=n,[t>ba?t-wa:-ba>t?t+wa:t,e]}}function ar(n){var t=or(n);return t.invert=or(-n),t}function cr(n,t){function e(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,s=Math.sin(t),l=s*r+a*u;return[Math.atan2(c*i-l*o,a*r-s*u),G(l*i+c*o)]}var r=Math.cos(n),u=Math.sin(n),i=Math.cos(t),o=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,s=Math.sin(t),l=s*i-c*o;return[Math.atan2(c*i+s*o,a*r+l*u),G(l*r-a*u)]},e}function sr(n,t){var e=Math.cos(n),r=Math.sin(n);return function(u,i,o,a){var c=o*t;null!=u?(u=lr(e,u),i=lr(e,i),(o>0?i>u:u>i)&&(u+=o*wa)):(u=n+o*wa,i=n-.5*c);for(var s,l=u;o>0?l>i:i>l;l-=c)a.point((s=de([e,-r*Math.cos(l),-r*Math.sin(l)]))[0],s[1])}}function lr(n,t){var e=le(t);e[0]-=n,ve(e);var r=J(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-ka)%(2*Math.PI)}function fr(n,t,e){var r=Zo.range(n,t-ka,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function hr(n,t,e){var r=Zo.range(n,t-ka,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function gr(n){return n.source}function pr(n){return n.target}function vr(n,t,e,r){var u=Math.cos(t),i=Math.sin(t),o=Math.cos(r),a=Math.sin(r),c=u*Math.cos(n),s=u*Math.sin(n),l=o*Math.cos(e),f=o*Math.sin(e),h=2*Math.asin(Math.sqrt(tt(r-t)+u*o*tt(e-n))),g=1/Math.sin(h),p=h?function(n){var t=Math.sin(n*=h)*g,e=Math.sin(h-n)*g,r=e*c+t*l,u=e*s+t*f,o=e*i+t*a;return[Math.atan2(u,r)*Ca,Math.atan2(o,Math.sqrt(r*r+u*u))*Ca]}:function(){return[n*Ca,t*Ca]};return p.distance=h,p}function dr(){function n(n,u){var i=Math.sin(u*=Aa),o=Math.cos(u),a=ua((n*=Aa)-t),c=Math.cos(a);Dc+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=r*i-e*o*c)*a),e*i+r*o*c),t=n,e=i,r=o}var t,e,r;Pc.point=function(u,i){t=u*Aa,e=Math.sin(i*=Aa),r=Math.cos(i),Pc.point=n},Pc.lineEnd=function(){Pc.point=Pc.lineEnd=v}}function mr(n,t){function e(t,e){var r=Math.cos(t),u=Math.cos(e),i=n(r*u);return[i*u*Math.sin(t),i*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),u=t(r),i=Math.sin(u),o=Math.cos(u);return[Math.atan2(n*i,r*o),Math.asin(r&&e*i/r)]},e}function yr(n,t){function e(n,t){o>0?-Sa+ka>t&&(t=-Sa+ka):t>Sa-ka&&(t=Sa-ka);var e=o/Math.pow(u(t),i);return[e*Math.sin(i*n),o-e*Math.cos(i*n)]}var r=Math.cos(n),u=function(n){return Math.tan(ba/4+n/2)},i=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(u(t)/u(n)),o=r*Math.pow(u(n),i)/i;return i?(e.invert=function(n,t){var e=o-t,r=B(i)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/i,2*Math.atan(Math.pow(o/r,1/i))-Sa]},e):Mr}function xr(n,t){function e(n,t){var e=i-t;return[e*Math.sin(u*n),i-e*Math.cos(u*n)]}var r=Math.cos(n),u=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),i=r/u+n;return ua(u)u;u++){for(;r>1&&W(n[e[r-2]],n[e[r-1]],n[u])<=0;)--r;e[r++]=u}return e.slice(0,r)}function Er(n,t){return n[0]-t[0]||n[1]-t[1]}function Ar(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Cr(n,t,e,r){var u=n[0],i=e[0],o=t[0]-u,a=r[0]-i,c=n[1],s=e[1],l=t[1]-c,f=r[1]-s,h=(a*(c-s)-f*(u-i))/(f*o-a*l);return[u+h*o,c+h*l]}function Nr(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function zr(){Gr(this),this.edge=this.site=this.circle=null}function Lr(n){var t=Bc.pop()||new zr;return t.site=n,t}function Tr(n){Yr(n),Vc.remove(n),Bc.push(n),Gr(n)}function qr(n){var t=n.circle,e=t.x,r=t.cy,u={x:e,y:r},i=n.P,o=n.N,a=[n];Tr(n);for(var c=i;c.circle&&ua(e-c.circle.x)l;++l)s=a[l],c=a[l-1],Br(s.edge,c.site,s.site,u);c=a[0],s=a[f-1],s.edge=Xr(c.site,s.site,null,u),Or(c),Or(s)}function Rr(n){for(var t,e,r,u,i=n.x,o=n.y,a=Vc._;a;)if(r=Dr(a,o)-i,r>ka)a=a.L;else{if(u=i-Pr(a,o),!(u>ka)){r>-ka?(t=a.P,e=a):u>-ka?(t=a,e=a.N):t=e=a;break}if(!a.R){t=a;break}a=a.R}var c=Lr(n);if(Vc.insert(t,c),t||e){if(t===e)return Yr(t),e=Lr(t.site),Vc.insert(c,e),c.edge=e.edge=Xr(t.site,c.site),Or(t),Or(e),void 0;if(!e)return c.edge=Xr(t.site,c.site),void 0;Yr(t),Yr(e);var s=t.site,l=s.x,f=s.y,h=n.x-l,g=n.y-f,p=e.site,v=p.x-l,d=p.y-f,m=2*(h*d-g*v),y=h*h+g*g,x=v*v+d*d,M={x:(d*y-g*x)/m+l,y:(h*x-v*y)/m+f};Br(e.edge,s,p,M),c.edge=Xr(s,n,null,M),e.edge=Xr(n,p,null,M),Or(t),Or(e)}}function Dr(n,t){var e=n.site,r=e.x,u=e.y,i=u-t;if(!i)return r;var o=n.P;if(!o)return-1/0;e=o.site;var a=e.x,c=e.y,s=c-t;if(!s)return a;var l=a-r,f=1/i-1/s,h=l/s;return f?(-h+Math.sqrt(h*h-2*f*(l*l/(-2*s)-c+s/2+u-i/2)))/f+r:(r+a)/2}function Pr(n,t){var e=n.N;if(e)return Dr(e,t);var r=n.site;return r.y===t?r.x:1/0}function Ur(n){this.site=n,this.edges=[]}function jr(n){for(var t,e,r,u,i,o,a,c,s,l,f=n[0][0],h=n[1][0],g=n[0][1],p=n[1][1],v=Zc,d=v.length;d--;)if(i=v[d],i&&i.prepare())for(a=i.edges,c=a.length,o=0;c>o;)l=a[o].end(),r=l.x,u=l.y,s=a[++o%c].start(),t=s.x,e=s.y,(ua(r-t)>ka||ua(u-e)>ka)&&(a.splice(o,0,new Wr($r(i.site,l,ua(r-f)ka?{x:f,y:ua(t-f)ka?{x:ua(e-p)ka?{x:h,y:ua(t-h)ka?{x:ua(e-g)=-Ea)){var g=c*c+s*s,p=l*l+f*f,v=(f*g-s*p)/h,d=(c*p-l*g)/h,f=d+a,m=Wc.pop()||new Fr;m.arc=n,m.site=u,m.x=v+o,m.y=f+Math.sqrt(v*v+d*d),m.cy=f,n.circle=m;for(var y=null,x=$c._;x;)if(m.yd||d>=a)return;if(h>p){if(i){if(i.y>=s)return}else i={x:d,y:c};e={x:d,y:s}}else{if(i){if(i.yr||r>1)if(h>p){if(i){if(i.y>=s)return}else i={x:(c-u)/r,y:c};e={x:(s-u)/r,y:s}}else{if(i){if(i.yg){if(i){if(i.x>=a)return}else i={x:o,y:r*o+u};e={x:a,y:r*a+u}}else{if(i){if(i.xi&&(u=t.substring(i,u),a[o]?a[o]+=u:a[++o]=u),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,c.push({i:o,x:lu(e,r)})),i=Kc.lastIndex;return ir;++r)a[(e=c[r]).i]=e.x(n);return a.join("")})}function hu(n,t){for(var e,r=Zo.interpolators.length;--r>=0&&!(e=Zo.interpolators[r](n,t)););return e}function gu(n,t){var e,r=[],u=[],i=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;a>e;++e)r.push(hu(n[e],t[e]));for(;i>e;++e)u[e]=n[e];for(;o>e;++e)u[e]=t[e];return function(n){for(e=0;a>e;++e)u[e]=r[e](n);return u}}function pu(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function vu(n){return function(t){return 1-n(1-t)}}function du(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function mu(n){return n*n}function yu(n){return n*n*n}function xu(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function Mu(n){return function(t){return Math.pow(t,n)}}function _u(n){return 1-Math.cos(n*Sa)}function bu(n){return Math.pow(2,10*(n-1))}function wu(n){return 1-Math.sqrt(1-n*n)}function Su(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/wa*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*wa/t)}}function ku(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function Eu(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Au(n,t){n=Zo.hcl(n),t=Zo.hcl(t);var e=n.h,r=n.c,u=n.l,i=t.h-e,o=t.c-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.c:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return ot(e+i*n,r+o*n,u+a*n)+""}}function Cu(n,t){n=Zo.hsl(n),t=Zo.hsl(t);var e=n.h,r=n.s,u=n.l,i=t.h-e,o=t.s-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.s:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return ut(e+i*n,r+o*n,u+a*n)+""}}function Nu(n,t){n=Zo.lab(n),t=Zo.lab(t);var e=n.l,r=n.a,u=n.b,i=t.l-e,o=t.a-r,a=t.b-u;return function(n){return ct(e+i*n,r+o*n,u+a*n)+""}}function zu(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function Lu(n){var t=[n.a,n.b],e=[n.c,n.d],r=qu(t),u=Tu(t,e),i=qu(Ru(e,t,-u))||0;t[0]*e[1]180?l+=360:l-s>180&&(s+=360),u.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:lu(s,l)})):l&&r.push(r.pop()+"rotate("+l+")"),f!=h?u.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:lu(f,h)}):h&&r.push(r.pop()+"skewX("+h+")"),g[0]!=p[0]||g[1]!=p[1]?(e=r.push(r.pop()+"scale(",null,",",null,")"),u.push({i:e-4,x:lu(g[0],p[0])},{i:e-2,x:lu(g[1],p[1])})):(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")"),e=u.length,function(n){for(var t,i=-1;++i=0;)e.push(u[r])}function Bu(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(i=n.children)&&(u=i.length))for(var u,i,o=-1;++oe;++e)(t=n[e][1])>u&&(r=e,u=t);return r}function ii(n){return n.reduce(oi,0)}function oi(n,t){return n+t[1]}function ai(n,t){return ci(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function ci(n,t){for(var e=-1,r=+n[0],u=(n[1]-r)/t,i=[];++e<=t;)i[e]=u*e+r;return i}function si(n){return[Zo.min(n),Zo.max(n)]}function li(n,t){return n.value-t.value}function fi(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function hi(n,t){n._pack_next=t,t._pack_prev=n}function gi(n,t){var e=t.x-n.x,r=t.y-n.y,u=n.r+t.r;return.999*u*u>e*e+r*r}function pi(n){function t(n){l=Math.min(n.x-n.r,l),f=Math.max(n.x+n.r,f),h=Math.min(n.y-n.r,h),g=Math.max(n.y+n.r,g)}if((e=n.children)&&(s=e.length)){var e,r,u,i,o,a,c,s,l=1/0,f=-1/0,h=1/0,g=-1/0;if(e.forEach(vi),r=e[0],r.x=-r.r,r.y=0,t(r),s>1&&(u=e[1],u.x=u.r,u.y=0,t(u),s>2))for(i=e[2],yi(r,u,i),t(i),fi(r,i),r._pack_prev=i,fi(i,u),u=r._pack_next,o=3;s>o;o++){yi(r,u,i=e[o]);var p=0,v=1,d=1;for(a=u._pack_next;a!==u;a=a._pack_next,v++)if(gi(a,i)){p=1;break}if(1==p)for(c=r._pack_prev;c!==a._pack_prev&&!gi(c,i);c=c._pack_prev,d++);p?(d>v||v==d&&u.ro;o++)i=e[o],i.x-=m,i.y-=y,x=Math.max(x,i.r+Math.sqrt(i.x*i.x+i.y*i.y));n.r=x,e.forEach(di)}}function vi(n){n._pack_next=n._pack_prev=n}function di(n){delete n._pack_next,delete n._pack_prev}function mi(n,t,e,r){var u=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,u)for(var i=-1,o=u.length;++i=0;)t=u[i],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function Si(n,t,e){return n.a.parent===t.parent?n.a:e}function ki(n){return 1+Zo.max(n,function(n){return n.y})}function Ei(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Ai(n){var t=n.children;return t&&t.length?Ai(t[0]):n}function Ci(n){var t,e=n.children;return e&&(t=e.length)?Ci(e[t-1]):n}function Ni(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function zi(n,t){var e=n.x+t[3],r=n.y+t[0],u=n.dx-t[1]-t[3],i=n.dy-t[0]-t[2];return 0>u&&(e+=u/2,u=0),0>i&&(r+=i/2,i=0),{x:e,y:r,dx:u,dy:i}}function Li(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function Ti(n){return n.rangeExtent?n.rangeExtent():Li(n.range())}function qi(n,t,e,r){var u=e(n[0],n[1]),i=r(t[0],t[1]);return function(n){return i(u(n))}}function Ri(n,t){var e,r=0,u=n.length-1,i=n[r],o=n[u];return i>o&&(e=r,r=u,u=e,e=i,i=o,o=e),n[r]=t.floor(i),n[u]=t.ceil(o),n}function Di(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:ss}function Pi(n,t,e,r){var u=[],i=[],o=0,a=Math.min(n.length,t.length)-1;for(n[a]2?Pi:qi,c=r?Uu:Pu;return o=u(n,t,c,e),a=u(t,n,c,hu),i}function i(n){return o(n)}var o,a;return i.invert=function(n){return a(n)},i.domain=function(t){return arguments.length?(n=t.map(Number),u()):n},i.range=function(n){return arguments.length?(t=n,u()):t},i.rangeRound=function(n){return i.range(n).interpolate(zu)},i.clamp=function(n){return arguments.length?(r=n,u()):r},i.interpolate=function(n){return arguments.length?(e=n,u()):e},i.ticks=function(t){return Oi(n,t)},i.tickFormat=function(t,e){return Yi(n,t,e)},i.nice=function(t){return Hi(n,t),u()},i.copy=function(){return Ui(n,t,e,r)},u()}function ji(n,t){return Zo.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Hi(n,t){return Ri(n,Di(Fi(n,t)[2]))}function Fi(n,t){null==t&&(t=10);var e=Li(n),r=e[1]-e[0],u=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),i=t/r*u;return.15>=i?u*=10:.35>=i?u*=5:.75>=i&&(u*=2),e[0]=Math.ceil(e[0]/u)*u,e[1]=Math.floor(e[1]/u)*u+.5*u,e[2]=u,e}function Oi(n,t){return Zo.range.apply(Zo,Fi(n,t))}function Yi(n,t,e){var r=Fi(n,t);if(e){var u=Ga.exec(e);if(u.shift(),"s"===u[8]){var i=Zo.formatPrefix(Math.max(ua(r[0]),ua(r[1])));return u[7]||(u[7]="."+Ii(i.scale(r[2]))),u[8]="f",e=Zo.format(u.join("")),function(n){return e(i.scale(n))+i.symbol}}u[7]||(u[7]="."+Zi(u[8],r)),e=u.join("")}else e=",."+Ii(r[2])+"f";return Zo.format(e)}function Ii(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function Zi(n,t){var e=Ii(t[2]);return n in ls?Math.abs(e-Ii(Math.max(ua(t[0]),ua(t[1]))))+ +("e"!==n):e-2*("%"===n)}function Vi(n,t,e,r){function u(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function i(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function o(t){return n(u(t))}return o.invert=function(t){return i(n.invert(t))},o.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(u)),o):r},o.base=function(e){return arguments.length?(t=+e,n.domain(r.map(u)),o):t},o.nice=function(){var t=Ri(r.map(u),e?Math:hs);return n.domain(t),r=t.map(i),o},o.ticks=function(){var n=Li(r),o=[],a=n[0],c=n[1],s=Math.floor(u(a)),l=Math.ceil(u(c)),f=t%1?2:t;if(isFinite(l-s)){if(e){for(;l>s;s++)for(var h=1;f>h;h++)o.push(i(s)*h);o.push(i(s))}else for(o.push(i(s));s++0;h--)o.push(i(s)*h);for(s=0;o[s]c;l--);o=o.slice(s,l)}return o},o.tickFormat=function(n,t){if(!arguments.length)return fs;arguments.length<2?t=fs:"function"!=typeof t&&(t=Zo.format(t));var r,a=Math.max(.1,n/o.ticks().length),c=e?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(n){return n/i(c(u(n)+r))<=a?t(n):""}},o.copy=function(){return Vi(n.copy(),t,e,r)},ji(o,n)}function Xi(n,t,e){function r(t){return n(u(t))}var u=$i(t),i=$i(1/t);return r.invert=function(t){return i(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(u)),r):e},r.ticks=function(n){return Oi(e,n)},r.tickFormat=function(n,t){return Yi(e,n,t)},r.nice=function(n){return r.domain(Hi(e,n))},r.exponent=function(o){return arguments.length?(u=$i(t=o),i=$i(1/t),n.domain(e.map(u)),r):t},r.copy=function(){return Xi(n.copy(),t,e)},ji(r,n)}function $i(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function Bi(n,t){function e(e){return i[((u.get(e)||("range"===t.t?u.set(e,n.push(e)):0/0))-1)%i.length]}function r(t,e){return Zo.range(n.length).map(function(n){return t+e*n})}var u,i,a;return e.domain=function(r){if(!arguments.length)return n;n=[],u=new o;for(var i,a=-1,c=r.length;++an?[0/0,0/0]:[n>0?o[n-1]:e[0],nt?0/0:t/i+n,[t,t+1/i]},r.copy=function(){return Ji(n,t,e)},u()}function Gi(n,t){function e(e){return e>=e?t[Zo.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return Gi(n,t)},e}function Ki(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return Oi(n,t)},t.tickFormat=function(t,e){return Yi(n,t,e)},t.copy=function(){return Ki(n)},t}function Qi(n){return n.innerRadius}function no(n){return n.outerRadius}function to(n){return n.startAngle}function eo(n){return n.endAngle}function ro(n){function t(t){function o(){s.push("M",i(n(l),a))}for(var c,s=[],l=[],f=-1,h=t.length,g=bt(e),p=bt(r);++f1&&u.push("H",r[0]),u.join("")}function ao(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t1){a=t[1],i=n[c],c++,r+="C"+(u[0]+o[0])+","+(u[1]+o[1])+","+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1];for(var s=2;s9&&(u=3*t/Math.sqrt(u),o[a]=u*e,o[a+1]=u*r));for(a=-1;++a<=c;)u=(n[Math.min(c,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),i.push([u||0,o[a]*u||0]);return i}function So(n){return n.length<3?uo(n):n[0]+ho(n,wo(n))}function ko(n){for(var t,e,r,u=-1,i=n.length;++ue?s():(u.active=e,i.event&&i.event.start.call(n,l,t),i.tween.forEach(function(e,r){(r=r.call(n,l,t))&&v.push(r)}),Zo.timer(function(){return p.c=c(r||1)?we:c,1},0,a),void 0)}function c(r){if(u.active!==e)return s();for(var o=r/g,a=f(o),c=v.length;c>0;)v[--c].call(n,a);
-return o>=1?(i.event&&i.event.end.call(n,l,t),s()):void 0}function s(){return--u.count?delete u[e]:delete n.__transition__,1}var l=n.__data__,f=i.ease,h=i.delay,g=i.duration,p=Ba,v=[];return p.t=h+a,r>=h?o(r-h):(p.c=o,void 0)},0,a)}}function Uo(n,t){n.attr("transform",function(n){return"translate("+t(n)+",0)"})}function jo(n,t){n.attr("transform",function(n){return"translate(0,"+t(n)+")"})}function Ho(n){return n.toISOString()}function Fo(n,t,e){function r(t){return n(t)}function u(n,e){var r=n[1]-n[0],u=r/e,i=Zo.bisect(Us,u);return i==Us.length?[t.year,Fi(n.map(function(n){return n/31536e6}),e)[2]]:i?t[u/Us[i-1]1?{floor:function(t){for(;e(t=n.floor(t));)t=Oo(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=Oo(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Li(r.domain()),i=null==n?u(e,10):"number"==typeof n?u(e,n):!n.range&&[{range:n},t];return i&&(n=i[0],t=i[1]),n.range(e[0],Oo(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return Fo(n.copy(),t,e)},ji(r,n)}function Oo(n){return new Date(n)}function Yo(n){return JSON.parse(n.responseText)}function Io(n){var t=$o.createRange();return t.selectNode($o.body),t.createContextualFragment(n.responseText)}var Zo={version:"3.4.11"};Date.now||(Date.now=function(){return+new Date});var Vo=[].slice,Xo=function(n){return Vo.call(n)},$o=document,Bo=$o.documentElement,Wo=window;try{Xo(Bo.childNodes)[0].nodeType}catch(Jo){Xo=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}try{$o.createElement("div").style.setProperty("opacity",0,"")}catch(Go){var Ko=Wo.Element.prototype,Qo=Ko.setAttribute,na=Ko.setAttributeNS,ta=Wo.CSSStyleDeclaration.prototype,ea=ta.setProperty;Ko.setAttribute=function(n,t){Qo.call(this,n,t+"")},Ko.setAttributeNS=function(n,t,e){na.call(this,n,t,e+"")},ta.setProperty=function(n,t,e){ea.call(this,n,t+"",e)}}Zo.ascending=n,Zo.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:0/0},Zo.min=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u=e);)e=void 0;for(;++ur&&(e=r)}else{for(;++u=e);)e=void 0;for(;++ur&&(e=r)}return e},Zo.max=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u=e);)e=void 0;for(;++ue&&(e=r)}else{for(;++u=e);)e=void 0;for(;++ue&&(e=r)}return e},Zo.extent=function(n,t){var e,r,u,i=-1,o=n.length;if(1===arguments.length){for(;++i=e);)e=u=void 0;for(;++ir&&(e=r),r>u&&(u=r))}else{for(;++i=e);)e=void 0;for(;++ir&&(e=r),r>u&&(u=r))}return[e,u]},Zo.sum=function(n,t){var e,r=0,u=n.length,i=-1;if(1===arguments.length)for(;++i1&&(e=e.map(r)),e=e.filter(t),e.length?Zo.quantile(e.sort(n),.5):void 0};var ra=e(n);Zo.bisectLeft=ra.left,Zo.bisect=Zo.bisectRight=ra.right,Zo.bisector=function(t){return e(1===t.length?function(e,r){return n(t(e),r)}:t)},Zo.shuffle=function(n){for(var t,e,r=n.length;r;)e=0|Math.random()*r--,t=n[r],n[r]=n[e],n[e]=t;return n},Zo.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},Zo.pairs=function(n){for(var t,e=0,r=n.length-1,u=n[0],i=new Array(0>r?0:r);r>e;)i[e]=[t=u,u=n[++e]];return i},Zo.zip=function(){if(!(u=arguments.length))return[];for(var n=-1,t=Zo.min(arguments,r),e=new Array(t);++n=0;)for(r=n[u],t=r.length;--t>=0;)e[--o]=r[t];return e};var ua=Math.abs;Zo.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),1/0===(t-n)/e)throw new Error("infinite range");var r,i=[],o=u(ua(e)),a=-1;if(n*=o,t*=o,e*=o,0>e)for(;(r=n+e*++a)>t;)i.push(r/o);else for(;(r=n+e*++a)=i.length)return r?r.call(u,a):e?a.sort(e):a;for(var s,l,f,h,g=-1,p=a.length,v=i[c++],d=new o;++g=i.length)return n;var r=[],u=a[e++];return n.forEach(function(n,u){r.push({key:n,values:t(u,e)})}),u?r.sort(function(n,t){return u(n.key,t.key)}):r}var e,r,u={},i=[],a=[];return u.map=function(t,e){return n(e,t,0)},u.entries=function(e){return t(n(Zo.map,e,0),0)},u.key=function(n){return i.push(n),u},u.sortKeys=function(n){return a[i.length-1]=n,u},u.sortValues=function(n){return e=n,u},u.rollup=function(n){return r=n,u},u},Zo.set=function(n){var t=new h;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},i(h,{has:a,add:function(n){return this[ia+n]=!0,n},remove:function(n){return n=ia+n,n in this&&delete this[n]},values:s,size:l,empty:f,forEach:function(n){for(var t in this)t.charCodeAt(0)===oa&&n.call(this,t.substring(1))}}),Zo.behavior={},Zo.rebind=function(n,t){for(var e,r=1,u=arguments.length;++r=0&&(r=n.substring(e+1),n=n.substring(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},Zo.event=null,Zo.requote=function(n){return n.replace(ca,"\\$&")};var ca=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,sa={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},la=function(n,t){return t.querySelector(n)},fa=function(n,t){return t.querySelectorAll(n)},ha=Bo.matches||Bo[p(Bo,"matchesSelector")],ga=function(n,t){return ha.call(n,t)};"function"==typeof Sizzle&&(la=function(n,t){return Sizzle(n,t)[0]||null},fa=Sizzle,ga=Sizzle.matchesSelector),Zo.selection=function(){return ma};var pa=Zo.selection.prototype=[];pa.select=function(n){var t,e,r,u,i=[];n=b(n);for(var o=-1,a=this.length;++o=0&&(e=n.substring(0,t),n=n.substring(t+1)),va.hasOwnProperty(e)?{space:va[e],local:n}:n}},pa.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=Zo.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(S(t,n[t]));return this}return this.each(S(n,t))},pa.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=A(n)).length,u=-1;if(t=e.classList){for(;++ur){if("string"!=typeof n){2>r&&(t="");for(e in n)this.each(z(e,n[e],t));return this}if(2>r)return Wo.getComputedStyle(this.node(),null).getPropertyValue(n);e=""}return this.each(z(n,t,e))},pa.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(L(t,n[t]));return this}return this.each(L(n,t))},pa.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},pa.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},pa.append=function(n){return n=T(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},pa.insert=function(n,t){return n=T(n),t=b(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},pa.remove=function(){return this.each(function(){var n=this.parentNode;n&&n.removeChild(this)})},pa.data=function(n,t){function e(n,e){var r,u,i,a=n.length,f=e.length,h=Math.min(a,f),g=new Array(f),p=new Array(f),v=new Array(a);if(t){var d,m=new o,y=new o,x=[];for(r=-1;++rr;++r)p[r]=q(e[r]);for(;a>r;++r)v[r]=n[r]}p.update=g,p.parentNode=g.parentNode=v.parentNode=n.parentNode,c.push(p),s.push(g),l.push(v)}var r,u,i=-1,a=this.length;if(!arguments.length){for(n=new Array(a=(r=this[0]).length);++i i;i++){u.push(t=[]),t.parentNode=(e=this[i]).parentNode;for(var a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,i)&&t.push(r)}return _(u)},pa.order=function(){for(var n=-1,t=this.length;++n=0;)(e=r[u])&&(i&&i!==e.nextSibling&&i.parentNode.insertBefore(e,i),i=e);return this},pa.sort=function(n){n=D.apply(this,arguments);for(var t=-1,e=this.length;++tn;n++)for(var e=this[n],r=0,u=e.length;u>r;r++){var i=e[r];if(i)return i}return null},pa.size=function(){var n=0;return this.each(function(){++n}),n};var da=[];Zo.selection.enter=U,Zo.selection.enter.prototype=da,da.append=pa.append,da.empty=pa.empty,da.node=pa.node,da.call=pa.call,da.size=pa.size,da.select=function(n){for(var t,e,r,u,i,o=[],a=-1,c=this.length;++ar){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(F(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(F(n,t,e))};var ya=Zo.map({mouseenter:"mouseover",mouseleave:"mouseout"});ya.forEach(function(n){"on"+n in $o&&ya.remove(n)});var xa="onselectstart"in $o?null:p(Bo.style,"userSelect"),Ma=0;Zo.mouse=function(n){return Z(n,x())};var _a=/WebKit/.test(Wo.navigator.userAgent)?-1:0;Zo.touches=function(n,t){return arguments.length<2&&(t=x().touches),t?Xo(t).map(function(t){var e=Z(n,t);return e.identifier=t.identifier,e}):[]},Zo.behavior.drag=function(){function n(){this.on("mousedown.drag",u).on("touchstart.drag",i)}function t(n,t,u,i,o){return function(){function a(){var n,e,r=t(h,v);r&&(n=r[0]-x[0],e=r[1]-x[1],p|=n|e,x=r,g({type:"drag",x:r[0]+s[0],y:r[1]+s[1],dx:n,dy:e}))}function c(){t(h,v)&&(m.on(i+d,null).on(o+d,null),y(p&&Zo.event.target===f),g({type:"dragend"}))}var s,l=this,f=Zo.event.target,h=l.parentNode,g=e.of(l,arguments),p=0,v=n(),d=".drag"+(null==v?"":"-"+v),m=Zo.select(u()).on(i+d,a).on(o+d,c),y=I(),x=t(h,v);r?(s=r.apply(l,arguments),s=[s.x-x[0],s.y-x[1]]):s=[0,0],g({type:"dragstart"})}}var e=M(n,"drag","dragstart","dragend"),r=null,u=t(v,Zo.mouse,$,"mousemove","mouseup"),i=t(V,Zo.touch,X,"touchmove","touchend");return n.origin=function(t){return arguments.length?(r=t,n):r},Zo.rebind(n,e,"on")};var ba=Math.PI,wa=2*ba,Sa=ba/2,ka=1e-6,Ea=ka*ka,Aa=ba/180,Ca=180/ba,Na=Math.SQRT2,za=2,La=4;Zo.interpolateZoom=function(n,t){function e(n){var t=n*y;if(m){var e=Q(v),o=i/(za*h)*(e*nt(Na*t+v)-K(v));return[r+o*s,u+o*l,i*e/Q(Na*t+v)]}return[r+n*s,u+n*l,i*Math.exp(Na*t)]}var r=n[0],u=n[1],i=n[2],o=t[0],a=t[1],c=t[2],s=o-r,l=a-u,f=s*s+l*l,h=Math.sqrt(f),g=(c*c-i*i+La*f)/(2*i*za*h),p=(c*c-i*i-La*f)/(2*c*za*h),v=Math.log(Math.sqrt(g*g+1)-g),d=Math.log(Math.sqrt(p*p+1)-p),m=d-v,y=(m||Math.log(c/i))/Na;return e.duration=1e3*y,e},Zo.behavior.zoom=function(){function n(n){n.on(A,s).on(Ra+".zoom",f).on("dblclick.zoom",h).on(z,l)}function t(n){return[(n[0]-S.x)/S.k,(n[1]-S.y)/S.k]}function e(n){return[n[0]*S.k+S.x,n[1]*S.k+S.y]}function r(n){S.k=Math.max(E[0],Math.min(E[1],n))}function u(n,t){t=e(t),S.x+=n[0]-t[0],S.y+=n[1]-t[1]}function i(){_&&_.domain(x.range().map(function(n){return(n-S.x)/S.k}).map(x.invert)),w&&w.domain(b.range().map(function(n){return(n-S.y)/S.k}).map(b.invert))}function o(n){n({type:"zoomstart"})}function a(n){i(),n({type:"zoom",scale:S.k,translate:[S.x,S.y]})}function c(n){n({type:"zoomend"})}function s(){function n(){l=1,u(Zo.mouse(r),h),a(s)}function e(){f.on(C,null).on(N,null),g(l&&Zo.event.target===i),c(s)}var r=this,i=Zo.event.target,s=L.of(r,arguments),l=0,f=Zo.select(Wo).on(C,n).on(N,e),h=t(Zo.mouse(r)),g=I();H.call(r),o(s)}function l(){function n(){var n=Zo.touches(g);return h=S.k,n.forEach(function(n){n.identifier in v&&(v[n.identifier]=t(n))}),n}function e(){var t=Zo.event.target;Zo.select(t).on(M,i).on(_,f),b.push(t);for(var e=Zo.event.changedTouches,o=0,c=e.length;c>o;++o)v[e[o].identifier]=null;var s=n(),l=Date.now();if(1===s.length){if(500>l-m){var h=s[0],g=v[h.identifier];r(2*S.k),u(h,g),y(),a(p)}m=l}else if(s.length>1){var h=s[0],x=s[1],w=h[0]-x[0],k=h[1]-x[1];d=w*w+k*k}}function i(){for(var n,t,e,i,o=Zo.touches(g),c=0,s=o.length;s>c;++c,i=null)if(e=o[c],i=v[e.identifier]){if(t)break;n=e,t=i}if(i){var l=(l=e[0]-n[0])*l+(l=e[1]-n[1])*l,f=d&&Math.sqrt(l/d);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+i[0])/2,(t[1]+i[1])/2],r(f*h)}m=null,u(n,t),a(p)}function f(){if(Zo.event.touches.length){for(var t=Zo.event.changedTouches,e=0,r=t.length;r>e;++e)delete v[t[e].identifier];for(var u in v)return void n()}Zo.selectAll(b).on(x,null),w.on(A,s).on(z,l),k(),c(p)}var h,g=this,p=L.of(g,arguments),v={},d=0,x=".zoom-"+Zo.event.changedTouches[0].identifier,M="touchmove"+x,_="touchend"+x,b=[],w=Zo.select(g).on(A,null).on(z,e),k=I();H.call(g),e(),o(p)}function f(){var n=L.of(this,arguments);d?clearTimeout(d):(g=t(p=v||Zo.mouse(this)),H.call(this),o(n)),d=setTimeout(function(){d=null,c(n)},50),y(),r(Math.pow(2,.002*Ta())*S.k),u(p,g),a(n)}function h(){var n=L.of(this,arguments),e=Zo.mouse(this),i=t(e),s=Math.log(S.k)/Math.LN2;o(n),r(Math.pow(2,Zo.event.shiftKey?Math.ceil(s)-1:Math.floor(s)+1)),u(e,i),a(n),c(n)}var g,p,v,d,m,x,_,b,w,S={x:0,y:0,k:1},k=[960,500],E=qa,A="mousedown.zoom",C="mousemove.zoom",N="mouseup.zoom",z="touchstart.zoom",L=M(n,"zoomstart","zoom","zoomend");return n.event=function(n){n.each(function(){var n=L.of(this,arguments),t=S;Ss?Zo.select(this).transition().each("start.zoom",function(){S=this.__chart__||{x:0,y:0,k:1},o(n)}).tween("zoom:zoom",function(){var e=k[0],r=k[1],u=e/2,i=r/2,o=Zo.interpolateZoom([(u-S.x)/S.k,(i-S.y)/S.k,e/S.k],[(u-t.x)/t.k,(i-t.y)/t.k,e/t.k]);return function(t){var r=o(t),c=e/r[2];this.__chart__=S={x:u-r[0]*c,y:i-r[1]*c,k:c},a(n)}}).each("end.zoom",function(){c(n)}):(this.__chart__=S,o(n),a(n),c(n))})},n.translate=function(t){return arguments.length?(S={x:+t[0],y:+t[1],k:S.k},i(),n):[S.x,S.y]},n.scale=function(t){return arguments.length?(S={x:S.x,y:S.y,k:+t},i(),n):S.k},n.scaleExtent=function(t){return arguments.length?(E=null==t?qa:[+t[0],+t[1]],n):E},n.center=function(t){return arguments.length?(v=t&&[+t[0],+t[1]],n):v},n.size=function(t){return arguments.length?(k=t&&[+t[0],+t[1]],n):k},n.x=function(t){return arguments.length?(_=t,x=t.copy(),S={x:0,y:0,k:1},n):_},n.y=function(t){return arguments.length?(w=t,b=t.copy(),S={x:0,y:0,k:1},n):w},Zo.rebind(n,L,"on")};var Ta,qa=[0,1/0],Ra="onwheel"in $o?(Ta=function(){return-Zo.event.deltaY*(Zo.event.deltaMode?120:1)},"wheel"):"onmousewheel"in $o?(Ta=function(){return Zo.event.wheelDelta},"mousewheel"):(Ta=function(){return-Zo.event.detail},"MozMousePixelScroll");Zo.color=et,et.prototype.toString=function(){return this.rgb()+""},Zo.hsl=rt;var Da=rt.prototype=new et;Da.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new rt(this.h,this.s,this.l/n)},Da.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new rt(this.h,this.s,n*this.l)},Da.rgb=function(){return ut(this.h,this.s,this.l)},Zo.hcl=it;var Pa=it.prototype=new et;Pa.brighter=function(n){return new it(this.h,this.c,Math.min(100,this.l+Ua*(arguments.length?n:1)))},Pa.darker=function(n){return new it(this.h,this.c,Math.max(0,this.l-Ua*(arguments.length?n:1)))},Pa.rgb=function(){return ot(this.h,this.c,this.l).rgb()},Zo.lab=at;var Ua=18,ja=.95047,Ha=1,Fa=1.08883,Oa=at.prototype=new et;Oa.brighter=function(n){return new at(Math.min(100,this.l+Ua*(arguments.length?n:1)),this.a,this.b)},Oa.darker=function(n){return new at(Math.max(0,this.l-Ua*(arguments.length?n:1)),this.a,this.b)},Oa.rgb=function(){return ct(this.l,this.a,this.b)},Zo.rgb=gt;var Ya=gt.prototype=new et;Ya.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,u=30;return t||e||r?(t&&u>t&&(t=u),e&&u>e&&(e=u),r&&u>r&&(r=u),new gt(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new gt(u,u,u)},Ya.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new gt(n*this.r,n*this.g,n*this.b)},Ya.hsl=function(){return yt(this.r,this.g,this.b)},Ya.toString=function(){return"#"+dt(this.r)+dt(this.g)+dt(this.b)};var Ia=Zo.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Ia.forEach(function(n,t){Ia.set(n,pt(t))}),Zo.functor=bt,Zo.xhr=St(wt),Zo.dsv=function(n,t){function e(n,e,i){arguments.length<3&&(i=e,e=null);var o=kt(n,t,null==e?r:u(e),i);return o.row=function(n){return arguments.length?o.response(null==(e=n)?r:u(n)):e},o}function r(n){return e.parse(n.responseText)}function u(n){return function(t){return e.parse(t.responseText,n)}}function i(t){return t.map(o).join(n)}function o(n){return a.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var a=new RegExp('["'+n+"\n]"),c=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var u=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(u(n),e)}:u})},e.parseRows=function(n,t){function e(){if(l>=s)return o;if(u)return u=!1,i;var t=l;if(34===n.charCodeAt(t)){for(var e=t;e++l;){var r=n.charCodeAt(l++),a=1;if(10===r)u=!0;else if(13===r)u=!0,10===n.charCodeAt(l)&&(++l,++a);else if(r!==c)continue;return n.substring(t,l-a)}return n.substring(t)}for(var r,u,i={},o={},a=[],s=n.length,l=0,f=0;(r=e())!==o;){for(var h=[];r!==i&&r!==o;)h.push(r),r=e();(!t||(h=t(h,f++)))&&a.push(h)}return a},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new h,u=[];return t.forEach(function(n){for(var t in n)r.has(t)||u.push(r.add(t))}),[u.map(o).join(n)].concat(t.map(function(t){return u.map(function(n){return o(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(i).join("\n")},e},Zo.csv=Zo.dsv(",","text/csv"),Zo.tsv=Zo.dsv(" ","text/tab-separated-values"),Zo.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=x().changedTouches),t)for(var r,u=0,i=t.length;i>u;++u)if((r=t[u]).identifier===e)return Z(n,r)};var Za,Va,Xa,$a,Ba,Wa=Wo[p(Wo,"requestAnimationFrame")]||function(n){setTimeout(n,17)};Zo.timer=function(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var u=e+t,i={c:n,t:u,f:!1,n:null};Va?Va.n=i:Za=i,Va=i,Xa||($a=clearTimeout($a),Xa=1,Wa(At))},Zo.timer.flush=function(){Ct(),Nt()},Zo.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var Ja=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Lt);Zo.formatPrefix=function(n,t){var e=0;return n&&(0>n&&(n*=-1),t&&(n=Zo.round(n,zt(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),Ja[8+e/3]};var Ga=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Ka=Zo.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=Zo.round(n,zt(n,t))).toFixed(Math.max(0,Math.min(20,zt(n*(1+1e-15),t))))}}),Qa=Zo.time={},nc=Date;Rt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){tc.setUTCDate.apply(this._,arguments)},setDay:function(){tc.setUTCDay.apply(this._,arguments)},setFullYear:function(){tc.setUTCFullYear.apply(this._,arguments)},setHours:function(){tc.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){tc.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){tc.setUTCMinutes.apply(this._,arguments)},setMonth:function(){tc.setUTCMonth.apply(this._,arguments)},setSeconds:function(){tc.setUTCSeconds.apply(this._,arguments)},setTime:function(){tc.setTime.apply(this._,arguments)}};var tc=Date.prototype;Qa.year=Dt(function(n){return n=Qa.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),Qa.years=Qa.year.range,Qa.years.utc=Qa.year.utc.range,Qa.day=Dt(function(n){var t=new nc(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),Qa.days=Qa.day.range,Qa.days.utc=Qa.day.utc.range,Qa.dayOfYear=function(n){var t=Qa.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=Qa[n]=Dt(function(n){return(n=Qa.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=Qa.year(n).getDay();return Math.floor((Qa.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});Qa[n+"s"]=e.range,Qa[n+"s"].utc=e.utc.range,Qa[n+"OfYear"]=function(n){var e=Qa.year(n).getDay();return Math.floor((Qa.dayOfYear(n)+(e+t)%7)/7)}}),Qa.week=Qa.sunday,Qa.weeks=Qa.sunday.range,Qa.weeks.utc=Qa.sunday.utc.range,Qa.weekOfYear=Qa.sundayOfYear;var ec={"-":"",_:" ",0:"0"},rc=/^\s*\d+/,uc=/^%/;Zo.locale=function(n){return{numberFormat:Tt(n),timeFormat:Ut(n)}};var ic=Zo.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});Zo.format=ic.numberFormat,Zo.geo={},ue.prototype={s:0,t:0,add:function(n){ie(n,this.t,oc),ie(oc.s,this.s,this),this.s?this.t+=oc.t:this.s=oc.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var oc=new ue;Zo.geo.stream=function(n,t){n&&ac.hasOwnProperty(n.type)?ac[n.type](n,t):oe(n,t)};var ac={Feature:function(n,t){oe(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,u=e.length;++rn?4*ba+n:n,fc.lineStart=fc.lineEnd=fc.point=v}};Zo.geo.bounds=function(){function n(n,t){x.push(M=[l=n,h=n]),f>t&&(f=t),t>g&&(g=t)}function t(t,e){var r=le([t*Aa,e*Aa]);if(m){var u=he(m,r),i=[u[1],-u[0],0],o=he(i,u);ve(o),o=de(o);var c=t-p,s=c>0?1:-1,v=o[0]*Ca*s,d=ua(c)>180;if(d^(v>s*p&&s*t>v)){var y=o[1]*Ca;y>g&&(g=y)}else if(v=(v+360)%360-180,d^(v>s*p&&s*t>v)){var y=-o[1]*Ca;f>y&&(f=y)}else f>e&&(f=e),e>g&&(g=e);d?p>t?a(l,t)>a(l,h)&&(h=t):a(t,h)>a(l,h)&&(l=t):h>=l?(l>t&&(l=t),t>h&&(h=t)):t>p?a(l,t)>a(l,h)&&(h=t):a(t,h)>a(l,h)&&(l=t)}else n(t,e);m=r,p=t}function e(){_.point=t}function r(){M[0]=l,M[1]=h,_.point=n,m=null}function u(n,e){if(m){var r=n-p;y+=ua(r)>180?r+(r>0?360:-360):r}else v=n,d=e;fc.point(n,e),t(n,e)}function i(){fc.lineStart()}function o(){u(v,d),fc.lineEnd(),ua(y)>ka&&(l=-(h=180)),M[0]=l,M[1]=h,m=null}function a(n,t){return(t-=n)<0?t+360:t}function c(n,t){return n[0]-t[0]}function s(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nlc?(l=-(h=180),f=-(g=90)):y>ka?g=90:-ka>y&&(f=-90),M[0]=l,M[1]=h}};return function(n){g=h=-(l=f=1/0),x=[],Zo.geo.stream(n,_);var t=x.length;if(t){x.sort(c);for(var e,r=1,u=x[0],i=[u];t>r;++r)e=x[r],s(e[0],u)||s(e[1],u)?(a(u[0],e[1])>a(u[0],u[1])&&(u[1]=e[1]),a(e[0],u[1])>a(u[0],u[1])&&(u[0]=e[0])):i.push(u=e);
-for(var o,e,p=-1/0,t=i.length-1,r=0,u=i[t];t>=r;u=e,++r)e=i[r],(o=a(u[1],e[0]))>p&&(p=o,l=e[0],h=u[1])}return x=M=null,1/0===l||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[l,f],[h,g]]}}(),Zo.geo.centroid=function(n){hc=gc=pc=vc=dc=mc=yc=xc=Mc=_c=bc=0,Zo.geo.stream(n,wc);var t=Mc,e=_c,r=bc,u=t*t+e*e+r*r;return Ea>u&&(t=mc,e=yc,r=xc,ka>gc&&(t=pc,e=vc,r=dc),u=t*t+e*e+r*r,Ea>u)?[0/0,0/0]:[Math.atan2(e,t)*Ca,G(r/Math.sqrt(u))*Ca]};var hc,gc,pc,vc,dc,mc,yc,xc,Mc,_c,bc,wc={sphere:v,point:ye,lineStart:Me,lineEnd:_e,polygonStart:function(){wc.lineStart=be},polygonEnd:function(){wc.lineStart=Me}},Sc=Ae(we,Te,Re,[-ba,-ba/2]),kc=1e9;Zo.geo.clipExtent=function(){var n,t,e,r,u,i,o={stream:function(n){return u&&(u.valid=!1),u=i(n),u.valid=!0,u},extent:function(a){return arguments.length?(i=Ue(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),u&&(u.valid=!1,u=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(Zo.geo.conicEqualArea=function(){return He(Fe)}).raw=Fe,Zo.geo.albers=function(){return Zo.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},Zo.geo.albersUsa=function(){function n(n){var i=n[0],o=n[1];return t=null,e(i,o),t||(r(i,o),t)||u(i,o),t}var t,e,r,u,i=Zo.geo.albers(),o=Zo.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=Zo.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=i.scale(),e=i.translate(),r=(n[0]-e[0])/t,u=(n[1]-e[1])/t;return(u>=.12&&.234>u&&r>=-.425&&-.214>r?o:u>=.166&&.234>u&&r>=-.214&&-.115>r?a:i).invert(n)},n.stream=function(n){var t=i.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,u){t.point(n,u),e.point(n,u),r.point(n,u)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),a.precision(t),n):i.precision()},n.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),a.scale(t),n.translate(i.translate())):i.scale()},n.translate=function(t){if(!arguments.length)return i.translate();var s=i.scale(),l=+t[0],f=+t[1];return e=i.translate(t).clipExtent([[l-.455*s,f-.238*s],[l+.455*s,f+.238*s]]).stream(c).point,r=o.translate([l-.307*s,f+.201*s]).clipExtent([[l-.425*s+ka,f+.12*s+ka],[l-.214*s-ka,f+.234*s-ka]]).stream(c).point,u=a.translate([l-.205*s,f+.212*s]).clipExtent([[l-.214*s+ka,f+.166*s+ka],[l-.115*s-ka,f+.234*s-ka]]).stream(c).point,n},n.scale(1070)};var Ec,Ac,Cc,Nc,zc,Lc,Tc={point:v,lineStart:v,lineEnd:v,polygonStart:function(){Ac=0,Tc.lineStart=Oe},polygonEnd:function(){Tc.lineStart=Tc.lineEnd=Tc.point=v,Ec+=ua(Ac/2)}},qc={point:Ye,lineStart:v,lineEnd:v,polygonStart:v,polygonEnd:v},Rc={point:Ve,lineStart:Xe,lineEnd:$e,polygonStart:function(){Rc.lineStart=Be},polygonEnd:function(){Rc.point=Ve,Rc.lineStart=Xe,Rc.lineEnd=$e}};Zo.geo.path=function(){function n(n){return n&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=u(i)),Zo.geo.stream(n,o)),i.result()}function t(){return o=null,n}var e,r,u,i,o,a=4.5;return n.area=function(n){return Ec=0,Zo.geo.stream(n,u(Tc)),Ec},n.centroid=function(n){return pc=vc=dc=mc=yc=xc=Mc=_c=bc=0,Zo.geo.stream(n,u(Rc)),bc?[Mc/bc,_c/bc]:xc?[mc/xc,yc/xc]:dc?[pc/dc,vc/dc]:[0/0,0/0]},n.bounds=function(n){return zc=Lc=-(Cc=Nc=1/0),Zo.geo.stream(n,u(qc)),[[Cc,Nc],[zc,Lc]]},n.projection=function(n){return arguments.length?(u=(e=n)?n.stream||Ge(n):wt,t()):e},n.context=function(n){return arguments.length?(i=null==(r=n)?new Ie:new We(n),"function"!=typeof a&&i.pointRadius(a),t()):r},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(i.pointRadius(+t),+t),n):a},n.projection(Zo.geo.albersUsa()).context(null)},Zo.geo.transform=function(n){return{stream:function(t){var e=new Ke(t);for(var r in n)e[r]=n[r];return e}}},Ke.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},Zo.geo.projection=nr,Zo.geo.projectionMutator=tr,(Zo.geo.equirectangular=function(){return nr(rr)}).raw=rr.invert=rr,Zo.geo.rotation=function(n){function t(t){return t=n(t[0]*Aa,t[1]*Aa),t[0]*=Ca,t[1]*=Ca,t}return n=ir(n[0]%360*Aa,n[1]*Aa,n.length>2?n[2]*Aa:0),t.invert=function(t){return t=n.invert(t[0]*Aa,t[1]*Aa),t[0]*=Ca,t[1]*=Ca,t},t},ur.invert=rr,Zo.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=ir(-n[0]*Aa,-n[1]*Aa,0).invert,u=[];return e(null,null,1,{point:function(n,e){u.push(n=t(n,e)),n[0]*=Ca,n[1]*=Ca}}),{type:"Polygon",coordinates:[u]}}var t,e,r=[0,0],u=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=sr((t=+r)*Aa,u*Aa),n):t},n.precision=function(r){return arguments.length?(e=sr(t*Aa,(u=+r)*Aa),n):u},n.angle(90)},Zo.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Aa,u=n[1]*Aa,i=t[1]*Aa,o=Math.sin(r),a=Math.cos(r),c=Math.sin(u),s=Math.cos(u),l=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((e=f*o)*e+(e=s*l-c*f*a)*e),c*l+s*f*a)},Zo.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return Zo.range(Math.ceil(i/d)*d,u,d).map(h).concat(Zo.range(Math.ceil(s/m)*m,c,m).map(g)).concat(Zo.range(Math.ceil(r/p)*p,e,p).filter(function(n){return ua(n%d)>ka}).map(l)).concat(Zo.range(Math.ceil(a/v)*v,o,v).filter(function(n){return ua(n%m)>ka}).map(f))}var e,r,u,i,o,a,c,s,l,f,h,g,p=10,v=p,d=90,m=360,y=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(g(c).slice(1),h(u).reverse().slice(1),g(s).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(i=+t[0][0],u=+t[1][0],s=+t[0][1],c=+t[1][1],i>u&&(t=i,i=u,u=t),s>c&&(t=s,s=c,c=t),n.precision(y)):[[i,s],[u,c]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],o=+t[1][1],r>e&&(t=r,r=e,e=t),a>o&&(t=a,a=o,o=t),n.precision(y)):[[r,a],[e,o]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],m=+t[1],n):[d,m]},n.minorStep=function(t){return arguments.length?(p=+t[0],v=+t[1],n):[p,v]},n.precision=function(t){return arguments.length?(y=+t,l=fr(a,o,90),f=hr(r,e,y),h=fr(s,c,90),g=hr(i,u,y),n):y},n.majorExtent([[-180,-90+ka],[180,90-ka]]).minorExtent([[-180,-80-ka],[180,80+ka]])},Zo.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||u.apply(this,arguments)]}}var t,e,r=gr,u=pr;return n.distance=function(){return Zo.geo.distance(t||r.apply(this,arguments),e||u.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(u=t,e="function"==typeof t?null:t,n):u},n.precision=function(){return arguments.length?n:0},n},Zo.geo.interpolate=function(n,t){return vr(n[0]*Aa,n[1]*Aa,t[0]*Aa,t[1]*Aa)},Zo.geo.length=function(n){return Dc=0,Zo.geo.stream(n,Pc),Dc};var Dc,Pc={sphere:v,point:v,lineStart:dr,lineEnd:v,polygonStart:v,polygonEnd:v},Uc=mr(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(Zo.geo.azimuthalEqualArea=function(){return nr(Uc)}).raw=Uc;var jc=mr(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},wt);(Zo.geo.azimuthalEquidistant=function(){return nr(jc)}).raw=jc,(Zo.geo.conicConformal=function(){return He(yr)}).raw=yr,(Zo.geo.conicEquidistant=function(){return He(xr)}).raw=xr;var Hc=mr(function(n){return 1/n},Math.atan);(Zo.geo.gnomonic=function(){return nr(Hc)}).raw=Hc,Mr.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Sa]},(Zo.geo.mercator=function(){return _r(Mr)}).raw=Mr;var Fc=mr(function(){return 1},Math.asin);(Zo.geo.orthographic=function(){return nr(Fc)}).raw=Fc;var Oc=mr(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(Zo.geo.stereographic=function(){return nr(Oc)}).raw=Oc,br.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-Sa]},(Zo.geo.transverseMercator=function(){var n=_r(br),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=br,Zo.geom={},Zo.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,u=bt(e),i=bt(r),o=n.length,a=[],c=[];for(t=0;o>t;t++)a.push([+u.call(this,n[t],t),+i.call(this,n[t],t),t]);for(a.sort(Er),t=0;o>t;t++)c.push([a[t][0],-a[t][1]]);var s=kr(a),l=kr(c),f=l[0]===s[0],h=l[l.length-1]===s[s.length-1],g=[];for(t=s.length-1;t>=0;--t)g.push(n[a[s[t]][2]]);for(t=+f;t=r&&s.x<=i&&s.y>=u&&s.y<=o?[[r,o],[i,o],[i,u],[r,u]]:[];l.point=n[a]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(i(n,t)/ka)*ka,y:Math.round(o(n,t)/ka)*ka,i:t}})}var r=wr,u=Sr,i=r,o=u,a=Jc;return n?t(n):(t.links=function(n){return tu(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return tu(e(n)).cells.forEach(function(e,r){for(var u,i,o=e.site,a=e.edges.sort(Hr),c=-1,s=a.length,l=a[s-1].edge,f=l.l===o?l.r:l.l;++c=s,h=r>=l,g=(h<<1)+f;n.leaf=!1,n=n.nodes[g]||(n.nodes[g]=ou()),f?u=s:a=s,h?o=l:c=l,i(n,t,e,r,u,o,a,c)}var l,f,h,g,p,v,d,m,y,x=bt(a),M=bt(c);if(null!=t)v=t,d=e,m=r,y=u;else if(m=y=-(v=d=1/0),f=[],h=[],p=n.length,o)for(g=0;p>g;++g)l=n[g],l.xm&&(m=l.x),l.y>y&&(y=l.y),f.push(l.x),h.push(l.y);else for(g=0;p>g;++g){var _=+x(l=n[g],g),b=+M(l,g);v>_&&(v=_),d>b&&(d=b),_>m&&(m=_),b>y&&(y=b),f.push(_),h.push(b)}var w=m-v,S=y-d;w>S?y=d+w:m=v+S;var k=ou();if(k.add=function(n){i(k,n,+x(n,++g),+M(n,g),v,d,m,y)},k.visit=function(n){au(n,k,v,d,m,y)},g=-1,null==t){for(;++g=0?n.substring(0,t):n,r=t>=0?n.substring(t+1):"in";return e=ns.get(e)||Qc,r=ts.get(r)||wt,pu(r(e.apply(null,Vo.call(arguments,1))))},Zo.interpolateHcl=Au,Zo.interpolateHsl=Cu,Zo.interpolateLab=Nu,Zo.interpolateRound=zu,Zo.transform=function(n){var t=$o.createElementNS(Zo.ns.prefix.svg,"g");return(Zo.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new Lu(e?e.matrix:es)})(n)},Lu.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var es={a:1,b:0,c:0,d:1,e:0,f:0};Zo.interpolateTransform=Du,Zo.layout={},Zo.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++ea*a/d){if(p>c){var s=t.charge/c;n.px-=i*s,n.py-=o*s}return!0}if(t.point&&c&&p>c){var s=t.pointCharge/c;n.px-=i*s,n.py-=o*s}}return!t.charge}}function t(n){n.px=Zo.event.x,n.py=Zo.event.y,a.resume()}var e,r,u,i,o,a={},c=Zo.dispatch("start","tick","end"),s=[1,1],l=.9,f=rs,h=us,g=-30,p=is,v=.1,d=.64,m=[],y=[];return a.tick=function(){if((r*=.99)<.005)return c.end({type:"end",alpha:r=0}),!0;var t,e,a,f,h,p,d,x,M,_=m.length,b=y.length;for(e=0;b>e;++e)a=y[e],f=a.source,h=a.target,x=h.x-f.x,M=h.y-f.y,(p=x*x+M*M)&&(p=r*i[e]*((p=Math.sqrt(p))-u[e])/p,x*=p,M*=p,h.x-=x*(d=f.weight/(h.weight+f.weight)),h.y-=M*d,f.x+=x*(d=1-d),f.y+=M*d);if((d=r*v)&&(x=s[0]/2,M=s[1]/2,e=-1,d))for(;++e<_;)a=m[e],a.x+=(x-a.x)*d,a.y+=(M-a.y)*d;if(g)for(Vu(t=Zo.geom.quadtree(m),r,o),e=-1;++e<_;)(a=m[e]).fixed||t.visit(n(a));for(e=-1;++e<_;)a=m[e],a.fixed?(a.x=a.px,a.y=a.py):(a.x-=(a.px-(a.px=a.x))*l,a.y-=(a.py-(a.py=a.y))*l);c.tick({type:"tick",alpha:r})},a.nodes=function(n){return arguments.length?(m=n,a):m},a.links=function(n){return arguments.length?(y=n,a):y},a.size=function(n){return arguments.length?(s=n,a):s},a.linkDistance=function(n){return arguments.length?(f="function"==typeof n?n:+n,a):f},a.distance=a.linkDistance,a.linkStrength=function(n){return arguments.length?(h="function"==typeof n?n:+n,a):h},a.friction=function(n){return arguments.length?(l=+n,a):l},a.charge=function(n){return arguments.length?(g="function"==typeof n?n:+n,a):g},a.chargeDistance=function(n){return arguments.length?(p=n*n,a):Math.sqrt(p)},a.gravity=function(n){return arguments.length?(v=+n,a):v},a.theta=function(n){return arguments.length?(d=n*n,a):Math.sqrt(d)},a.alpha=function(n){return arguments.length?(n=+n,r?r=n>0?n:0:n>0&&(c.start({type:"start",alpha:r=n}),Zo.timer(a.tick)),a):r},a.start=function(){function n(n,r){if(!e){for(e=new Array(c),a=0;c>a;++a)e[a]=[];for(a=0;s>a;++a){var u=y[a];e[u.source.index].push(u.target),e[u.target.index].push(u.source)}}for(var i,o=e[t],a=-1,s=o.length;++at;++t)(r=m[t]).index=t,r.weight=0;for(t=0;l>t;++t)r=y[t],"number"==typeof r.source&&(r.source=m[r.source]),"number"==typeof r.target&&(r.target=m[r.target]),++r.source.weight,++r.target.weight;for(t=0;c>t;++t)r=m[t],isNaN(r.x)&&(r.x=n("x",p)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(u=[],"function"==typeof f)for(t=0;l>t;++t)u[t]=+f.call(this,y[t],t);else for(t=0;l>t;++t)u[t]=f;if(i=[],"function"==typeof h)for(t=0;l>t;++t)i[t]=+h.call(this,y[t],t);else for(t=0;l>t;++t)i[t]=h;if(o=[],"function"==typeof g)for(t=0;c>t;++t)o[t]=+g.call(this,m[t],t);else for(t=0;c>t;++t)o[t]=g;return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){return e||(e=Zo.behavior.drag().origin(wt).on("dragstart.force",Ou).on("drag.force",t).on("dragend.force",Yu)),arguments.length?(this.on("mouseover.force",Iu).on("mouseout.force",Zu).call(e),void 0):e},Zo.rebind(a,c,"on")};var rs=20,us=1,is=1/0;Zo.layout.hierarchy=function(){function n(u){var i,o=[u],a=[];for(u.depth=0;null!=(i=o.pop());)if(a.push(i),(s=e.call(n,i,i.depth))&&(c=s.length)){for(var c,s,l;--c>=0;)o.push(l=s[c]),l.parent=i,l.depth=i.depth+1;r&&(i.value=0),i.children=s}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return Bu(u,function(n){var e,u;t&&(e=n.children)&&e.sort(t),r&&(u=n.parent)&&(u.value+=n.value)}),a}var t=Gu,e=Wu,r=Ju;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&($u(t,function(n){n.children&&(n.value=0)}),Bu(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},Zo.layout.partition=function(){function n(t,e,r,u){var i=t.children;if(t.x=e,t.y=t.depth*u,t.dx=r,t.dy=u,i&&(o=i.length)){var o,a,c,s=-1;for(r=t.value?r/t.value:0;++sg;++g)for(u.call(n,s[0][g],p=v[g],l[0][g][1]),h=1;d>h;++h)u.call(n,s[h][g],p+=l[h-1][g][1],l[h][g][1]);return a}var t=wt,e=ei,r=ri,u=ti,i=Qu,o=ni;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:as.get(t)||ei,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:cs.get(t)||ri,n):r},n.x=function(t){return arguments.length?(i=t,n):i},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(u=t,n):u},n};var as=Zo.map({"inside-out":function(n){var t,e,r=n.length,u=n.map(ui),i=n.map(ii),o=Zo.range(r).sort(function(n,t){return u[n]-u[t]}),a=0,c=0,s=[],l=[];for(t=0;r>t;++t)e=o[t],c>a?(a+=i[e],s.push(e)):(c+=i[e],l.push(e));return l.reverse().concat(s)},reverse:function(n){return Zo.range(n.length).reverse()},"default":ei}),cs=Zo.map({silhouette:function(n){var t,e,r,u=n.length,i=n[0].length,o=[],a=0,c=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];r>a&&(a=r),o.push(r)}for(e=0;i>e;++e)c[e]=(a-o[e])/2;return c},wiggle:function(n){var t,e,r,u,i,o,a,c,s,l=n.length,f=n[0],h=f.length,g=[];for(g[0]=c=s=0,e=1;h>e;++e){for(t=0,u=0;l>t;++t)u+=n[t][e][1];for(t=0,i=0,a=f[e][0]-f[e-1][0];l>t;++t){for(r=0,o=(n[t][e][1]-n[t][e-1][1])/(2*a);t>r;++r)o+=(n[r][e][1]-n[r][e-1][1])/a;i+=o*n[t][e][1]}g[e]=c-=u?i/u*a:0,s>c&&(s=c)}for(e=0;h>e;++e)g[e]-=s;return g},expand:function(n){var t,e,r,u=n.length,i=n[0].length,o=1/u,a=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];if(r)for(t=0;u>t;t++)n[t][e][1]/=r;else for(t=0;u>t;t++)n[t][e][1]=o}for(e=0;i>e;++e)a[e]=0;return a},zero:ri});Zo.layout.histogram=function(){function n(n,i){for(var o,a,c=[],s=n.map(e,this),l=r.call(this,s,i),f=u.call(this,l,s,i),i=-1,h=s.length,g=f.length-1,p=t?1:1/h;++i0)for(i=-1;++i=l[0]&&a<=l[1]&&(o=c[Zo.bisect(f,a,1,g)-1],o.y+=p,o.push(n[i]));return c}var t=!0,e=Number,r=si,u=ai;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=bt(t),n):r},n.bins=function(t){return arguments.length?(u="number"==typeof t?function(n){return ci(n,t)}:bt(t),n):u},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},Zo.layout.pack=function(){function n(n,i){var o=e.call(this,n,i),a=o[0],c=u[0],s=u[1],l=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,Bu(a,function(n){n.r=+l(n.value)}),Bu(a,pi),r){var f=r*(t?1:Math.max(2*a.r/c,2*a.r/s))/2;Bu(a,function(n){n.r+=f}),Bu(a,pi),Bu(a,function(n){n.r-=f})}return mi(a,c/2,s/2,t?1:1/Math.max(2*a.r/c,2*a.r/s)),o}var t,e=Zo.layout.hierarchy().sort(li),r=0,u=[1,1];return n.size=function(t){return arguments.length?(u=t,n):u},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},Xu(n,e)},Zo.layout.tree=function(){function n(n,u){var l=o.call(this,n,u),f=l[0],h=t(f);if(Bu(h,e),h.parent.m=-h.z,$u(h,r),s)$u(f,i);else{var g=f,p=f,v=f;$u(f,function(n){n.xp.x&&(p=n),n.depth>v.depth&&(v=n)});var d=a(g,p)/2-g.x,m=c[0]/(p.x+a(p,g)/2+d),y=c[1]/(v.depth||1);$u(f,function(n){n.x=(n.x+d)*m,n.y=n.depth*y})}return l}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var u,i=t.children,o=0,a=i.length;a>o;++o)r.push((i[o]=u={_:i[o],parent:t,children:(u=i[o].children)&&u.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=u);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){wi(n);var i=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+a(n._,r._),n.m=n.z-i):n.z=i}else r&&(n.z=r.z+a(n._,r._));n.parent.A=u(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function u(n,t,e){if(t){for(var r,u=n,i=n,o=t,c=u.parent.children[0],s=u.m,l=i.m,f=o.m,h=c.m;o=_i(o),u=Mi(u),o&&u;)c=Mi(c),i=_i(i),i.a=n,r=o.z+f-u.z-s+a(o._,u._),r>0&&(bi(Si(o,n,e),n,r),s+=r,l+=r),f+=o.m,s+=u.m,h+=c.m,l+=i.m;o&&!_i(i)&&(i.t=o,i.m+=f-l),u&&!Mi(c)&&(c.t=u,c.m+=s-h,e=n)}return e}function i(n){n.x*=c[0],n.y=n.depth*c[1]}var o=Zo.layout.hierarchy().sort(null).value(null),a=xi,c=[1,1],s=null;return n.separation=function(t){return arguments.length?(a=t,n):a},n.size=function(t){return arguments.length?(s=null==(c=t)?i:null,n):s?null:c},n.nodeSize=function(t){return arguments.length?(s=null==(c=t)?null:i,n):s?c:null},Xu(n,o)},Zo.layout.cluster=function(){function n(n,i){var o,a=t.call(this,n,i),c=a[0],s=0;Bu(c,function(n){var t=n.children;t&&t.length?(n.x=Ei(t),n.y=ki(t)):(n.x=o?s+=e(n,o):0,n.y=0,o=n)});var l=Ai(c),f=Ci(c),h=l.x-e(l,f)/2,g=f.x+e(f,l)/2;return Bu(c,u?function(n){n.x=(n.x-c.x)*r[0],n.y=(c.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(g-h)*r[0],n.y=(1-(c.y?n.y/c.y:1))*r[1]}),a}var t=Zo.layout.hierarchy().sort(null).value(null),e=xi,r=[1,1],u=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(u=null==(r=t),n):u?null:r},n.nodeSize=function(t){return arguments.length?(u=null!=(r=t),n):u?r:null},Xu(n,t)},Zo.layout.treemap=function(){function n(n,t){for(var e,r,u=-1,i=n.length;++ut?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var i=e.children;if(i&&i.length){var o,a,c,s=f(e),l=[],h=i.slice(),p=1/0,v="slice"===g?s.dx:"dice"===g?s.dy:"slice-dice"===g?1&e.depth?s.dy:s.dx:Math.min(s.dx,s.dy);for(n(h,s.dx*s.dy/e.value),l.area=0;(c=h.length)>0;)l.push(o=h[c-1]),l.area+=o.area,"squarify"!==g||(a=r(l,v))<=p?(h.pop(),p=a):(l.area-=l.pop().area,u(l,v,s,!1),v=Math.min(s.dx,s.dy),l.length=l.area=0,p=1/0);l.length&&(u(l,v,s,!0),l.length=l.area=0),i.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var i,o=f(t),a=r.slice(),c=[];for(n(a,o.dx*o.dy/t.value),c.area=0;i=a.pop();)c.push(i),c.area+=i.area,null!=i.z&&(u(c,i.z?o.dx:o.dy,o,!a.length),c.length=c.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,u=0,i=1/0,o=-1,a=n.length;++oe&&(i=e),e>u&&(u=e));return r*=r,t*=t,r?Math.max(t*u*p/r,r/(t*i*p)):1/0}function u(n,t,e,r){var u,i=-1,o=n.length,a=e.x,s=e.y,l=t?c(n.area/t):0;if(t==e.dx){for((r||l>e.dy)&&(l=e.dy);++ie.dx)&&(l=e.dx);++ie&&(t=1),1>e&&(n=0),function(){var e,r,u;do e=2*Math.random()-1,r=2*Math.random()-1,u=e*e+r*r;while(!u||u>1);return n+t*e*Math.sqrt(-2*Math.log(u)/u)}},logNormal:function(){var n=Zo.random.normal.apply(Zo,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=Zo.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},Zo.scale={};var ss={floor:wt,ceil:wt};Zo.scale.linear=function(){return Ui([0,1],[0,1],hu,!1)};var ls={s:1,g:1,p:1,r:1,e:1};Zo.scale.log=function(){return Vi(Zo.scale.linear().domain([0,1]),10,!0,[1,10])};var fs=Zo.format(".0e"),hs={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};Zo.scale.pow=function(){return Xi(Zo.scale.linear(),1,[0,1])},Zo.scale.sqrt=function(){return Zo.scale.pow().exponent(.5)},Zo.scale.ordinal=function(){return Bi([],{t:"range",a:[[]]})},Zo.scale.category10=function(){return Zo.scale.ordinal().range(gs)},Zo.scale.category20=function(){return Zo.scale.ordinal().range(ps)},Zo.scale.category20b=function(){return Zo.scale.ordinal().range(vs)},Zo.scale.category20c=function(){return Zo.scale.ordinal().range(ds)};var gs=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(vt),ps=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(vt),vs=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(vt),ds=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(vt);Zo.scale.quantile=function(){return Wi([],[])},Zo.scale.quantize=function(){return Ji(0,1,[0,1])},Zo.scale.threshold=function(){return Gi([.5],[0,1])},Zo.scale.identity=function(){return Ki([0,1])},Zo.svg={},Zo.svg.arc=function(){function n(){var n=t.apply(this,arguments),i=e.apply(this,arguments),o=r.apply(this,arguments)+ms,a=u.apply(this,arguments)+ms,c=(o>a&&(c=o,o=a,a=c),a-o),s=ba>c?"0":"1",l=Math.cos(o),f=Math.sin(o),h=Math.cos(a),g=Math.sin(a);
-return c>=ys?n?"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"M0,"+n+"A"+n+","+n+" 0 1,0 0,"+-n+"A"+n+","+n+" 0 1,0 0,"+n+"Z":"M0,"+i+"A"+i+","+i+" 0 1,1 0,"+-i+"A"+i+","+i+" 0 1,1 0,"+i+"Z":n?"M"+i*l+","+i*f+"A"+i+","+i+" 0 "+s+",1 "+i*h+","+i*g+"L"+n*h+","+n*g+"A"+n+","+n+" 0 "+s+",0 "+n*l+","+n*f+"Z":"M"+i*l+","+i*f+"A"+i+","+i+" 0 "+s+",1 "+i*h+","+i*g+"L0,0"+"Z"}var t=Qi,e=no,r=to,u=eo;return n.innerRadius=function(e){return arguments.length?(t=bt(e),n):t},n.outerRadius=function(t){return arguments.length?(e=bt(t),n):e},n.startAngle=function(t){return arguments.length?(r=bt(t),n):r},n.endAngle=function(t){return arguments.length?(u=bt(t),n):u},n.centroid=function(){var n=(t.apply(this,arguments)+e.apply(this,arguments))/2,i=(r.apply(this,arguments)+u.apply(this,arguments))/2+ms;return[Math.cos(i)*n,Math.sin(i)*n]},n};var ms=-Sa,ys=wa-ka;Zo.svg.line=function(){return ro(wt)};var xs=Zo.map({linear:uo,"linear-closed":io,step:oo,"step-before":ao,"step-after":co,basis:po,"basis-open":vo,"basis-closed":mo,bundle:yo,cardinal:fo,"cardinal-open":so,"cardinal-closed":lo,monotone:So});xs.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var Ms=[0,2/3,1/3,0],_s=[0,1/3,2/3,0],bs=[0,1/6,2/3,1/6];Zo.svg.line.radial=function(){var n=ro(ko);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},ao.reverse=co,co.reverse=ao,Zo.svg.area=function(){return Eo(wt)},Zo.svg.area.radial=function(){var n=Eo(ko);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},Zo.svg.chord=function(){function n(n,a){var c=t(this,i,n,a),s=t(this,o,n,a);return"M"+c.p0+r(c.r,c.p1,c.a1-c.a0)+(e(c,s)?u(c.r,c.p1,c.r,c.p0):u(c.r,c.p1,s.r,s.p0)+r(s.r,s.p1,s.a1-s.a0)+u(s.r,s.p1,c.r,c.p0))+"Z"}function t(n,t,e,r){var u=t.call(n,e,r),i=a.call(n,u,r),o=c.call(n,u,r)+ms,l=s.call(n,u,r)+ms;return{r:i,a0:o,a1:l,p0:[i*Math.cos(o),i*Math.sin(o)],p1:[i*Math.cos(l),i*Math.sin(l)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>ba)+",1 "+t}function u(n,t,e,r){return"Q 0,0 "+r}var i=gr,o=pr,a=Ao,c=to,s=eo;return n.radius=function(t){return arguments.length?(a=bt(t),n):a},n.source=function(t){return arguments.length?(i=bt(t),n):i},n.target=function(t){return arguments.length?(o=bt(t),n):o},n.startAngle=function(t){return arguments.length?(c=bt(t),n):c},n.endAngle=function(t){return arguments.length?(s=bt(t),n):s},n},Zo.svg.diagonal=function(){function n(n,u){var i=t.call(this,n,u),o=e.call(this,n,u),a=(i.y+o.y)/2,c=[i,{x:i.x,y:a},{x:o.x,y:a},o];return c=c.map(r),"M"+c[0]+"C"+c[1]+" "+c[2]+" "+c[3]}var t=gr,e=pr,r=Co;return n.source=function(e){return arguments.length?(t=bt(e),n):t},n.target=function(t){return arguments.length?(e=bt(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},Zo.svg.diagonal.radial=function(){var n=Zo.svg.diagonal(),t=Co,e=n.projection;return n.projection=function(n){return arguments.length?e(No(t=n)):t},n},Zo.svg.symbol=function(){function n(n,r){return(ws.get(t.call(this,n,r))||To)(e.call(this,n,r))}var t=Lo,e=zo;return n.type=function(e){return arguments.length?(t=bt(e),n):t},n.size=function(t){return arguments.length?(e=bt(t),n):e},n};var ws=Zo.map({circle:To,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*As)),e=t*As;return"M0,"+-t+"L"+e+",0"+" 0,"+t+" "+-e+",0"+"Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/Es),e=t*Es/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/Es),e=t*Es/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});Zo.svg.symbolTypes=ws.keys();var Ss,ks,Es=Math.sqrt(3),As=Math.tan(30*Aa),Cs=[],Ns=0;Cs.call=pa.call,Cs.empty=pa.empty,Cs.node=pa.node,Cs.size=pa.size,Zo.transition=function(n){return arguments.length?Ss?n.transition():n:ma.transition()},Zo.transition.prototype=Cs,Cs.select=function(n){var t,e,r,u=this.id,i=[];n=b(n);for(var o=-1,a=this.length;++oi;i++){u.push(t=[]);for(var e=this[i],a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,i)&&t.push(r)}return qo(u,this.id)},Cs.tween=function(n,t){var e=this.id;return arguments.length<2?this.node().__transition__[e].tween.get(n):P(this,null==t?function(t){t.__transition__[e].tween.remove(n)}:function(r){r.__transition__[e].tween.set(n,t)})},Cs.attr=function(n,t){function e(){this.removeAttribute(a)}function r(){this.removeAttributeNS(a.space,a.local)}function u(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(a);return e!==n&&(t=o(e,n),function(n){this.setAttribute(a,t(n))})})}function i(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(a.space,a.local);return e!==n&&(t=o(e,n),function(n){this.setAttributeNS(a.space,a.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?Du:hu,a=Zo.ns.qualify(n);return Ro(this,"attr."+n,t,a.local?i:u)},Cs.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(u));return r&&function(n){this.setAttribute(u,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(u.space,u.local));return r&&function(n){this.setAttributeNS(u.space,u.local,r(n))}}var u=Zo.ns.qualify(n);return this.tween("attr."+n,u.local?r:e)},Cs.style=function(n,t,e){function r(){this.style.removeProperty(n)}function u(t){return null==t?r:(t+="",function(){var r,u=Wo.getComputedStyle(this,null).getPropertyValue(n);return u!==t&&(r=hu(u,t),function(t){this.style.setProperty(n,r(t),e)})})}var i=arguments.length;if(3>i){if("string"!=typeof n){2>i&&(t="");for(e in n)this.style(e,n[e],t);return this}e=""}return Ro(this,"style."+n,t,u)},Cs.styleTween=function(n,t,e){function r(r,u){var i=t.call(this,r,u,Wo.getComputedStyle(this,null).getPropertyValue(n));return i&&function(t){this.style.setProperty(n,i(t),e)}}return arguments.length<3&&(e=""),this.tween("style."+n,r)},Cs.text=function(n){return Ro(this,"text",n,Do)},Cs.remove=function(){return this.each("end.transition",function(){var n;this.__transition__.count<2&&(n=this.parentNode)&&n.removeChild(this)})},Cs.ease=function(n){var t=this.id;return arguments.length<1?this.node().__transition__[t].ease:("function"!=typeof n&&(n=Zo.ease.apply(Zo,arguments)),P(this,function(e){e.__transition__[t].ease=n}))},Cs.delay=function(n){var t=this.id;return arguments.length<1?this.node().__transition__[t].delay:P(this,"function"==typeof n?function(e,r,u){e.__transition__[t].delay=+n.call(e,e.__data__,r,u)}:(n=+n,function(e){e.__transition__[t].delay=n}))},Cs.duration=function(n){var t=this.id;return arguments.length<1?this.node().__transition__[t].duration:P(this,"function"==typeof n?function(e,r,u){e.__transition__[t].duration=Math.max(1,n.call(e,e.__data__,r,u))}:(n=Math.max(1,n),function(e){e.__transition__[t].duration=n}))},Cs.each=function(n,t){var e=this.id;if(arguments.length<2){var r=ks,u=Ss;Ss=e,P(this,function(t,r,u){ks=t.__transition__[e],n.call(t,t.__data__,r,u)}),ks=r,Ss=u}else P(this,function(r){var u=r.__transition__[e];(u.event||(u.event=Zo.dispatch("start","end"))).on(n,t)});return this},Cs.transition=function(){for(var n,t,e,r,u=this.id,i=++Ns,o=[],a=0,c=this.length;c>a;a++){o.push(n=[]);for(var t=this[a],s=0,l=t.length;l>s;s++)(e=t[s])&&(r=Object.create(e.__transition__[u]),r.delay+=r.duration,Po(e,s,i,r)),n.push(e)}return qo(o,i)},Zo.svg.axis=function(){function n(n){n.each(function(){var n,s=Zo.select(this),l=this.__chart__||e,f=this.__chart__=e.copy(),h=null==c?f.ticks?f.ticks.apply(f,a):f.domain():c,g=null==t?f.tickFormat?f.tickFormat.apply(f,a):wt:t,p=s.selectAll(".tick").data(h,f),v=p.enter().insert("g",".domain").attr("class","tick").style("opacity",ka),d=Zo.transition(p.exit()).style("opacity",ka).remove(),m=Zo.transition(p.order()).style("opacity",1),y=Ti(f),x=s.selectAll(".domain").data([0]),M=(x.enter().append("path").attr("class","domain"),Zo.transition(x));v.append("line"),v.append("text");var _=v.select("line"),b=m.select("line"),w=p.select("text").text(g),S=v.select("text"),k=m.select("text");switch(r){case"bottom":n=Uo,_.attr("y2",u),S.attr("y",Math.max(u,0)+o),b.attr("x2",0).attr("y2",u),k.attr("x",0).attr("y",Math.max(u,0)+o),w.attr("dy",".71em").style("text-anchor","middle"),M.attr("d","M"+y[0]+","+i+"V0H"+y[1]+"V"+i);break;case"top":n=Uo,_.attr("y2",-u),S.attr("y",-(Math.max(u,0)+o)),b.attr("x2",0).attr("y2",-u),k.attr("x",0).attr("y",-(Math.max(u,0)+o)),w.attr("dy","0em").style("text-anchor","middle"),M.attr("d","M"+y[0]+","+-i+"V0H"+y[1]+"V"+-i);break;case"left":n=jo,_.attr("x2",-u),S.attr("x",-(Math.max(u,0)+o)),b.attr("x2",-u).attr("y2",0),k.attr("x",-(Math.max(u,0)+o)).attr("y",0),w.attr("dy",".32em").style("text-anchor","end"),M.attr("d","M"+-i+","+y[0]+"H0V"+y[1]+"H"+-i);break;case"right":n=jo,_.attr("x2",u),S.attr("x",Math.max(u,0)+o),b.attr("x2",u).attr("y2",0),k.attr("x",Math.max(u,0)+o).attr("y",0),w.attr("dy",".32em").style("text-anchor","start"),M.attr("d","M"+i+","+y[0]+"H0V"+y[1]+"H"+i)}if(f.rangeBand){var E=f,A=E.rangeBand()/2;l=f=function(n){return E(n)+A}}else l.rangeBand?l=f:d.call(n,f);v.call(n,l),m.call(n,f)})}var t,e=Zo.scale.linear(),r=zs,u=6,i=6,o=3,a=[10],c=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Ls?t+"":zs,n):r},n.ticks=function(){return arguments.length?(a=arguments,n):a},n.tickValues=function(t){return arguments.length?(c=t,n):c},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(u=+t,i=+arguments[e-1],n):u},n.innerTickSize=function(t){return arguments.length?(u=+t,n):u},n.outerTickSize=function(t){return arguments.length?(i=+t,n):i},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var zs="bottom",Ls={top:1,right:1,bottom:1,left:1};Zo.svg.brush=function(){function n(i){i.each(function(){var i=Zo.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",u).on("touchstart.brush",u),o=i.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),i.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=i.selectAll(".resize").data(p,wt);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return Ts[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),a.style("display",n.empty()?"none":null);var l,f=Zo.transition(i),h=Zo.transition(o);c&&(l=Ti(c),h.attr("x",l[0]).attr("width",l[1]-l[0]),e(f)),s&&(l=Ti(s),h.attr("y",l[0]).attr("height",l[1]-l[0]),r(f)),t(f)})}function t(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+l[+/e$/.test(n)]+","+f[+/^s/.test(n)]+")"})}function e(n){n.select(".extent").attr("x",l[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",l[1]-l[0])}function r(n){n.select(".extent").attr("y",f[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1]-f[0])}function u(){function u(){32==Zo.event.keyCode&&(C||(x=null,z[0]-=l[1],z[1]-=f[1],C=2),y())}function p(){32==Zo.event.keyCode&&2==C&&(z[0]+=l[1],z[1]+=f[1],C=0,y())}function v(){var n=Zo.mouse(_),u=!1;M&&(n[0]+=M[0],n[1]+=M[1]),C||(Zo.event.altKey?(x||(x=[(l[0]+l[1])/2,(f[0]+f[1])/2]),z[0]=l[+(n[0]p?(u=r,r=p):u=p),v[0]!=r||v[1]!=u?(e?o=null:i=null,v[0]=r,v[1]=u,!0):void 0}function m(){v(),S.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),Zo.select("body").style("cursor",null),L.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),N(),w({type:"brushend"})}var x,M,_=this,b=Zo.select(Zo.event.target),w=a.of(_,arguments),S=Zo.select(_),k=b.datum(),E=!/^(n|s)$/.test(k)&&c,A=!/^(e|w)$/.test(k)&&s,C=b.classed("extent"),N=I(),z=Zo.mouse(_),L=Zo.select(Wo).on("keydown.brush",u).on("keyup.brush",p);if(Zo.event.changedTouches?L.on("touchmove.brush",v).on("touchend.brush",m):L.on("mousemove.brush",v).on("mouseup.brush",m),S.interrupt().selectAll("*").interrupt(),C)z[0]=l[0]-z[0],z[1]=f[0]-z[1];else if(k){var T=+/w$/.test(k),q=+/^n/.test(k);M=[l[1-T]-z[0],f[1-q]-z[1]],z[0]=l[T],z[1]=f[q]}else Zo.event.altKey&&(x=z.slice());S.style("pointer-events","none").selectAll(".resize").style("display",null),Zo.select("body").style("cursor",b.style("cursor")),w({type:"brushstart"}),v()}var i,o,a=M(n,"brushstart","brush","brushend"),c=null,s=null,l=[0,0],f=[0,0],h=!0,g=!0,p=qs[0];return n.event=function(n){n.each(function(){var n=a.of(this,arguments),t={x:l,y:f,i:i,j:o},e=this.__chart__||t;this.__chart__=t,Ss?Zo.select(this).transition().each("start.brush",function(){i=e.i,o=e.j,l=e.x,f=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=gu(l,t.x),r=gu(f,t.y);return i=o=null,function(u){l=t.x=e(u),f=t.y=r(u),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){i=t.i,o=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(c=t,p=qs[!c<<1|!s],n):c},n.y=function(t){return arguments.length?(s=t,p=qs[!c<<1|!s],n):s},n.clamp=function(t){return arguments.length?(c&&s?(h=!!t[0],g=!!t[1]):c?h=!!t:s&&(g=!!t),n):c&&s?[h,g]:c?h:s?g:null},n.extent=function(t){var e,r,u,a,h;return arguments.length?(c&&(e=t[0],r=t[1],s&&(e=e[0],r=r[0]),i=[e,r],c.invert&&(e=c(e),r=c(r)),e>r&&(h=e,e=r,r=h),(e!=l[0]||r!=l[1])&&(l=[e,r])),s&&(u=t[0],a=t[1],c&&(u=u[1],a=a[1]),o=[u,a],s.invert&&(u=s(u),a=s(a)),u>a&&(h=u,u=a,a=h),(u!=f[0]||a!=f[1])&&(f=[u,a])),n):(c&&(i?(e=i[0],r=i[1]):(e=l[0],r=l[1],c.invert&&(e=c.invert(e),r=c.invert(r)),e>r&&(h=e,e=r,r=h))),s&&(o?(u=o[0],a=o[1]):(u=f[0],a=f[1],s.invert&&(u=s.invert(u),a=s.invert(a)),u>a&&(h=u,u=a,a=h))),c&&s?[[e,u],[r,a]]:c?[e,r]:s&&[u,a])},n.clear=function(){return n.empty()||(l=[0,0],f=[0,0],i=o=null),n},n.empty=function(){return!!c&&l[0]==l[1]||!!s&&f[0]==f[1]},Zo.rebind(n,a,"on")};var Ts={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},qs=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Rs=Qa.format=ic.timeFormat,Ds=Rs.utc,Ps=Ds("%Y-%m-%dT%H:%M:%S.%LZ");Rs.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Ho:Ps,Ho.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},Ho.toString=Ps.toString,Qa.second=Dt(function(n){return new nc(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),Qa.seconds=Qa.second.range,Qa.seconds.utc=Qa.second.utc.range,Qa.minute=Dt(function(n){return new nc(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),Qa.minutes=Qa.minute.range,Qa.minutes.utc=Qa.minute.utc.range,Qa.hour=Dt(function(n){var t=n.getTimezoneOffset()/60;return new nc(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),Qa.hours=Qa.hour.range,Qa.hours.utc=Qa.hour.utc.range,Qa.month=Dt(function(n){return n=Qa.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),Qa.months=Qa.month.range,Qa.months.utc=Qa.month.utc.range;var Us=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],js=[[Qa.second,1],[Qa.second,5],[Qa.second,15],[Qa.second,30],[Qa.minute,1],[Qa.minute,5],[Qa.minute,15],[Qa.minute,30],[Qa.hour,1],[Qa.hour,3],[Qa.hour,6],[Qa.hour,12],[Qa.day,1],[Qa.day,2],[Qa.week,1],[Qa.month,1],[Qa.month,3],[Qa.year,1]],Hs=Rs.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",we]]),Fs={range:function(n,t,e){return Zo.range(Math.ceil(n/e)*e,+t,e).map(Oo)},floor:wt,ceil:wt};js.year=Qa.year,Qa.scale=function(){return Fo(Zo.scale.linear(),js,Hs)};var Os=js.map(function(n){return[n[0].utc,n[1]]}),Ys=Ds.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",we]]);Os.year=Qa.year.utc,Qa.scale.utc=function(){return Fo(Zo.scale.linear(),Os,Ys)},Zo.text=St(function(n){return n.responseText}),Zo.json=function(n,t){return kt(n,"application/json",Yo,t)},Zo.html=function(n,t){return kt(n,"text/html",Io,t)},Zo.xml=St(function(n){return n.responseXML}),"function"==typeof define&&define.amd?define(Zo):"object"==typeof module&&module.exports&&(module.exports=Zo),this.d3=Zo}();
\ No newline at end of file
+// https://d3js.org v5.9.7 Copyright 2019 Mike Bostock
+!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.d3=t.d3||{})}(this,function(t){"use strict";function n(t,n){return tn?1:t>=n?0:NaN}function e(t){var e;return 1===t.length&&(e=t,t=function(t,r){return n(e(t),r)}),{left:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)<0?r=o+1:i=o}return r},right:function(n,e,r,i){for(null==r&&(r=0),null==i&&(i=n.length);r>>1;t(n[o],e)>0?i=o:r=o+1}return r}}}var r=e(n),i=r.right,o=r.left;function a(t,n){return[t,n]}function u(t){return null===t?NaN:+t}function c(t,n){var e,r,i=t.length,o=0,a=-1,c=0,f=0;if(null==n)for(;++a1)return f/(o-1)}function f(t,n){var e=c(t,n);return e?Math.sqrt(e):e}function s(t,n){var e,r,i,o=t.length,a=-1;if(null==n){for(;++a=e)for(r=i=e;++ae&&(r=e),i=e)for(r=i=e;++ae&&(r=e),i0)return[t];if((r=n0)for(t=Math.ceil(t/a),n=Math.floor(n/a),o=new Array(i=Math.ceil(n-t+1));++u=0?(o>=y?10:o>=_?5:o>=b?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=y?10:o>=_?5:o>=b?2:1)}function w(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=y?i*=10:o>=_?i*=5:o>=b&&(i*=2),n=1)return+e(t[r-1],r-1,t);var r,i=(r-1)*n,o=Math.floor(i),a=+e(t[o],o,t);return a+(+e(t[o+1],o+1,t)-a)*(i-o)}}function A(t,n){var e,r,i=t.length,o=-1;if(null==n){for(;++o=e)for(r=e;++or&&(r=e)}else for(;++o=e)for(r=e;++or&&(r=e);return r}function T(t){for(var n,e,r,i=t.length,o=-1,a=0;++o=0;)for(n=(r=t[i]).length;--n>=0;)e[--a]=r[n];return e}function S(t,n){var e,r,i=t.length,o=-1;if(null==n){for(;++o=e)for(r=e;++oe&&(r=e)}else for(;++o=e)for(r=e;++oe&&(r=e);return r}function k(t){if(!(i=t.length))return[];for(var n=-1,e=S(t,E),r=new Array(e);++n=0&&(n=t.slice(e+1),t=t.slice(0,e)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})),a=-1,u=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++a0)for(var e,r,i=new Array(e),o=0;o=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),V.hasOwnProperty(n)?{space:V[n],local:t}:t}function W(t){var n=$(t);return(n.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===G&&n.documentElement.namespaceURI===G?n.createElement(t):n.createElementNS(e,t)}})(n)}function Z(){}function Q(t){return null==t?Z:function(){return this.querySelector(t)}}function J(){return[]}function K(t){return null==t?J:function(){return this.querySelectorAll(t)}}function tt(t){return function(){return this.matches(t)}}function nt(t){return new Array(t.length)}function et(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}et.prototype={constructor:et,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var rt="$";function it(t,n,e,r,i,o){for(var a,u=0,c=n.length,f=o.length;un?1:t>=n?0:NaN}function ut(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function ct(t,n){return t.style.getPropertyValue(n)||ut(t).getComputedStyle(t,null).getPropertyValue(n)}function ft(t){return t.trim().split(/^|\s+/)}function st(t){return t.classList||new lt(t)}function lt(t){this._node=t,this._names=ft(t.getAttribute("class")||"")}function ht(t,n){for(var e=st(t),r=-1,i=n.length;++r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var wt={};(t.event=null,"undefined"!=typeof document)&&("onmouseenter"in document.documentElement||(wt={mouseenter:"mouseover",mouseleave:"mouseout"}));function Mt(t,n,e){return t=Nt(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function Nt(n,e,r){return function(i){var o=t.event;t.event=i;try{n.call(this,this.__data__,e,r)}finally{t.event=o}}}function At(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r=x&&(x=m+1);!(b=y[x])&&++x=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=at);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o1?this.each((null==n?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof n?function(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}:function(t,n,e){return function(){this.style.setProperty(t,n,e)}})(t,n,null==e?"":e)):ct(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?function(t){return function(){delete this[t]}}:"function"==typeof n?function(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}:function(t,n){return function(){this[t]=n}})(t,n)):this.node()[t]},classed:function(t,n){var e=ft(t+"");if(arguments.length<2){for(var r=st(this.node()),i=-1,o=e.length;++i=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}(t+""),a=o.length;if(!(arguments.length<2)){for(u=n?Tt:At,null==e&&(e=!1),r=0;r>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):(n=rn.exec(t))?dn(parseInt(n[1],16)):(n=on.exec(t))?new yn(n[1],n[2],n[3],1):(n=an.exec(t))?new yn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=un.exec(t))?pn(n[1],n[2],n[3],n[4]):(n=cn.exec(t))?pn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=fn.exec(t))?bn(n[1],n[2]/100,n[3]/100,1):(n=sn.exec(t))?bn(n[1],n[2]/100,n[3]/100,n[4]):ln.hasOwnProperty(t)?dn(ln[t]):"transparent"===t?new yn(NaN,NaN,NaN,0):null}function dn(t){return new yn(t>>16&255,t>>8&255,255&t,1)}function pn(t,n,e,r){return r<=0&&(t=n=e=NaN),new yn(t,n,e,r)}function vn(t){return t instanceof Jt||(t=hn(t)),t?new yn((t=t.rgb()).r,t.g,t.b,t.opacity):new yn}function gn(t,n,e,r){return 1===arguments.length?vn(t):new yn(t,n,e,null==r?1:r)}function yn(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function _n(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function bn(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new xn(t,n,e,r)}function mn(t,n,e,r){return 1===arguments.length?function(t){if(t instanceof xn)return new xn(t.h,t.s,t.l,t.opacity);if(t instanceof Jt||(t=hn(t)),!t)return new xn;if(t instanceof xn)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,i=Math.min(n,e,r),o=Math.max(n,e,r),a=NaN,u=o-i,c=(o+i)/2;return u?(a=n===o?(e-r)/u+6*(e0&&c<1?0:a,new xn(a,u,c,t.opacity)}(t):new xn(t,n,e,null==r?1:r)}function xn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function wn(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}Zt(Jt,hn,{displayable:function(){return this.rgb().displayable()},hex:function(){return this.rgb().hex()},toString:function(){return this.rgb()+""}}),Zt(yn,gn,Qt(Jt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new yn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new yn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:function(){return"#"+_n(this.r)+_n(this.g)+_n(this.b)},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),Zt(xn,mn,Qt(Jt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new xn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new xn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,i=2*e-r;return new yn(wn(t>=240?t-240:t+120,i,r),wn(t,i,r),wn(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var Mn=Math.PI/180,Nn=180/Math.PI,An=.96422,Tn=1,Sn=.82521,kn=4/29,En=6/29,Cn=3*En*En,Pn=En*En*En;function zn(t){if(t instanceof Dn)return new Dn(t.l,t.a,t.b,t.opacity);if(t instanceof Fn)return In(t);t instanceof yn||(t=vn(t));var n,e,r=On(t.r),i=On(t.g),o=On(t.b),a=qn((.2225045*r+.7168786*i+.0606169*o)/Tn);return r===i&&i===o?n=e=a:(n=qn((.4360747*r+.3850649*i+.1430804*o)/An),e=qn((.0139322*r+.0971045*i+.7141733*o)/Sn)),new Dn(116*a-16,500*(n-a),200*(a-e),t.opacity)}function Rn(t,n,e,r){return 1===arguments.length?zn(t):new Dn(t,n,e,null==r?1:r)}function Dn(t,n,e,r){this.l=+t,this.a=+n,this.b=+e,this.opacity=+r}function qn(t){return t>Pn?Math.pow(t,1/3):t/Cn+kn}function Ln(t){return t>En?t*t*t:Cn*(t-kn)}function Un(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function On(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Bn(t){if(t instanceof Fn)return new Fn(t.h,t.c,t.l,t.opacity);if(t instanceof Dn||(t=zn(t)),0===t.a&&0===t.b)return new Fn(NaN,0=1?(e=1,n-1):Math.floor(e*n),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,u=r180||e<-180?e-360*Math.round(e/360):e):ee(isNaN(t)?n:t)}function oe(t){return 1==(t=+t)?ae:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):ee(isNaN(n)?e:n)}}function ae(t,n){var e=n-t;return e?re(t,e):ee(isNaN(t)?n:t)}Zt(Jn,Qn,Qt(Jt,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Jn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Jn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*Mn,n=+this.l,e=isNaN(this.s)?0:this.s*n*(1-n),r=Math.cos(t),i=Math.sin(t);return new yn(255*(n+e*(jn*r+Hn*i)),255*(n+e*(Xn*r+Gn*i)),255*(n+e*(Vn*r)),this.opacity)}}));var ue=function t(n){var e=oe(n);function r(t,n){var r=e((t=gn(t)).r,(n=gn(n)).r),i=e(t.g,n.g),o=e(t.b,n.b),a=ae(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=i(n),t.b=o(n),t.opacity=a(n),t+""}}return r.gamma=t,r}(1);function ce(t){return function(n){var e,r,i=n.length,o=new Array(i),a=new Array(i),u=new Array(i);for(e=0;eo&&(i=n.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(e=e[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,c.push({i:a,x:de(e,r)})),o=ge.lastIndex;return o180?n+=360:n-t>180&&(t+=360),o.push({i:e.push(i(e)+"rotate(",null,r)-2,x:de(t,n)})):n&&e.push(i(e)+"rotate("+n+r)}(o.rotate,a.rotate,u,c),function(t,n,e,o){t!==n?o.push({i:e.push(i(e)+"skewX(",null,r)-2,x:de(t,n)}):n&&e.push(i(e)+"skewX("+n+r)}(o.skewX,a.skewX,u,c),function(t,n,e,r,o,a){if(t!==e||n!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:de(t,e)},{i:u-2,x:de(n,r)})}else 1===e&&1===r||o.push(i(o)+"scale("+e+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,c),o=a=null,function(t){for(var n,e=-1,r=c.length;++e=0&&n._call.call(null,t),n=n._next;--Ve}function ur(){Je=(Qe=tr.now())+Ke,Ve=$e=0;try{ar()}finally{Ve=0,function(){var t,n,e=Xe,r=1/0;for(;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Xe=n);Ge=t,fr(r)}(),Je=0}}function cr(){var t=tr.now(),n=t-Qe;n>Ze&&(Ke-=n,Qe=t)}function fr(t){Ve||($e&&($e=clearTimeout($e)),t-Je>24?(t<1/0&&($e=setTimeout(ur,t-tr.now()-Ke)),We&&(We=clearInterval(We))):(We||(Qe=tr.now(),We=setInterval(cr,Ze)),Ve=1,nr(ur)))}function sr(t,n,e){var r=new ir;return n=null==n?0:+n,r.restart(function(e){r.stop(),t(e+n)},n,e),r}ir.prototype=or.prototype={constructor:ir,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?er():+e)+(null==n?0:+n),this._next||Ge===this||(Ge?Ge._next=this:Xe=this,Ge=this),this._call=t,this._time=e,fr()},stop:function(){this._call&&(this._call=null,this._time=1/0,fr())}};var lr=I("start","end","cancel","interrupt"),hr=[],dr=0,pr=1,vr=2,gr=3,yr=4,_r=5,br=6;function mr(t,n,e,r,i,o){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(c){var f,s,l,h;if(e.state!==pr)return u();for(f in i)if((h=i[f]).name===e.name){if(h.state===gr)return sr(o);h.state===yr?(h.state=br,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[f]):+fdr)throw new Error("too late; already scheduled");return e}function wr(t,n){var e=Mr(t,n);if(e.state>gr)throw new Error("too late; already running");return e}function Mr(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Nr(t,n){var e,r,i,o=t.__transition,a=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>vr&&e.state<_r,e.state=br,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete o[i]):a=!1;a&&delete t.__transition}}function Ar(t,n,e){var r=t._id;return t.each(function(){var t=wr(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)}),function(t){return Mr(t,r).value[n]}}function Tr(t,n){var e;return("number"==typeof n?de:n instanceof hn?ue:(e=hn(n))?(n=e,ue):ye)(t,n)}var Sr=Pt.prototype.constructor;function kr(t){return function(){this.style.removeProperty(t)}}var Er=0;function Cr(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function Pr(t){return Pt().transition(t)}function zr(){return++Er}var Rr=Pt.prototype;function Dr(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function qr(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}Cr.prototype=Pr.prototype={constructor:Cr,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=Q(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a=0&&(t=t.slice(0,n)),!t||"start"===t})}(n)?xr:wr;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(n,e),a.on=i}}(e,t,n))},attr:function(t,n){var e=$(t),r="transform"===e?Ee:Tr;return this.attrTween(t,"function"==typeof n?(e.local?function(t,n,e){var r,i,o;return function(){var a,u,c=e(this);if(null!=c)return(a=this.getAttributeNS(t.space,t.local))===(u=c+"")?null:a===r&&u===i?o:(i=u,o=n(r=a,c));this.removeAttributeNS(t.space,t.local)}}:function(t,n,e){var r,i,o;return function(){var a,u,c=e(this);if(null!=c)return(a=this.getAttribute(t))===(u=c+"")?null:a===r&&u===i?o:(i=u,o=n(r=a,c));this.removeAttribute(t)}})(e,r,Ar(this,"attr."+t,n)):null==n?(e.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}})(e):(e.local?function(t,n,e){var r,i,o=e+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===r?i:i=n(r=a,e)}}:function(t,n,e){var r,i,o=e+"";return function(){var a=this.getAttribute(t);return a===o?null:a===r?i:i=n(r=a,e)}})(e,r,n))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=$(t);return this.tween(e,(r.local?function(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttributeNS(t.space,t.local,n(e))}}(t,i)),e}return i._value=n,i}:function(t,n){var e,r;function i(){var i=n.apply(this,arguments);return i!==r&&(e=(r=i)&&function(t,n){return function(e){this.setAttribute(t,n(e))}}(t,i)),e}return i._value=n,i})(r,n))},style:function(t,n,e){var r="transform"==(t+="")?ke:Tr;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var o=ct(this,t),a=(this.style.removeProperty(t),ct(this,t));return o===a?null:o===e&&a===r?i:i=n(e=o,r=a)}}(t,r)).on("end.style."+t,kr(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,o;return function(){var a=ct(this,t),u=e(this),c=u+"";return null==u&&(this.style.removeProperty(t),c=u=ct(this,t)),a===c?null:a===r&&c===i?o:(i=c,o=n(r=a,u))}}(t,r,Ar(this,"style."+t,n))).each(function(t,n){var e,r,i,o,a="style."+n,u="end."+a;return function(){var c=wr(this,t),f=c.on,s=null==c.value[a]?o||(o=kr(n)):void 0;f===e&&i===s||(r=(e=f).copy()).on(u,i=s),c.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,o=e+"";return function(){var a=ct(this,t);return a===o?null:a===r?i:i=n(r=a,e)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,n,e){return function(r){this.style.setProperty(t,n(r),e)}}(t,o,e)),r}return o._value=n,o}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(Ar(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},remove:function(){return this.on("end.remove",(t=this._id,function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}));var t},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=Mr(this.node(),e).tween,o=0,a=i.length;o0&&(r=o-p),M<0?h=d-v:M>0&&(a=u-v),x=gi,L.attr("cursor",wi.selection),B());break;default:return}pi()},!0).on("keyup.brush",function(){switch(t.event.keyCode){case 16:P&&(y=_=P=!1,B());break;case 18:x===_i&&(w<0?s=l:w>0&&(r=o),M<0?h=d:M>0&&(a=u),x=yi,B());break;case 32:x===gi&&(t.event.altKey?(w&&(s=l-p*w,r=o+p*w),M&&(h=d-v*M,a=u+v*M),x=_i):(w<0?s=l:w>0&&(r=o),M<0?h=d:M>0&&(a=u),x=yi),L.attr("cursor",wi[m]),B());break;default:return}pi()},!0).on("mousemove.brush",O,!0).on("mouseup.brush",Y,!0);It(t.event.view)}di(),Nr(b),c.call(b),D.start()}function O(){var t=Ot(b);!P||y||_||(Math.abs(t[0]-R[0])>Math.abs(t[1]-R[1])?_=!0:y=!0),R=t,g=!0,pi(),B()}function B(){var t;switch(p=R[0]-z[0],v=R[1]-z[1],x){case gi:case vi:w&&(p=Math.max(S-r,Math.min(E-s,p)),o=r+p,l=s+p),M&&(v=Math.max(k-a,Math.min(C-h,v)),u=a+v,d=h+v);break;case yi:w<0?(p=Math.max(S-r,Math.min(E-r,p)),o=r+p,l=s):w>0&&(p=Math.max(S-s,Math.min(E-s,p)),o=r,l=s+p),M<0?(v=Math.max(k-a,Math.min(C-a,v)),u=a+v,d=h):M>0&&(v=Math.max(k-h,Math.min(C-h,v)),u=a,d=h+v);break;case _i:w&&(o=Math.max(S,Math.min(E,r-p*w)),l=Math.max(S,Math.min(E,s+p*w))),M&&(u=Math.max(k,Math.min(C,a-v*M)),d=Math.max(k,Math.min(C,h+v*M)))}l1e-6)if(Math.abs(s*u-c*f)>1e-6&&i){var h=e-o,d=r-a,p=u*u+c*c,v=h*h+d*d,g=Math.sqrt(p),y=Math.sqrt(l),_=i*Math.tan((Fi-Math.acos((p+l-v)/(2*g*y)))/2),b=_/y,m=_/g;Math.abs(b-1)>1e-6&&(this._+="L"+(t+b*f)+","+(n+b*s)),this._+="A"+i+","+i+",0,0,"+ +(s*h>f*d)+","+(this._x1=t+m*u)+","+(this._y1=n+m*c)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,r,i,o){t=+t,n=+n;var a=(e=+e)*Math.cos(r),u=e*Math.sin(r),c=t+a,f=n+u,s=1^o,l=o?r-i:i-r;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+c+","+f:(Math.abs(this._x1-c)>1e-6||Math.abs(this._y1-f)>1e-6)&&(this._+="L"+c+","+f),e&&(l<0&&(l=l%Ii+Ii),l>ji?this._+="A"+e+","+e+",0,1,"+s+","+(t-a)+","+(n-u)+"A"+e+","+e+",0,1,"+s+","+(this._x1=c)+","+(this._y1=f):l>1e-6&&(this._+="A"+e+","+e+",0,"+ +(l>=Fi)+","+s+","+(this._x1=t+e*Math.cos(i))+","+(this._y1=n+e*Math.sin(i))))},rect:function(t,n,e,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +r+"h"+-e+"Z"},toString:function(){return this._}};function Qi(){}function Ji(t,n){var e=new Qi;if(t instanceof Qi)t.each(function(t,n){e.set(n,t)});else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==n)for(;++ir!=d>r&&e<(h-f)*(r-s)/(d-s)+f&&(i=-i)}return i}function lo(t,n,e){var r,i,o,a;return function(t,n,e){return(n[0]-t[0])*(e[1]-t[1])==(e[0]-t[0])*(n[1]-t[1])}(t,n,e)&&(i=t[r=+(t[0]===n[0])],o=e[r],a=n[r],i<=o&&o<=a||a<=o&&o<=i)}function ho(){}var po=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function vo(){var t=1,n=1,e=M,r=u;function i(t){var n=e(t);if(Array.isArray(n))n=n.slice().sort(uo);else{var r=s(t),i=r[0],a=r[1];n=w(i,a,n),n=g(Math.floor(i/n)*n,Math.floor(a/n)*n,n)}return n.map(function(n){return o(t,n)})}function o(e,i){var o=[],u=[];return function(e,r,i){var o,u,c,f,s,l,h=new Array,d=new Array;o=u=-1,f=e[0]>=r,po[f<<1].forEach(p);for(;++o=r,po[c|f<<1].forEach(p);po[f<<0].forEach(p);for(;++u=r,s=e[u*t]>=r,po[f<<1|s<<2].forEach(p);++o=r,l=s,s=e[u*t+o+1]>=r,po[c|f<<1|s<<2|l<<3].forEach(p);po[f|s<<3].forEach(p)}o=-1,s=e[u*t]>=r,po[s<<2].forEach(p);for(;++o=r,po[s<<2|l<<3].forEach(p);function p(t){var n,e,r=[t[0][0]+o,t[0][1]+u],c=[t[1][0]+o,t[1][1]+u],f=a(r),s=a(c);(n=d[f])?(e=h[s])?(delete d[n.end],delete h[e.start],n===e?(n.ring.push(c),i(n.ring)):h[n.start]=d[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete d[n.end],n.ring.push(c),d[n.end=s]=n):(n=h[s])?(e=d[f])?(delete h[n.start],delete d[e.end],n===e?(n.ring.push(c),i(n.ring)):h[e.start]=d[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete h[n.start],n.ring.unshift(r),h[n.start=f]=n):h[f]=d[s]={start:f,end:s,ring:[r,c]}}po[s<<3].forEach(p)}(e,i,function(t){r(t,e,i),function(t){for(var n=0,e=t.length,r=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++n0?o.push([t]):u.push(t)}),u.forEach(function(t){for(var n,e=0,r=o.length;e0&&a0&&u0&&o>0))throw new Error("invalid size");return t=r,n=o,i},i.thresholds=function(t){return arguments.length?(e="function"==typeof t?t:Array.isArray(t)?co(ao.call(t)):co(t),i):e},i.smooth=function(t){return arguments.length?(r=t?u:ho,i):r===u},i}function go(t,n,e){for(var r=t.width,i=t.height,o=1+(e<<1),a=0;a=e&&(u>=o&&(c-=t.data[u-o+a*r]),n.data[u-e+a*r]=c/Math.min(u+1,r-1+o-u,o))}function yo(t,n,e){for(var r=t.width,i=t.height,o=1+(e<<1),a=0;a=e&&(u>=o&&(c-=t.data[a+(u-o)*r]),n.data[a+(u-e)*r]=c/Math.min(u+1,i-1+o-u,o))}function _o(t){return t[0]}function bo(t){return t[1]}function mo(){return 1}var xo={},wo={},Mo=34,No=10,Ao=13;function To(t){return new Function("d","return {"+t.map(function(t,n){return JSON.stringify(t)+": d["+n+"]"}).join(",")+"}")}function So(t){var n=Object.create(null),e=[];return t.forEach(function(t){for(var r in t)r in n||e.push(n[r]=r)}),e}function ko(t,n){var e=t+"",r=e.length;return r9999?"+"+ko(n,6):ko(n,4))+"-"+ko(t.getUTCMonth()+1,2)+"-"+ko(t.getUTCDate(),2)+(o?"T"+ko(e,2)+":"+ko(r,2)+":"+ko(i,2)+"."+ko(o,3)+"Z":i?"T"+ko(e,2)+":"+ko(r,2)+":"+ko(i,2)+"Z":r||e?"T"+ko(e,2)+":"+ko(r,2)+"Z":"")}function Co(t){var n=new RegExp('["'+t+"\n\r]"),e=t.charCodeAt(0);function r(t,n){var r,i=[],o=t.length,a=0,u=0,c=o<=0,f=!1;function s(){if(c)return wo;if(f)return f=!1,xo;var n,r,i=a;if(t.charCodeAt(i)===Mo){for(;a++=o?c=!0:(r=t.charCodeAt(a++))===No?f=!0:r===Ao&&(f=!0,t.charCodeAt(a)===No&&++a),t.slice(i+1,n-1).replace(/""/g,'"')}for(;a=(o=(v+y)/2))?v=o:y=o,(s=e>=(a=(g+_)/2))?g=a:_=a,i=d,!(d=d[l=s<<1|f]))return i[l]=p,t;if(u=+t._x.call(null,d.data),c=+t._y.call(null,d.data),n===u&&e===c)return p.next=d,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(f=n>=(o=(v+y)/2))?v=o:y=o,(s=e>=(a=(g+_)/2))?g=a:_=a}while((l=s<<1|f)==(h=(c>=a)<<1|u>=o));return i[h]=d,i[l]=p,t}function ia(t,n,e,r,i){this.node=t,this.x0=n,this.y0=e,this.x1=r,this.y1=i}function oa(t){return t[0]}function aa(t){return t[1]}function ua(t,n,e){var r=new ca(null==n?oa:n,null==e?aa:e,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function ca(t,n,e,r,i,o){this._x=t,this._y=n,this._x0=e,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function fa(t){for(var n={data:t.data},e=n;t=t.next;)e=e.next={data:t.data};return n}var sa=ua.prototype=ca.prototype;function la(t){return t.x+t.vx}function ha(t){return t.y+t.vy}function da(t){return t.index}function pa(t,n){var e=t.get(n);if(!e)throw new Error("missing: "+n);return e}function va(t){return t.x}function ga(t){return t.y}sa.copy=function(){var t,n,e=new ca(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return e;if(!r.length)return e._root=fa(r),e;for(t=[{source:r,target:e._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(n=r.source[i])&&(n.length?t.push({source:n,target:r.target[i]=new Array(4)}):r.target[i]=fa(n));return e},sa.add=function(t){var n=+this._x.call(null,t),e=+this._y.call(null,t);return ra(this.cover(n,e),n,e,t)},sa.addAll=function(t){var n,e,r,i,o=t.length,a=new Array(o),u=new Array(o),c=1/0,f=1/0,s=-1/0,l=-1/0;for(e=0;es&&(s=r),il&&(l=i));if(c>s||f>l)return this;for(this.cover(c,f).cover(s,l),e=0;et||t>=i||r>n||n>=o;)switch(u=(nh||(o=c.y0)>d||(a=c.x1)=y)<<1|t>=g)&&(c=p[p.length-1],p[p.length-1]=p[p.length-1-f],p[p.length-1-f]=c)}else{var _=t-+this._x.call(null,v.data),b=n-+this._y.call(null,v.data),m=_*_+b*b;if(m=(u=(p+g)/2))?p=u:g=u,(s=a>=(c=(v+y)/2))?v=c:y=c,n=d,!(d=d[l=s<<1|f]))return this;if(!d.length)break;(n[l+1&3]||n[l+2&3]||n[l+3&3])&&(e=n,h=l)}for(;d.data!==t;)if(r=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,r?(i?r.next=i:delete r.next,this):n?(i?n[l]=i:delete n[l],(d=n[0]||n[1]||n[2]||n[3])&&d===(n[3]||n[2]||n[1]||n[0])&&!d.length&&(e?e[h]=d:this._root=d),this):(this._root=i,this)},sa.removeAll=function(t){for(var n=0,e=t.length;n1?r[0]+r.slice(2):r,+t.slice(e+1)]}function ma(t){return(t=ba(Math.abs(t)))?t[1]:NaN}var xa,wa=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ma(t){return new Na(t)}function Na(t){if(!(n=wa.exec(t)))throw new Error("invalid format: "+t);var n;this.fill=n[1]||" ",this.align=n[2]||">",this.sign=n[3]||"-",this.symbol=n[4]||"",this.zero=!!n[5],this.width=n[6]&&+n[6],this.comma=!!n[7],this.precision=n[8]&&+n[8].slice(1),this.trim=!!n[9],this.type=n[10]||""}function Aa(t,n){var e=ba(t,n);if(!e)return t+"";var r=e[0],i=e[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}Ma.prototype=Na.prototype,Na.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(null==this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(null==this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Ta={"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.round(t).toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return Aa(100*t,n)},r:Aa,s:function(t,n){var e=ba(t,n);if(!e)return t+"";var r=e[0],i=e[1],o=i-(xa=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+ba(t,Math.max(0,n+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function Sa(t){return t}var ka,Ea=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Ca(t){var n,e,r=t.grouping&&t.thousands?(n=t.grouping,e=t.thousands,function(t,r){for(var i=t.length,o=[],a=0,u=n[0],c=0;i>0&&u>0&&(c+u+1>r&&(u=Math.max(1,r-c)),o.push(t.substring(i-=u,i+u)),!((c+=u+1)>r));)u=n[a=(a+1)%n.length];return o.reverse().join(e)}):Sa,i=t.currency,o=t.decimal,a=t.numerals?function(t){return function(n){return n.replace(/[0-9]/g,function(n){return t[+n]})}}(t.numerals):Sa,u=t.percent||"%";function c(t){var n=(t=Ma(t)).fill,e=t.align,c=t.sign,f=t.symbol,s=t.zero,l=t.width,h=t.comma,d=t.precision,p=t.trim,v=t.type;"n"===v?(h=!0,v="g"):Ta[v]||(null==d&&(d=12),p=!0,v="g"),(s||"0"===n&&"="===e)&&(s=!0,n="0",e="=");var g="$"===f?i[0]:"#"===f&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",y="$"===f?i[1]:/[%p]/.test(v)?u:"",_=Ta[v],b=/[defgprs%]/.test(v);function m(t){var i,u,f,m=g,x=y;if("c"===v)x=_(t)+x,t="";else{var w=(t=+t)<0;if(t=_(Math.abs(t),d),p&&(t=function(t){t:for(var n,e=t.length,r=1,i=-1;r0){if(!+t[r])break t;i=0}}return i>0?t.slice(0,i)+t.slice(n+1):t}(t)),w&&0==+t&&(w=!1),m=(w?"("===c?c:"-":"-"===c||"("===c?"":c)+m,x=("s"===v?Ea[8+xa/3]:"")+x+(w&&"("===c?")":""),b)for(i=-1,u=t.length;++i(f=t.charCodeAt(i))||f>57){x=(46===f?o+t.slice(i+1):t.slice(i))+x,t=t.slice(0,i);break}}h&&!s&&(t=r(t,1/0));var M=m.length+t.length+x.length,N=M>1)+m+t+x+N.slice(M);break;default:t=N+m+t+x}return a(t)}return d=null==d?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,d)):Math.max(0,Math.min(20,d)),m.toString=function(){return t+""},m}return{format:c,formatPrefix:function(t,n){var e=c(((t=Ma(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(ma(n)/3))),i=Math.pow(10,-r),o=Ea[8+r/3];return function(t){return e(i*t)+o}}}}function Pa(n){return ka=Ca(n),t.format=ka.format,t.formatPrefix=ka.formatPrefix,ka}function za(t){return Math.max(0,-ma(Math.abs(t)))}function Ra(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(ma(n)/3)))-ma(Math.abs(t)))}function Da(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,ma(n)-ma(t))+1}function qa(){return new La}function La(){this.reset()}Pa({decimal:".",thousands:",",grouping:[3],currency:["$",""]}),La.prototype={constructor:La,reset:function(){this.s=this.t=0},add:function(t){Oa(Ua,t,this.t),Oa(this,Ua.s,this.s),this.s?this.t+=Ua.t:this.s=Ua.t},valueOf:function(){return this.s}};var Ua=new La;function Oa(t,n,e){var r=t.s=n+e,i=r-n,o=r-i;t.t=n-o+(e-i)}var Ba=1e-6,Ya=1e-12,Fa=Math.PI,Ia=Fa/2,ja=Fa/4,Ha=2*Fa,Xa=180/Fa,Ga=Fa/180,Va=Math.abs,$a=Math.atan,Wa=Math.atan2,Za=Math.cos,Qa=Math.ceil,Ja=Math.exp,Ka=Math.log,tu=Math.pow,nu=Math.sin,eu=Math.sign||function(t){return t>0?1:t<0?-1:0},ru=Math.sqrt,iu=Math.tan;function ou(t){return t>1?0:t<-1?Fa:Math.acos(t)}function au(t){return t>1?Ia:t<-1?-Ia:Math.asin(t)}function uu(t){return(t=nu(t/2))*t}function cu(){}function fu(t,n){t&&lu.hasOwnProperty(t.type)&&lu[t.type](t,n)}var su={Feature:function(t,n){fu(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r=0?1:-1,i=r*e,o=Za(n=(n*=Ga)/2+ja),a=nu(n),u=bu*a,c=_u*o+u*Za(i),f=u*r*nu(i);mu.add(Wa(f,c)),yu=t,_u=o,bu=a}function Su(t){return[Wa(t[1],t[0]),au(t[2])]}function ku(t){var n=t[0],e=t[1],r=Za(e);return[r*Za(n),r*nu(n),nu(e)]}function Eu(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]}function Cu(t,n){return[t[1]*n[2]-t[2]*n[1],t[2]*n[0]-t[0]*n[2],t[0]*n[1]-t[1]*n[0]]}function Pu(t,n){t[0]+=n[0],t[1]+=n[1],t[2]+=n[2]}function zu(t,n){return[t[0]*n,t[1]*n,t[2]*n]}function Ru(t){var n=ru(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=n,t[1]/=n,t[2]/=n}var Du,qu,Lu,Uu,Ou,Bu,Yu,Fu,Iu,ju,Hu,Xu,Gu,Vu,$u,Wu,Zu,Qu,Ju,Ku,tc,nc,ec,rc,ic,oc,ac=qa(),uc={point:cc,lineStart:sc,lineEnd:lc,polygonStart:function(){uc.point=hc,uc.lineStart=dc,uc.lineEnd=pc,ac.reset(),wu.polygonStart()},polygonEnd:function(){wu.polygonEnd(),uc.point=cc,uc.lineStart=sc,uc.lineEnd=lc,mu<0?(Du=-(Lu=180),qu=-(Uu=90)):ac>Ba?Uu=90:ac<-Ba&&(qu=-90),ju[0]=Du,ju[1]=Lu},sphere:function(){Du=-(Lu=180),qu=-(Uu=90)}};function cc(t,n){Iu.push(ju=[Du=t,Lu=t]),nUu&&(Uu=n)}function fc(t,n){var e=ku([t*Ga,n*Ga]);if(Fu){var r=Cu(Fu,e),i=Cu([r[1],-r[0],0],r);Ru(i),i=Su(i);var o,a=t-Ou,u=a>0?1:-1,c=i[0]*Xa*u,f=Va(a)>180;f^(u*OuUu&&(Uu=o):f^(u*Ou<(c=(c+360)%360-180)&&cUu&&(Uu=n)),f?tvc(Du,Lu)&&(Lu=t):vc(t,Lu)>vc(Du,Lu)&&(Du=t):Lu>=Du?(tLu&&(Lu=t)):t>Ou?vc(Du,t)>vc(Du,Lu)&&(Lu=t):vc(t,Lu)>vc(Du,Lu)&&(Du=t)}else Iu.push(ju=[Du=t,Lu=t]);nUu&&(Uu=n),Fu=e,Ou=t}function sc(){uc.point=fc}function lc(){ju[0]=Du,ju[1]=Lu,uc.point=cc,Fu=null}function hc(t,n){if(Fu){var e=t-Ou;ac.add(Va(e)>180?e+(e>0?360:-360):e)}else Bu=t,Yu=n;wu.point(t,n),fc(t,n)}function dc(){wu.lineStart()}function pc(){hc(Bu,Yu),wu.lineEnd(),Va(ac)>Ba&&(Du=-(Lu=180)),ju[0]=Du,ju[1]=Lu,Fu=null}function vc(t,n){return(n-=t)<0?n+360:n}function gc(t,n){return t[0]-n[0]}function yc(t,n){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:nFa?t+Math.round(-t/Ha)*Ha:t,n]}function zc(t,n,e){return(t%=Ha)?n||e?Cc(Dc(t),qc(n,e)):Dc(t):n||e?qc(n,e):Pc}function Rc(t){return function(n,e){return[(n+=t)>Fa?n-Ha:n<-Fa?n+Ha:n,e]}}function Dc(t){var n=Rc(t);return n.invert=Rc(-t),n}function qc(t,n){var e=Za(t),r=nu(t),i=Za(n),o=nu(n);function a(t,n){var a=Za(n),u=Za(t)*a,c=nu(t)*a,f=nu(n),s=f*e+u*r;return[Wa(c*i-s*o,u*e-f*r),au(s*i+c*o)]}return a.invert=function(t,n){var a=Za(n),u=Za(t)*a,c=nu(t)*a,f=nu(n),s=f*i-c*o;return[Wa(c*i+f*o,u*e+s*r),au(s*e-u*r)]},a}function Lc(t){function n(n){return(n=t(n[0]*Ga,n[1]*Ga))[0]*=Xa,n[1]*=Xa,n}return t=zc(t[0]*Ga,t[1]*Ga,t.length>2?t[2]*Ga:0),n.invert=function(n){return(n=t.invert(n[0]*Ga,n[1]*Ga))[0]*=Xa,n[1]*=Xa,n},n}function Uc(t,n,e,r,i,o){if(e){var a=Za(n),u=nu(n),c=r*e;null==i?(i=n+r*Ha,o=n-c/2):(i=Oc(a,i),o=Oc(a,o),(r>0?io)&&(i+=r*Ha));for(var f,s=i;r>0?s>o:s1&&n.push(n.pop().concat(n.shift()))},result:function(){var e=n;return n=[],t=null,e}}}function Yc(t,n){return Va(t[0]-n[0])=0;--o)i.point((s=f[o])[0],s[1]);else r(h.x,h.p.x,-1,i);h=h.p}f=(h=h.o).z,d=!d}while(!h.v);i.lineEnd()}}}function jc(t){if(n=t.length){for(var n,e,r=0,i=t[0];++r=0?1:-1,A=N*M,T=A>Fa,S=v*x;if(Hc.add(Wa(S*N*nu(A),g*w+S*Za(A))),a+=T?M+N*Ha:M,T^d>=e^b>=e){var k=Cu(ku(h),ku(_));Ru(k);var E=Cu(o,k);Ru(E);var C=(T^M>=0?-1:1)*au(E[2]);(r>C||r===C&&(k[0]||k[1]))&&(u+=T^M>=0?1:-1)}}return(a<-Ba||a0){for(l||(i.polygonStart(),l=!0),i.lineStart(),t=0;t1&&2&c&&h.push(h.pop().concat(h.shift())),a.push(h.filter($c))}return h}}function $c(t){return t.length>1}function Wc(t,n){return((t=t.x)[0]<0?t[1]-Ia-Ba:Ia-t[1])-((n=n.x)[0]<0?n[1]-Ia-Ba:Ia-n[1])}var Zc=Vc(function(){return!0},function(t){var n,e=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),n=1},point:function(o,a){var u=o>0?Fa:-Fa,c=Va(o-e);Va(c-Fa)0?Ia:-Ia),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(o,r),n=0):i!==u&&c>=Fa&&(Va(e-i)Ba?$a((nu(n)*(o=Za(r))*nu(e)-nu(r)*(i=Za(n))*nu(t))/(i*o*a)):(n+r)/2}(e,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),n=0),t.point(e=o,r=a),i=u},lineEnd:function(){t.lineEnd(),e=r=NaN},clean:function(){return 2-n}}},function(t,n,e,r){var i;if(null==t)i=e*Ia,r.point(-Fa,i),r.point(0,i),r.point(Fa,i),r.point(Fa,0),r.point(Fa,-i),r.point(0,-i),r.point(-Fa,-i),r.point(-Fa,0),r.point(-Fa,i);else if(Va(t[0]-n[0])>Ba){var o=t[0]0,i=Va(n)>Ba;function o(t,e){return Za(t)*Za(e)>n}function a(t,e,r){var i=[1,0,0],o=Cu(ku(t),ku(e)),a=Eu(o,o),u=o[0],c=a-u*u;if(!c)return!r&&t;var f=n*a/c,s=-n*u/c,l=Cu(i,o),h=zu(i,f);Pu(h,zu(o,s));var d=l,p=Eu(h,d),v=Eu(d,d),g=p*p-v*(Eu(h,h)-1);if(!(g<0)){var y=ru(g),_=zu(d,(-p-y)/v);if(Pu(_,h),_=Su(_),!r)return _;var b,m=t[0],x=e[0],w=t[1],M=e[1];x0^_[1]<(Va(_[0]-m)Fa^(m<=_[0]&&_[0]<=x)){var T=zu(d,(-p+y)/v);return Pu(T,h),[_,Su(T)]}}}function u(n,e){var i=r?t:Fa-t,o=0;return n<-i?o|=1:n>i&&(o|=2),e<-i?o|=4:e>i&&(o|=8),o}return Vc(o,function(t){var n,e,c,f,s;return{lineStart:function(){f=c=!1,s=1},point:function(l,h){var d,p=[l,h],v=o(l,h),g=r?v?0:u(l,h):v?u(l+(l<0?Fa:-Fa),h):0;if(!n&&(f=c=v)&&t.lineStart(),v!==c&&(!(d=a(n,p))||Yc(n,d)||Yc(p,d))&&(p[0]+=Ba,p[1]+=Ba,v=o(p[0],p[1])),v!==c)s=0,v?(t.lineStart(),d=a(p,n),t.point(d[0],d[1])):(d=a(n,p),t.point(d[0],d[1]),t.lineEnd()),n=d;else if(i&&n&&r^v){var y;g&e||!(y=a(p,n,!0))||(s=0,r?(t.lineStart(),t.point(y[0][0],y[0][1]),t.point(y[1][0],y[1][1]),t.lineEnd()):(t.point(y[1][0],y[1][1]),t.lineEnd(),t.lineStart(),t.point(y[0][0],y[0][1])))}!v||n&&Yc(n,p)||t.point(p[0],p[1]),n=p,c=v,e=g},lineEnd:function(){c&&t.lineEnd(),n=null},clean:function(){return s|(f&&c)<<1}}},function(n,r,i,o){Uc(o,t,e,i,n,r)},r?[0,-t]:[-Fa,t-Fa])}var Jc=1e9,Kc=-Jc;function tf(t,n,e,r){function i(i,o){return t<=i&&i<=e&&n<=o&&o<=r}function o(i,o,u,f){var s=0,l=0;if(null==i||(s=a(i,u))!==(l=a(o,u))||c(i,o)<0^u>0)do{f.point(0===s||3===s?t:e,s>1?r:n)}while((s=(s+u+4)%4)!==l);else f.point(o[0],o[1])}function a(r,i){return Va(r[0]-t)0?0:3:Va(r[0]-e)0?2:1:Va(r[1]-n)0?1:0:i>0?3:2}function u(t,n){return c(t.x,n.x)}function c(t,n){var e=a(t,1),r=a(n,1);return e!==r?e-r:0===e?n[1]-t[1]:1===e?t[0]-n[0]:2===e?t[1]-n[1]:n[0]-t[0]}return function(a){var c,f,s,l,h,d,p,v,g,y,_,b=a,m=Bc(),x={point:w,lineStart:function(){x.point=M,f&&f.push(s=[]);y=!0,g=!1,p=v=NaN},lineEnd:function(){c&&(M(l,h),d&&g&&m.rejoin(),c.push(m.result()));x.point=w,g&&b.lineEnd()},polygonStart:function(){b=m,c=[],f=[],_=!0},polygonEnd:function(){var n=function(){for(var n=0,e=0,i=f.length;er&&(h-o)*(r-a)>(d-a)*(t-o)&&++n:d<=r&&(h-o)*(r-a)<(d-a)*(t-o)&&--n;return n}(),e=_&&n,i=(c=T(c)).length;(e||i)&&(a.polygonStart(),e&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&Ic(c,u,n,o,a),a.polygonEnd());b=a,c=f=s=null}};function w(t,n){i(t,n)&&b.point(t,n)}function M(o,a){var u=i(o,a);if(f&&s.push([o,a]),y)l=o,h=a,d=u,y=!1,u&&(b.lineStart(),b.point(o,a));else if(u&&g)b.point(o,a);else{var c=[p=Math.max(Kc,Math.min(Jc,p)),v=Math.max(Kc,Math.min(Jc,v))],m=[o=Math.max(Kc,Math.min(Jc,o)),a=Math.max(Kc,Math.min(Jc,a))];!function(t,n,e,r,i,o){var a,u=t[0],c=t[1],f=0,s=1,l=n[0]-u,h=n[1]-c;if(a=e-u,l||!(a>0)){if(a/=l,l<0){if(a0){if(a>s)return;a>f&&(f=a)}if(a=i-u,l||!(a<0)){if(a/=l,l<0){if(a>s)return;a>f&&(f=a)}else if(l>0){if(a0)){if(a/=h,h<0){if(a0){if(a>s)return;a>f&&(f=a)}if(a=o-c,h||!(a<0)){if(a/=h,h<0){if(a>s)return;a>f&&(f=a)}else if(h>0){if(a0&&(t[0]=u+f*l,t[1]=c+f*h),s<1&&(n[0]=u+s*l,n[1]=c+s*h),!0}}}}}(c,m,t,n,e,r)?u&&(b.lineStart(),b.point(o,a),_=!1):(g||(b.lineStart(),b.point(c[0],c[1])),b.point(m[0],m[1]),u||b.lineEnd(),_=!1)}p=o,v=a,g=u}return x}}var nf,ef,rf,of=qa(),af={sphere:cu,point:cu,lineStart:function(){af.point=cf,af.lineEnd=uf},lineEnd:cu,polygonStart:cu,polygonEnd:cu};function uf(){af.point=af.lineEnd=cu}function cf(t,n){nf=t*=Ga,ef=nu(n*=Ga),rf=Za(n),af.point=ff}function ff(t,n){t*=Ga;var e=nu(n*=Ga),r=Za(n),i=Va(t-nf),o=Za(i),a=r*nu(i),u=rf*e-ef*r*o,c=ef*e+rf*r*o;of.add(Wa(ru(a*a+u*u),c)),nf=t,ef=e,rf=r}function sf(t){return of.reset(),pu(t,af),+of}var lf=[null,null],hf={type:"LineString",coordinates:lf};function df(t,n){return lf[0]=t,lf[1]=n,sf(hf)}var pf={Feature:function(t,n){return gf(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r0&&(i=df(t[o],t[o-1]))>0&&e<=i&&r<=i&&(e+r-i)*(1-Math.pow((e-r)/i,2))Ba}).map(c)).concat(g(Qa(o/d)*d,i,d).filter(function(t){return Va(t%v)>Ba}).map(f))}return _.lines=function(){return b().map(function(t){return{type:"LineString",coordinates:t}})},_.outline=function(){return{type:"Polygon",coordinates:[s(r).concat(l(a).slice(1),s(e).reverse().slice(1),l(u).reverse().slice(1))]}},_.extent=function(t){return arguments.length?_.extentMajor(t).extentMinor(t):_.extentMinor()},_.extentMajor=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],u=+t[0][1],a=+t[1][1],r>e&&(t=r,r=e,e=t),u>a&&(t=u,u=a,a=t),_.precision(y)):[[r,u],[e,a]]},_.extentMinor=function(e){return arguments.length?(n=+e[0][0],t=+e[1][0],o=+e[0][1],i=+e[1][1],n>t&&(e=n,n=t,t=e),o>i&&(e=o,o=i,i=e),_.precision(y)):[[n,o],[t,i]]},_.step=function(t){return arguments.length?_.stepMajor(t).stepMinor(t):_.stepMinor()},_.stepMajor=function(t){return arguments.length?(p=+t[0],v=+t[1],_):[p,v]},_.stepMinor=function(t){return arguments.length?(h=+t[0],d=+t[1],_):[h,d]},_.precision=function(h){return arguments.length?(y=+h,c=wf(o,i,90),f=Mf(n,t,y),s=wf(u,a,90),l=Mf(r,e,y),_):y},_.extentMajor([[-180,-90+Ba],[180,90-Ba]]).extentMinor([[-180,-80-Ba],[180,80+Ba]])}function Af(t){return t}var Tf,Sf,kf,Ef,Cf=qa(),Pf=qa(),zf={point:cu,lineStart:cu,lineEnd:cu,polygonStart:function(){zf.lineStart=Rf,zf.lineEnd=Lf},polygonEnd:function(){zf.lineStart=zf.lineEnd=zf.point=cu,Cf.add(Va(Pf)),Pf.reset()},result:function(){var t=Cf/2;return Cf.reset(),t}};function Rf(){zf.point=Df}function Df(t,n){zf.point=qf,Tf=kf=t,Sf=Ef=n}function qf(t,n){Pf.add(Ef*t-kf*n),kf=t,Ef=n}function Lf(){qf(Tf,Sf)}var Uf=1/0,Of=Uf,Bf=-Uf,Yf=Bf,Ff={point:function(t,n){tBf&&(Bf=t);nYf&&(Yf=n)},lineStart:cu,lineEnd:cu,polygonStart:cu,polygonEnd:cu,result:function(){var t=[[Uf,Of],[Bf,Yf]];return Bf=Yf=-(Of=Uf=1/0),t}};var If,jf,Hf,Xf,Gf=0,Vf=0,$f=0,Wf=0,Zf=0,Qf=0,Jf=0,Kf=0,ts=0,ns={point:es,lineStart:rs,lineEnd:as,polygonStart:function(){ns.lineStart=us,ns.lineEnd=cs},polygonEnd:function(){ns.point=es,ns.lineStart=rs,ns.lineEnd=as},result:function(){var t=ts?[Jf/ts,Kf/ts]:Qf?[Wf/Qf,Zf/Qf]:$f?[Gf/$f,Vf/$f]:[NaN,NaN];return Gf=Vf=$f=Wf=Zf=Qf=Jf=Kf=ts=0,t}};function es(t,n){Gf+=t,Vf+=n,++$f}function rs(){ns.point=is}function is(t,n){ns.point=os,es(Hf=t,Xf=n)}function os(t,n){var e=t-Hf,r=n-Xf,i=ru(e*e+r*r);Wf+=i*(Hf+t)/2,Zf+=i*(Xf+n)/2,Qf+=i,es(Hf=t,Xf=n)}function as(){ns.point=es}function us(){ns.point=fs}function cs(){ss(If,jf)}function fs(t,n){ns.point=ss,es(If=Hf=t,jf=Xf=n)}function ss(t,n){var e=t-Hf,r=n-Xf,i=ru(e*e+r*r);Wf+=i*(Hf+t)/2,Zf+=i*(Xf+n)/2,Qf+=i,Jf+=(i=Xf*t-Hf*n)*(Hf+t),Kf+=i*(Xf+n),ts+=3*i,es(Hf=t,Xf=n)}function ls(t){this._context=t}ls.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._context.moveTo(t,n),this._point=1;break;case 1:this._context.lineTo(t,n);break;default:this._context.moveTo(t+this._radius,n),this._context.arc(t,n,this._radius,0,Ha)}},result:cu};var hs,ds,ps,vs,gs,ys=qa(),_s={point:cu,lineStart:function(){_s.point=bs},lineEnd:function(){hs&&ms(ds,ps),_s.point=cu},polygonStart:function(){hs=!0},polygonEnd:function(){hs=null},result:function(){var t=+ys;return ys.reset(),t}};function bs(t,n){_s.point=ms,ds=vs=t,ps=gs=n}function ms(t,n){vs-=t,gs-=n,ys.add(ru(vs*vs+gs*gs)),vs=t,gs=n}function xs(){this._string=[]}function ws(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Ms(t){return function(n){var e=new Ns;for(var r in t)e[r]=t[r];return e.stream=n,e}}function Ns(){}function As(t,n,e){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),pu(e,t.stream(Ff)),n(Ff.result()),null!=r&&t.clipExtent(r),t}function Ts(t,n,e){return As(t,function(e){var r=n[1][0]-n[0][0],i=n[1][1]-n[0][1],o=Math.min(r/(e[1][0]-e[0][0]),i/(e[1][1]-e[0][1])),a=+n[0][0]+(r-o*(e[1][0]+e[0][0]))/2,u=+n[0][1]+(i-o*(e[1][1]+e[0][1]))/2;t.scale(150*o).translate([a,u])},e)}function Ss(t,n,e){return Ts(t,[[0,0],n],e)}function ks(t,n,e){return As(t,function(e){var r=+n,i=r/(e[1][0]-e[0][0]),o=(r-i*(e[1][0]+e[0][0]))/2,a=-i*e[0][1];t.scale(150*i).translate([o,a])},e)}function Es(t,n,e){return As(t,function(e){var r=+n,i=r/(e[1][1]-e[0][1]),o=-i*e[0][0],a=(r-i*(e[1][1]+e[0][1]))/2;t.scale(150*i).translate([o,a])},e)}xs.prototype={_radius:4.5,_circle:ws(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,n){switch(this._point){case 0:this._string.push("M",t,",",n),this._point=1;break;case 1:this._string.push("L",t,",",n);break;default:null==this._circle&&(this._circle=ws(this._radius)),this._string.push("M",t,",",n,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}},Ns.prototype={constructor:Ns,point:function(t,n){this.stream.point(t,n)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var Cs=16,Ps=Za(30*Ga);function zs(t,n){return+n?function(t,n){function e(r,i,o,a,u,c,f,s,l,h,d,p,v,g){var y=f-r,_=s-i,b=y*y+_*_;if(b>4*n&&v--){var m=a+h,x=u+d,w=c+p,M=ru(m*m+x*x+w*w),N=au(w/=M),A=Va(Va(w)-1)n||Va((y*E+_*C)/b-.5)>.3||a*h+u*d+c*p2?t[2]%360*Ga:0,S()):[g*Xa,y*Xa,_*Xa]},A.angle=function(t){return arguments.length?(b=t%360*Ga,S()):b*Xa},A.precision=function(t){return arguments.length?(a=zs(u,N=t*t),k()):ru(N)},A.fitExtent=function(t,n){return Ts(A,t,n)},A.fitSize=function(t,n){return Ss(A,t,n)},A.fitWidth=function(t,n){return ks(A,t,n)},A.fitHeight=function(t,n){return Es(A,t,n)},function(){return n=t.apply(this,arguments),A.invert=n.invert&&T,S()}}function Us(t){var n=0,e=Fa/3,r=Ls(t),i=r(n,e);return i.parallels=function(t){return arguments.length?r(n=t[0]*Ga,e=t[1]*Ga):[n*Xa,e*Xa]},i}function Os(t,n){var e=nu(t),r=(e+nu(n))/2;if(Va(r)0?n<-Ia+Ba&&(n=-Ia+Ba):n>Ia-Ba&&(n=Ia-Ba);var e=i/tu(Vs(n),r);return[e*nu(r*t),i-e*Za(r*t)]}return o.invert=function(t,n){var e=i-n,o=eu(r)*ru(t*t+e*e);return[Wa(t,Va(e))/r*eu(e),2*$a(tu(i/o,1/r))-Ia]},o}function Ws(t,n){return[t,n]}function Zs(t,n){var e=Za(t),r=t===n?nu(t):(e-Za(n))/(n-t),i=e/r+t;if(Va(r)=0;)n+=e[r].value;else n=1;t.value=n}function dl(t,n){var e,r,i,o,a,u=new yl(t),c=+t.value&&(u.value=t.value),f=[u];for(null==n&&(n=pl);e=f.pop();)if(c&&(e.value=+e.data.value),(i=n(e.data))&&(a=i.length))for(e.children=new Array(a),o=a-1;o>=0;--o)f.push(r=e.children[o]=new yl(i[o])),r.parent=e,r.depth=e.depth+1;return u.eachBefore(gl)}function pl(t){return t.children}function vl(t){t.data=t.data.data}function gl(t){var n=0;do{t.height=n}while((t=t.parent)&&t.height<++n)}function yl(t){this.data=t,this.depth=this.height=0,this.parent=null}el.invert=function(t,n){for(var e,r=n,i=r*r,o=i*i*i,a=0;a<12&&(o=(i=(r-=e=(r*(Qs+Js*i+o*(Ks+tl*i))-n)/(Qs+3*Js*i+o*(7*Ks+9*tl*i)))*r)*i*i,!(Va(e)Ba&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]},al.invert=Is(au),ul.invert=Is(function(t){return 2*$a(t)}),cl.invert=function(t,n){return[-n,2*$a(Ja(t))-Ia]},yl.prototype=dl.prototype={constructor:yl,count:function(){return this.eachAfter(hl)},each:function(t){var n,e,r,i,o=this,a=[o];do{for(n=a.reverse(),a=[];o=n.pop();)if(t(o),e=o.children)for(r=0,i=e.length;r=0;--e)i.push(n[e]);return this},sum:function(t){return this.eachAfter(function(n){for(var e=+t(n.data)||0,r=n.children,i=r&&r.length;--i>=0;)e+=r[i].value;n.value=e})},sort:function(t){return this.eachBefore(function(n){n.children&&n.children.sort(t)})},path:function(t){for(var n=this,e=function(t,n){if(t===n)return t;var e=t.ancestors(),r=n.ancestors(),i=null;for(t=e.pop(),n=r.pop();t===n;)i=t,t=e.pop(),n=r.pop();return i}(n,t),r=[n];n!==e;)n=n.parent,r.push(n);for(var i=r.length;t!==e;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,n=[t];t=t.parent;)n.push(t);return n},descendants:function(){var t=[];return this.each(function(n){t.push(n)}),t},leaves:function(){var t=[];return this.eachBefore(function(n){n.children||t.push(n)}),t},links:function(){var t=this,n=[];return t.each(function(e){e!==t&&n.push({source:e.parent,target:e})}),n},copy:function(){return dl(this).eachBefore(vl)}};var _l=Array.prototype.slice;function bl(t){for(var n,e,r=0,i=(t=function(t){for(var n,e,r=t.length;r;)e=Math.random()*r--|0,n=t[r],t[r]=t[e],t[e]=n;return t}(_l.call(t))).length,o=[];r0&&e*e>r*r+i*i}function Ml(t,n){for(var e=0;e(a*=a)?(r=(f+a-i)/(2*f),o=Math.sqrt(Math.max(0,a/f-r*r)),e.x=t.x-r*u-o*c,e.y=t.y-r*c+o*u):(r=(f+i-a)/(2*f),o=Math.sqrt(Math.max(0,i/f-r*r)),e.x=n.x+r*u-o*c,e.y=n.y+r*c+o*u)):(e.x=n.x+e.r,e.y=n.y)}function kl(t,n){var e=t.r+n.r-1e-6,r=n.x-t.x,i=n.y-t.y;return e>0&&e*e>r*r+i*i}function El(t){var n=t._,e=t.next._,r=n.r+e.r,i=(n.x*e.r+e.x*n.r)/r,o=(n.y*e.r+e.y*n.r)/r;return i*i+o*o}function Cl(t){this._=t,this.next=null,this.previous=null}function Pl(t){if(!(i=t.length))return 0;var n,e,r,i,o,a,u,c,f,s,l;if((n=t[0]).x=0,n.y=0,!(i>1))return n.r;if(e=t[1],n.x=-e.r,e.x=n.r,e.y=0,!(i>2))return n.r+e.r;Sl(e,n,r=t[2]),n=new Cl(n),e=new Cl(e),r=new Cl(r),n.next=r.previous=e,e.next=n.previous=r,r.next=e.previous=n;t:for(u=3;uh&&(h=u),g=s*s*v,(d=Math.max(h/g,g/l))>p){s-=u;break}p=d}y.push(a={value:s,dice:c1?n:1)},e}(Kl);var eh=function t(n){function e(t,e,r,i,o){if((a=t._squarify)&&a.ratio===n)for(var a,u,c,f,s,l=-1,h=a.length,d=t.value;++l1?n:1)},e}(Kl);function rh(t,n){return t[0]-n[0]||t[1]-n[1]}function ih(t){for(var n,e,r,i=t.length,o=[0,1],a=2,u=2;u1&&(n=t[o[a-2]],e=t[o[a-1]],r=t[u],(e[0]-n[0])*(r[1]-n[1])-(e[1]-n[1])*(r[0]-n[0])<=0);)--a;o[a++]=u}return o.slice(0,a)}function oh(){return Math.random()}var ah=function t(n){function e(t,e){return t=null==t?0:+t,e=null==e?1:+e,1===arguments.length?(e=t,t=0):e-=t,function(){return n()*e+t}}return e.source=t,e}(oh),uh=function t(n){function e(t,e){var r,i;return t=null==t?0:+t,e=null==e?1:+e,function(){var o;if(null!=r)o=r,r=null;else do{r=2*n()-1,o=2*n()-1,i=r*r+o*o}while(!i||i>1);return t+e*o*Math.sqrt(-2*Math.log(i)/i)}}return e.source=t,e}(oh),ch=function t(n){function e(){var t=uh.source(n).apply(this,arguments);return function(){return Math.exp(t())}}return e.source=t,e}(oh),fh=function t(n){function e(t){return function(){for(var e=0,r=0;rr&&(n=e,e=r,r=n),function(t){return Math.max(e,Math.min(r,t))}}function Ah(t,n,e){var r=t[0],i=t[1],o=n[0],a=n[1];return i2?Th:Ah,i=o=null,l}function l(n){return isNaN(n=+n)?e:(i||(i=r(a.map(t),u,c)))(t(f(n)))}return l.invert=function(e){return f(n((o||(o=r(u,a.map(t),de)))(e)))},l.domain=function(t){return arguments.length?(a=vh.call(t,mh),f===wh||(f=Nh(a)),s()):a.slice()},l.range=function(t){return arguments.length?(u=gh.call(t),s()):u.slice()},l.rangeRound=function(t){return u=gh.call(t),c=be,s()},l.clamp=function(t){return arguments.length?(f=t?Nh(a):wh,l):f!==wh},l.interpolate=function(t){return arguments.length?(c=t,s()):c},l.unknown=function(t){return arguments.length?(e=t,l):e},function(e,r){return t=e,n=r,s()}}function Eh(t,n){return kh()(t,n)}function Ch(n,e,r,i){var o,a=w(n,e,r);switch((i=Ma(null==i?",f":i)).type){case"s":var u=Math.max(Math.abs(n),Math.abs(e));return null!=i.precision||isNaN(o=Ra(a,u))||(i.precision=o),t.formatPrefix(i,u);case"":case"e":case"g":case"p":case"r":null!=i.precision||isNaN(o=Da(a,Math.max(Math.abs(n),Math.abs(e))))||(i.precision=o-("e"===i.type));break;case"f":case"%":null!=i.precision||isNaN(o=za(a))||(i.precision=o-2*("%"===i.type))}return t.format(i)}function Ph(t){var n=t.domain;return t.ticks=function(t){var e=n();return m(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){var r=n();return Ch(r[0],r[r.length-1],null==t?10:t,e)},t.nice=function(e){null==e&&(e=10);var r,i=n(),o=0,a=i.length-1,u=i[o],c=i[a];return c0?r=x(u=Math.floor(u/r)*r,c=Math.ceil(c/r)*r,e):r<0&&(r=x(u=Math.ceil(u*r)/r,c=Math.floor(c*r)/r,e)),r>0?(i[o]=Math.floor(u/r)*r,i[a]=Math.ceil(c/r)*r,n(i)):r<0&&(i[o]=Math.ceil(u*r)/r,i[a]=Math.floor(c*r)/r,n(i)),t},t}function zh(t,n){var e,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a0){for(;hc)break;v.push(l)}}else for(;h=1;--s)if(!((l=f*s)c)break;v.push(l)}}else v=m(h,d,Math.min(d-h,p)).map(r);return n?v.reverse():v},i.tickFormat=function(n,o){if(null==o&&(o=10===a?".0e":","),"function"!=typeof o&&(o=t.format(o)),n===1/0)return o;null==n&&(n=10);var u=Math.max(1,a*n/i.ticks().length);return function(t){var n=t/r(Math.round(e(t)));return n*a0))return u;do{u.push(a=new Date(+e)),n(e,o),t(e)}while(a=n)for(;t(n),!e(n);)n.setTime(n-1)},function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;n(t,-1),!e(t););else for(;--r>=0;)for(;n(t,1),!e(t););})},e&&(i.count=function(n,r){return $h.setTime(+n),Wh.setTime(+r),t($h),t(Wh),Math.floor(e($h,Wh))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(n){return r(n)%t==0}:function(n){return i.count(0,n)%t==0}):i:null}),i}var Qh=Zh(function(){},function(t,n){t.setTime(+t+n)},function(t,n){return n-t});Qh.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?Zh(function(n){n.setTime(Math.floor(n/t)*t)},function(n,e){n.setTime(+n+e*t)},function(n,e){return(e-n)/t}):Qh:null};var Jh=Qh.range,Kh=6e4,td=6048e5,nd=Zh(function(t){t.setTime(t-t.getMilliseconds())},function(t,n){t.setTime(+t+1e3*n)},function(t,n){return(n-t)/1e3},function(t){return t.getUTCSeconds()}),ed=nd.range,rd=Zh(function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds())},function(t,n){t.setTime(+t+n*Kh)},function(t,n){return(n-t)/Kh},function(t){return t.getMinutes()}),id=rd.range,od=Zh(function(t){t.setTime(t-t.getMilliseconds()-1e3*t.getSeconds()-t.getMinutes()*Kh)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getHours()}),ad=od.range,ud=Zh(function(t){t.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Kh)/864e5},function(t){return t.getDate()-1}),cd=ud.range;function fd(t){return Zh(function(n){n.setDate(n.getDate()-(n.getDay()+7-t)%7),n.setHours(0,0,0,0)},function(t,n){t.setDate(t.getDate()+7*n)},function(t,n){return(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Kh)/td})}var sd=fd(0),ld=fd(1),hd=fd(2),dd=fd(3),pd=fd(4),vd=fd(5),gd=fd(6),yd=sd.range,_d=ld.range,bd=hd.range,md=dd.range,xd=pd.range,wd=vd.range,Md=gd.range,Nd=Zh(function(t){t.setDate(1),t.setHours(0,0,0,0)},function(t,n){t.setMonth(t.getMonth()+n)},function(t,n){return n.getMonth()-t.getMonth()+12*(n.getFullYear()-t.getFullYear())},function(t){return t.getMonth()}),Ad=Nd.range,Td=Zh(function(t){t.setMonth(0,1),t.setHours(0,0,0,0)},function(t,n){t.setFullYear(t.getFullYear()+n)},function(t,n){return n.getFullYear()-t.getFullYear()},function(t){return t.getFullYear()});Td.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Zh(function(n){n.setFullYear(Math.floor(n.getFullYear()/t)*t),n.setMonth(0,1),n.setHours(0,0,0,0)},function(n,e){n.setFullYear(n.getFullYear()+e*t)}):null};var Sd=Td.range,kd=Zh(function(t){t.setUTCSeconds(0,0)},function(t,n){t.setTime(+t+n*Kh)},function(t,n){return(n-t)/Kh},function(t){return t.getUTCMinutes()}),Ed=kd.range,Cd=Zh(function(t){t.setUTCMinutes(0,0,0)},function(t,n){t.setTime(+t+36e5*n)},function(t,n){return(n-t)/36e5},function(t){return t.getUTCHours()}),Pd=Cd.range,zd=Zh(function(t){t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+n)},function(t,n){return(n-t)/864e5},function(t){return t.getUTCDate()-1}),Rd=zd.range;function Dd(t){return Zh(function(n){n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7),n.setUTCHours(0,0,0,0)},function(t,n){t.setUTCDate(t.getUTCDate()+7*n)},function(t,n){return(n-t)/td})}var qd=Dd(0),Ld=Dd(1),Ud=Dd(2),Od=Dd(3),Bd=Dd(4),Yd=Dd(5),Fd=Dd(6),Id=qd.range,jd=Ld.range,Hd=Ud.range,Xd=Od.range,Gd=Bd.range,Vd=Yd.range,$d=Fd.range,Wd=Zh(function(t){t.setUTCDate(1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCMonth(t.getUTCMonth()+n)},function(t,n){return n.getUTCMonth()-t.getUTCMonth()+12*(n.getUTCFullYear()-t.getUTCFullYear())},function(t){return t.getUTCMonth()}),Zd=Wd.range,Qd=Zh(function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},function(t,n){t.setUTCFullYear(t.getUTCFullYear()+n)},function(t,n){return n.getUTCFullYear()-t.getUTCFullYear()},function(t){return t.getUTCFullYear()});Qd.every=function(t){return isFinite(t=Math.floor(t))&&t>0?Zh(function(n){n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},function(n,e){n.setUTCFullYear(n.getUTCFullYear()+e*t)}):null};var Jd=Qd.range;function Kd(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return n.setFullYear(t.y),n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function tp(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return n.setUTCFullYear(t.y),n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function np(t){return{y:t,m:0,d:1,H:0,M:0,S:0,L:0}}function ep(t){var n=t.dateTime,e=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,u=t.months,c=t.shortMonths,f=sp(i),s=lp(i),l=sp(o),h=lp(o),d=sp(a),p=lp(a),v=sp(u),g=lp(u),y=sp(c),_=lp(c),b={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return c[t.getMonth()]},B:function(t){return u[t.getMonth()]},c:null,d:Pp,e:Pp,f:Lp,H:zp,I:Rp,j:Dp,L:qp,m:Up,M:Op,p:function(t){return i[+(t.getHours()>=12)]},Q:hv,s:dv,S:Bp,u:Yp,U:Fp,V:Ip,w:jp,W:Hp,x:null,X:null,y:Xp,Y:Gp,Z:Vp,"%":lv},m={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return c[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:$p,e:$p,f:Kp,H:Wp,I:Zp,j:Qp,L:Jp,m:tv,M:nv,p:function(t){return i[+(t.getUTCHours()>=12)]},Q:hv,s:dv,S:ev,u:rv,U:iv,V:ov,w:av,W:uv,x:null,X:null,y:cv,Y:fv,Z:sv,"%":lv},x={a:function(t,n,e){var r=d.exec(n.slice(e));return r?(t.w=p[r[0].toLowerCase()],e+r[0].length):-1},A:function(t,n,e){var r=l.exec(n.slice(e));return r?(t.w=h[r[0].toLowerCase()],e+r[0].length):-1},b:function(t,n,e){var r=y.exec(n.slice(e));return r?(t.m=_[r[0].toLowerCase()],e+r[0].length):-1},B:function(t,n,e){var r=v.exec(n.slice(e));return r?(t.m=g[r[0].toLowerCase()],e+r[0].length):-1},c:function(t,e,r){return N(t,n,e,r)},d:xp,e:xp,f:Sp,H:Mp,I:Mp,j:wp,L:Tp,m:mp,M:Np,p:function(t,n,e){var r=f.exec(n.slice(e));return r?(t.p=s[r[0].toLowerCase()],e+r[0].length):-1},Q:Ep,s:Cp,S:Ap,u:dp,U:pp,V:vp,w:hp,W:gp,x:function(t,n,r){return N(t,e,n,r)},X:function(t,n,e){return N(t,r,n,e)},y:_p,Y:yp,Z:bp,"%":kp};function w(t,n){return function(e){var r,i,o,a=[],u=-1,c=0,f=t.length;for(e instanceof Date||(e=new Date(+e));++u53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=tp(np(o.y))).getUTCDay(),r=i>4||0===i?Ld.ceil(r):Ld(r),r=zd.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=n(np(o.y))).getDay(),r=i>4||0===i?ld.ceil(r):ld(r),r=ud.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?tp(np(o.y)).getUTCDay():n(np(o.y)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,tp(o)):n(o)}}function N(t,n,e,r){for(var i,o,a=0,u=n.length,c=e.length;a=c)return-1;if(37===(i=n.charCodeAt(a++))){if(i=n.charAt(a++),!(o=x[i in ip?n.charAt(a++):i])||(r=o(t,e,r))<0)return-1}else if(i!=e.charCodeAt(r++))return-1}return r}return b.x=w(e,b),b.X=w(r,b),b.c=w(n,b),m.x=w(e,m),m.X=w(r,m),m.c=w(n,m),{format:function(t){var n=w(t+="",b);return n.toString=function(){return t},n},parse:function(t){var n=M(t+="",Kd);return n.toString=function(){return t},n},utcFormat:function(t){var n=w(t+="",m);return n.toString=function(){return t},n},utcParse:function(t){var n=M(t,tp);return n.toString=function(){return t},n}}}var rp,ip={"-":"",_:" ",0:"0"},op=/^\s*\d+/,ap=/^%/,up=/[\\^$*+?|[\]().{}]/g;function cp(t,n,e){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o68?1900:2e3),e+r[0].length):-1}function bp(t,n,e){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),e+r[0].length):-1}function mp(t,n,e){var r=op.exec(n.slice(e,e+2));return r?(t.m=r[0]-1,e+r[0].length):-1}function xp(t,n,e){var r=op.exec(n.slice(e,e+2));return r?(t.d=+r[0],e+r[0].length):-1}function wp(t,n,e){var r=op.exec(n.slice(e,e+3));return r?(t.m=0,t.d=+r[0],e+r[0].length):-1}function Mp(t,n,e){var r=op.exec(n.slice(e,e+2));return r?(t.H=+r[0],e+r[0].length):-1}function Np(t,n,e){var r=op.exec(n.slice(e,e+2));return r?(t.M=+r[0],e+r[0].length):-1}function Ap(t,n,e){var r=op.exec(n.slice(e,e+2));return r?(t.S=+r[0],e+r[0].length):-1}function Tp(t,n,e){var r=op.exec(n.slice(e,e+3));return r?(t.L=+r[0],e+r[0].length):-1}function Sp(t,n,e){var r=op.exec(n.slice(e,e+6));return r?(t.L=Math.floor(r[0]/1e3),e+r[0].length):-1}function kp(t,n,e){var r=ap.exec(n.slice(e,e+1));return r?e+r[0].length:-1}function Ep(t,n,e){var r=op.exec(n.slice(e));return r?(t.Q=+r[0],e+r[0].length):-1}function Cp(t,n,e){var r=op.exec(n.slice(e));return r?(t.Q=1e3*+r[0],e+r[0].length):-1}function Pp(t,n){return cp(t.getDate(),n,2)}function zp(t,n){return cp(t.getHours(),n,2)}function Rp(t,n){return cp(t.getHours()%12||12,n,2)}function Dp(t,n){return cp(1+ud.count(Td(t),t),n,3)}function qp(t,n){return cp(t.getMilliseconds(),n,3)}function Lp(t,n){return qp(t,n)+"000"}function Up(t,n){return cp(t.getMonth()+1,n,2)}function Op(t,n){return cp(t.getMinutes(),n,2)}function Bp(t,n){return cp(t.getSeconds(),n,2)}function Yp(t){var n=t.getDay();return 0===n?7:n}function Fp(t,n){return cp(sd.count(Td(t),t),n,2)}function Ip(t,n){var e=t.getDay();return t=e>=4||0===e?pd(t):pd.ceil(t),cp(pd.count(Td(t),t)+(4===Td(t).getDay()),n,2)}function jp(t){return t.getDay()}function Hp(t,n){return cp(ld.count(Td(t),t),n,2)}function Xp(t,n){return cp(t.getFullYear()%100,n,2)}function Gp(t,n){return cp(t.getFullYear()%1e4,n,4)}function Vp(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+cp(n/60|0,"0",2)+cp(n%60,"0",2)}function $p(t,n){return cp(t.getUTCDate(),n,2)}function Wp(t,n){return cp(t.getUTCHours(),n,2)}function Zp(t,n){return cp(t.getUTCHours()%12||12,n,2)}function Qp(t,n){return cp(1+zd.count(Qd(t),t),n,3)}function Jp(t,n){return cp(t.getUTCMilliseconds(),n,3)}function Kp(t,n){return Jp(t,n)+"000"}function tv(t,n){return cp(t.getUTCMonth()+1,n,2)}function nv(t,n){return cp(t.getUTCMinutes(),n,2)}function ev(t,n){return cp(t.getUTCSeconds(),n,2)}function rv(t){var n=t.getUTCDay();return 0===n?7:n}function iv(t,n){return cp(qd.count(Qd(t),t),n,2)}function ov(t,n){var e=t.getUTCDay();return t=e>=4||0===e?Bd(t):Bd.ceil(t),cp(Bd.count(Qd(t),t)+(4===Qd(t).getUTCDay()),n,2)}function av(t){return t.getUTCDay()}function uv(t,n){return cp(Ld.count(Qd(t),t),n,2)}function cv(t,n){return cp(t.getUTCFullYear()%100,n,2)}function fv(t,n){return cp(t.getUTCFullYear()%1e4,n,4)}function sv(){return"+0000"}function lv(){return"%"}function hv(t){return+t}function dv(t){return Math.floor(+t/1e3)}function pv(n){return rp=ep(n),t.timeFormat=rp.format,t.timeParse=rp.parse,t.utcFormat=rp.utcFormat,t.utcParse=rp.utcParse,rp}pv({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var vv=Date.prototype.toISOString?function(t){return t.toISOString()}:t.utcFormat("%Y-%m-%dT%H:%M:%S.%LZ");var gv=+new Date("2000-01-01T00:00:00.000Z")?function(t){var n=new Date(t);return isNaN(n)?null:n}:t.utcParse("%Y-%m-%dT%H:%M:%S.%LZ"),yv=1e3,_v=60*yv,bv=60*_v,mv=24*bv,xv=7*mv,wv=30*mv,Mv=365*mv;function Nv(t){return new Date(t)}function Av(t){return t instanceof Date?+t:+new Date(+t)}function Tv(t,n,r,i,o,a,u,c,f){var s=Eh(wh,wh),l=s.invert,h=s.domain,d=f(".%L"),p=f(":%S"),v=f("%I:%M"),g=f("%I %p"),y=f("%a %d"),_=f("%b %d"),b=f("%B"),m=f("%Y"),x=[[u,1,yv],[u,5,5*yv],[u,15,15*yv],[u,30,30*yv],[a,1,_v],[a,5,5*_v],[a,15,15*_v],[a,30,30*_v],[o,1,bv],[o,3,3*bv],[o,6,6*bv],[o,12,12*bv],[i,1,mv],[i,2,2*mv],[r,1,xv],[n,1,wv],[n,3,3*wv],[t,1,Mv]];function M(e){return(u(e)=1?ly:t<=-1?-ly:Math.asin(t)}function py(t){return t.innerRadius}function vy(t){return t.outerRadius}function gy(t){return t.startAngle}function yy(t){return t.endAngle}function _y(t){return t&&t.padAngle}function by(t,n,e,r,i,o,a){var u=t-e,c=n-r,f=(a?o:-o)/cy(u*u+c*c),s=f*c,l=-f*u,h=t+s,d=n+l,p=e+s,v=r+l,g=(h+p)/2,y=(d+v)/2,_=p-h,b=v-d,m=_*_+b*b,x=i-o,w=h*v-p*d,M=(b<0?-1:1)*cy(oy(0,x*x*m-w*w)),N=(w*b-_*M)/m,A=(-w*_-b*M)/m,T=(w*b+_*M)/m,S=(-w*_+b*M)/m,k=N-g,E=A-y,C=T-g,P=S-y;return k*k+E*E>C*C+P*P&&(N=T,A=S),{cx:N,cy:A,x01:-s,y01:-l,x11:N*(i/x-1),y11:A*(i/x-1)}}function my(t){this._context=t}function xy(t){return new my(t)}function wy(t){return t[0]}function My(t){return t[1]}function Ny(){var t=wy,n=My,e=ny(!0),r=null,i=xy,o=null;function a(a){var u,c,f,s=a.length,l=!1;for(null==r&&(o=i(f=Xi())),u=0;u<=s;++u)!(u=s;--l)u.point(g[l],y[l]);u.lineEnd(),u.areaEnd()}v&&(g[f]=+t(h,f,c),y[f]=+e(h,f,c),u.point(n?+n(h,f,c):g[f],r?+r(h,f,c):y[f]))}if(d)return u=null,d+""||null}function f(){return Ny().defined(i).curve(a).context(o)}return c.x=function(e){return arguments.length?(t="function"==typeof e?e:ny(+e),n=null,c):t},c.x0=function(n){return arguments.length?(t="function"==typeof n?n:ny(+n),c):t},c.x1=function(t){return arguments.length?(n=null==t?null:"function"==typeof t?t:ny(+t),c):n},c.y=function(t){return arguments.length?(e="function"==typeof t?t:ny(+t),r=null,c):e},c.y0=function(t){return arguments.length?(e="function"==typeof t?t:ny(+t),c):e},c.y1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:ny(+t),c):r},c.lineX0=c.lineY0=function(){return f().x(t).y(e)},c.lineY1=function(){return f().x(t).y(r)},c.lineX1=function(){return f().x(n).y(e)},c.defined=function(t){return arguments.length?(i="function"==typeof t?t:ny(!!t),c):i},c.curve=function(t){return arguments.length?(a=t,null!=o&&(u=a(o)),c):a},c.context=function(t){return arguments.length?(null==t?o=u=null:u=a(o=t),c):o},c}function Ty(t,n){return nt?1:n>=t?0:NaN}function Sy(t){return t}my.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n)}}};var ky=Cy(xy);function Ey(t){this._curve=t}function Cy(t){function n(n){return new Ey(t(n))}return n._curve=t,n}function Py(t){var n=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?n(Cy(t)):n()._curve},t}function zy(){return Py(Ny().curve(ky))}function Ry(){var t=Ay().curve(ky),n=t.curve,e=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return Py(e())},delete t.lineX0,t.lineEndAngle=function(){return Py(r())},delete t.lineX1,t.lineInnerRadius=function(){return Py(i())},delete t.lineY0,t.lineOuterRadius=function(){return Py(o())},delete t.lineY1,t.curve=function(t){return arguments.length?n(Cy(t)):n()._curve},t}function Dy(t,n){return[(n=+n)*Math.cos(t-=Math.PI/2),n*Math.sin(t)]}Ey.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,n){this._curve.point(n*Math.sin(t),n*-Math.cos(t))}};var qy=Array.prototype.slice;function Ly(t){return t.source}function Uy(t){return t.target}function Oy(t){var n=Ly,e=Uy,r=wy,i=My,o=null;function a(){var a,u=qy.call(arguments),c=n.apply(this,u),f=e.apply(this,u);if(o||(o=a=Xi()),t(o,+r.apply(this,(u[0]=c,u)),+i.apply(this,u),+r.apply(this,(u[0]=f,u)),+i.apply(this,u)),a)return o=null,a+""||null}return a.source=function(t){return arguments.length?(n=t,a):n},a.target=function(t){return arguments.length?(e=t,a):e},a.x=function(t){return arguments.length?(r="function"==typeof t?t:ny(+t),a):r},a.y=function(t){return arguments.length?(i="function"==typeof t?t:ny(+t),a):i},a.context=function(t){return arguments.length?(o=null==t?null:t,a):o},a}function By(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n=(n+r)/2,e,n,i,r,i)}function Yy(t,n,e,r,i){t.moveTo(n,e),t.bezierCurveTo(n,e=(e+i)/2,r,e,r,i)}function Fy(t,n,e,r,i){var o=Dy(n,e),a=Dy(n,e=(e+i)/2),u=Dy(r,e),c=Dy(r,i);t.moveTo(o[0],o[1]),t.bezierCurveTo(a[0],a[1],u[0],u[1],c[0],c[1])}var Iy={draw:function(t,n){var e=Math.sqrt(n/sy);t.moveTo(e,0),t.arc(0,0,e,0,hy)}},jy={draw:function(t,n){var e=Math.sqrt(n/5)/2;t.moveTo(-3*e,-e),t.lineTo(-e,-e),t.lineTo(-e,-3*e),t.lineTo(e,-3*e),t.lineTo(e,-e),t.lineTo(3*e,-e),t.lineTo(3*e,e),t.lineTo(e,e),t.lineTo(e,3*e),t.lineTo(-e,3*e),t.lineTo(-e,e),t.lineTo(-3*e,e),t.closePath()}},Hy=Math.sqrt(1/3),Xy=2*Hy,Gy={draw:function(t,n){var e=Math.sqrt(n/Xy),r=e*Hy;t.moveTo(0,-e),t.lineTo(r,0),t.lineTo(0,e),t.lineTo(-r,0),t.closePath()}},Vy=Math.sin(sy/10)/Math.sin(7*sy/10),$y=Math.sin(hy/10)*Vy,Wy=-Math.cos(hy/10)*Vy,Zy={draw:function(t,n){var e=Math.sqrt(.8908130915292852*n),r=$y*e,i=Wy*e;t.moveTo(0,-e),t.lineTo(r,i);for(var o=1;o<5;++o){var a=hy*o/5,u=Math.cos(a),c=Math.sin(a);t.lineTo(c*e,-u*e),t.lineTo(u*r-c*i,c*r+u*i)}t.closePath()}},Qy={draw:function(t,n){var e=Math.sqrt(n),r=-e/2;t.rect(r,r,e,e)}},Jy=Math.sqrt(3),Ky={draw:function(t,n){var e=-Math.sqrt(n/(3*Jy));t.moveTo(0,2*e),t.lineTo(-Jy*e,-e),t.lineTo(Jy*e,-e),t.closePath()}},t_=Math.sqrt(3)/2,n_=1/Math.sqrt(12),e_=3*(n_/2+1),r_={draw:function(t,n){var e=Math.sqrt(n/e_),r=e/2,i=e*n_,o=r,a=e*n_+e,u=-o,c=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(u,c),t.lineTo(-.5*r-t_*i,t_*r+-.5*i),t.lineTo(-.5*o-t_*a,t_*o+-.5*a),t.lineTo(-.5*u-t_*c,t_*u+-.5*c),t.lineTo(-.5*r+t_*i,-.5*i-t_*r),t.lineTo(-.5*o+t_*a,-.5*a-t_*o),t.lineTo(-.5*u+t_*c,-.5*c-t_*u),t.closePath()}},i_=[Iy,jy,Gy,Qy,Zy,Ky,r_];function o_(){}function a_(t,n,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+e)/6)}function u_(t){this._context=t}function c_(t){this._context=t}function f_(t){this._context=t}function s_(t,n){this._basis=new u_(t),this._beta=n}u_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:a_(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:a_(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},c_.prototype={areaStart:o_,areaEnd:o_,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x2=t,this._y2=n;break;case 1:this._point=2,this._x3=t,this._y3=n;break;case 2:this._point=3,this._x4=t,this._y4=n,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:a_(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},f_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:a_(this,t,n)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=n}},s_.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0)for(var r,i=t[0],o=n[0],a=t[e]-i,u=n[e]-o,c=-1;++c<=e;)r=c/e,this._basis.point(this._beta*t[c]+(1-this._beta)*(i+r*a),this._beta*n[c]+(1-this._beta)*(o+r*u));this._x=this._y=null,this._basis.lineEnd()},point:function(t,n){this._x.push(+t),this._y.push(+n)}};var l_=function t(n){function e(t){return 1===n?new u_(t):new s_(t,n)}return e.beta=function(n){return t(+n)},e}(.85);function h_(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function d_(t,n){this._context=t,this._k=(1-n)/6}d_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:h_(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2,this._x1=t,this._y1=n;break;case 2:this._point=3;default:h_(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var p_=function t(n){function e(t){return new d_(t,n)}return e.tension=function(n){return t(+n)},e}(0);function v_(t,n){this._context=t,this._k=(1-n)/6}v_.prototype={areaStart:o_,areaEnd:o_,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:h_(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var g_=function t(n){function e(t){return new v_(t,n)}return e.tension=function(n){return t(+n)},e}(0);function y_(t,n){this._context=t,this._k=(1-n)/6}y_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){switch(t=+t,n=+n,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:h_(this,t,n)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var __=function t(n){function e(t){return new y_(t,n)}return e.tension=function(n){return t(+n)},e}(0);function b_(t,n,e){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>fy){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,c=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/c,i=(i*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/c}if(t._l23_a>fy){var f=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,s=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*f+t._x1*t._l23_2a-n*t._l12_2a)/s,a=(a*f+t._y1*t._l23_2a-e*t._l12_2a)/s}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function m_(t,n){this._context=t,this._alpha=n}m_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:b_(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var x_=function t(n){function e(t){return n?new m_(t,n):new d_(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function w_(t,n){this._context=t,this._alpha=n}w_.prototype={areaStart:o_,areaEnd:o_,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=n;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3,this._x5=t,this._y5=n;break;default:b_(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var M_=function t(n){function e(t){return n?new w_(t,n):new v_(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function N_(t,n){this._context=t,this._alpha=n}N_.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,n){if(t=+t,n=+n,this._point){var e=this._x2-t,r=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:b_(this,t,n)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=n}};var A_=function t(n){function e(t){return n?new N_(t,n):new y_(t,0)}return e.alpha=function(n){return t(+n)},e}(.5);function T_(t){this._context=t}function S_(t){return t<0?-1:1}function k_(t,n,e){var r=t._x1-t._x0,i=n-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(e-t._y1)/(i||r<0&&-0),u=(o*i+a*r)/(r+i);return(S_(o)+S_(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(u))||0}function E_(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function C_(t,n,e){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,u=(o-r)/3;t._context.bezierCurveTo(r+u,i+u*n,o-u,a-u*e,o,a)}function P_(t){this._context=t}function z_(t){this._context=new R_(t)}function R_(t){this._context=t}function D_(t){this._context=t}function q_(t){var n,e,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],n=1;n=0;--n)i[n]=(a[n]-i[n+1])/o[n];for(o[r-1]=(t[r]+i[r-1])/2,n=0;n1)for(var e,r,i,o=1,a=t[n[0]],u=a.length;o=0;)e[n]=n;return e}function B_(t,n){return t[n]}function Y_(t){var n=t.map(F_);return O_(t).sort(function(t,e){return n[t]-n[e]})}function F_(t){for(var n,e=-1,r=0,i=t.length,o=-1/0;++eo&&(o=n,r=e);return r}function I_(t){var n=t.map(j_);return O_(t).sort(function(t,e){return n[t]-n[e]})}function j_(t){for(var n,e=0,r=-1,i=t.length;++r0)){if(o/=h,h<0){if(o0){if(o>l)return;o>s&&(s=o)}if(o=r-c,h||!(o<0)){if(o/=h,h<0){if(o>l)return;o>s&&(s=o)}else if(h>0){if(o0)){if(o/=d,d<0){if(o