diff --git a/docs/db_apis.html b/docs/db_apis.html index def25ec..c624b58 100644 --- a/docs/db_apis.html +++ b/docs/db_apis.html @@ -13128,7 +13128,7 @@
import lingtypology.db_apis
+import lingtypology.datasets
from lingtypology.db_apis import Autotyp, Wals, Phoible
+from lingtypology.datasets import Autotyp, Wals, Phoible
get_df
and get_json
Moran, Steven & McCloy, Daniel (eds.) 2019.
PHOIBLE 2.0.
Jena: Max Planck Institute for the Science of Human History.
-(Available online at http://phoible.org, Accessed on 2019-06-08.)
+(Available online at http://phoible.org, Accessed on 2019-06-12.)
get_df
and get_json
Moran, Steven & McCloy, Daniel (eds.) 2019.
PHOIBLE 2.0.
Jena: Max Planck Institute for the Science of Human History.
-(Available online at http://phoible.org, Accessed on 2019-06-08.)
+(Available online at http://phoible.org, Accessed on 2019-06-12.)
citation
In [9]:
from lingtypology.db_apis import Autotyp
+from lingtypology.datasets import Autotyp
print(Autotyp().citation)
@@ -13950,14 +13950,14 @@ 1.3. citation
@@ -13993,7 +13993,7 @@ 1.3. citation
Dryer, Matthew S. & Haspelmath, Martin (eds.) 2013.
The World Atlas of Language Structures Online.
Leipzig: Max Planck Institute for Evolutionary Anthropology.
-(Available online at http://wals.info, Accessed on 2019-06-08.)
+(Available online at http://wals.info, Accessed on 2019-06-12.)
citation
from lingtypology.db_apis import Wals
+from lingtypology.datasets import Wals
m = lingtypology.LingMap(wals_page.language)
m.add_custom_coordinates(wals_page.coordinates)
-m.add_features(wals_page._1A)
+m.add_features(
+ wals_page._1A,
+ colors=lingtypology.gradient(5, 'yellow', 'green')
+)
m.legend_title = 'Consonant Inventory'
-m.colors = lingtypology.gradient(5, 'yellow', 'green')
m.create_map()
m = lingtypology.LingMap(Autotyp_table.language)
-m.add_features(Autotyp_table['Gender.binned4'])
-m.colors = lingtypology.gradient(4, color1='yellow', color2='red')
+m.add_features(
+ Autotyp_table['Gender.binned4'],
+ colors=lingtypology.gradient(4, color1='yellow', color2='red')
+)
m.legend_title = 'Genders'
m.create_map()
from lingtypology.db_apis import Sails
+from lingtypology.datasets import Sails
from lingtypology.db_apis import Phoible
+from lingtypology.datasets import Phoible
start_location: (float, float) or str, default (0, 0)
Coordinates of the start location for the map (latitude, longitude) or a text shortcut. List of available shortcuts: -\"Central Europe\", \"Caucasus\", \"Australia & Oceania\", \"Papua -New Guinea\", \"Africa\", \"Asia\", \"North America\", \"Central -America\", \"South America\".
+"Central Europe", "Caucasus", "Australia & Oceania", "Papua +New Guinea", "Africa", "Asia", "North America", "Central +America", "South America".start_zoom: int, default 2
Initial zoom level. Bypassed if you are using a shortcut @@ -13205,13 +13205,12 @@
colors: list of html codes for colors (str).
+colors: list of html codes for colors (str), default None
Colors that represent features. You can either use the 20 default -colors or set yours.
-stroke_colors: list of html codes for colors (str)
-Colors that represent additional (stroke) features.
+colors(if None) or set yours(else).shapes: list of characters (str)
If you use shapes instead of colors, you can either use the default shapes or set yours. Shapes are Unicode symbols.
@@ -13225,9 +13224,6 @@languages_in_popups: bool, default True
-Whether to show links to Glottolog website in popups.
-control: bool, default False
Whether to add LayerControls and group by features.
\bigskip -Methods:
+Methods:
add_custom_coordinates (custom_coordinates)
Set custom coordinates. By default cooordinates for the languages @@ -13256,7 +13251,7 @@
Length of the list should equal to length of languages.
add_features*(features, radius=7, opacity=1, numeric=False, +
add_features*(features, radius=7, opacity=1, colors=None, numeric=False, control=False, use_shapes=False)*
Add features to the map.
Parameters:
@@ -13271,6 +13266,13 @@radius: int, default 7
Marker radius.
opacity: float, default 1
+Marker opacity: a number between 0(invisible) and 1(not transparent).
+colors: list of html codes for colors (str), default None
+Colors that represent features. You can either use the 20 default +colors(if None) or set yours(else).
+numeric: bool, default False
Whether to assign different color to each feature (False), or to assign a color from colormap (True). You can set it to True @@ -13291,7 +13293,7 @@
add_stroke_features*(features, radius=12, opacity=1, +
add_stroke_features*(features, radius=12, opacity=1, colors=None, numeric=False, control=False)*:
Add additional set of features that look like strokes around markers.
@@ -13307,6 +13309,13 @@radius: int, default 12
Marker radius. Note that this radius is absolute as well.
opacity: float, default 1
+Marker opacity: a number between 0(invisible) and 1(not transparent).
+colors: list of html codes for colors (str), default None
+Colors that represent stroke features. You can either use the 20 default +colors(if None) or set yours(else).
+control: bool, default False
Whether to add LayerControls to the map. It allows interactive turning on/off given stroke features.
@@ -13314,7 +13323,7 @@add_overlapping_features (features, radius=7, -radius_increment=4, mapping=None):
+radius_increment=4, colors=None, mapping=None):Add overlapping features. For example, if you want to draw on map whether language 'is ergative', 'is slavic', 'is spoken in Russia'. It will draw several markers of different size for each feature.
@@ -13331,13 +13340,17 @@colors: list of html codes for colors (str), default None
+Colors that represent features. You can either use the 20 default +colors(if None) or set yours(else).
+mapping: dict, default None
Mapping for the legend.
add_minicharts (\minicharts, typ='pie', size=0.6, names=None, -textprops=None, labels=False, colors=[], startangle=90)*:
+add_minicharts (*minicharts, typ='pie', size=0.6, names=None, +textprops=None, labels=False, colors=None , startangle=90):
Create minicharts using Maplotlib.
Parameters:
labels: bool, default False
Whether to display labels.
colors: list, default []
+colors: list, default None
Minicharts colors.
startange: int, default 90
@@ -13370,7 +13383,7 @@add_popups (popups, parse_html=False)
+add_popups (popups, parse_html=False, glottolog_links=True)
Add popups to markers.
Parameters:
parse_html: bool, default False By default (False) -you can add HTML elements. If you need to add full HTML pages to +you can add HTML elements. If you need to add full HTML pages(e.g. with JavaScript code) to popups, you need to set the option to True.
glottolog_links: bool, default True
+Whether to show links to Glottolog website in popups. Automatically disabled when parse_html is used.
+add_tooltips (tooltips):
@@ -13447,12 +13463,12 @@function lingtypology.maps.merge (\maps)*
+function lingtypology.maps.merge (*maps)
Accepts LingMap objects and creates map of them.
It is impossible to add, for example, features and minicharts. If you need it, you can create two LingMap objects and then use the merge function.
-Parameter *maps: lingtypology.maps.LingMap objects.
+Parameter maps: lingtypology.maps.LingMap* objects.
Returns lingtypology.maps.LingMap
function lingtypology.maps.get_elevations (languages)
Get data on elevation for languages. More information in Chapter 2, @@ -13463,7 +13479,8 @@
Creates color gradient of given length.
Returns list of HEX-colors
-Glottolog module includes various functions to work with Glottolog data.
+lingtypology.glottolog
Glottolog module includes various functions to work with Glottolog data.
The only funcntion that accepts list-like objects and returns list is get_affiliations. Its parameter is language names, it returns the genealogical information for the given languages.
@@ -13521,7 +13538,8 @@Lingtypology will automatically use the local data.
-One of the objectives of LingTypology is to provide a simple interface +
lingtypology.datasets
One of the objectives of LingTypology is to provide a simple interface for linguistic databases. Therefore, classes used for acccessing them have unified API: most attributes and methods overlap among all of them. In this subsection I will describe this universal interface.
@@ -13561,28 +13579,28 @@class lingtypology.db_apis.Wals (\features)*
-Parameter features, list
+class lingtypology.datasets.Wals (*features)
+Parameter *features, list
List of WALS pages that will be present in the resulting table. E.g. ['1A']
Additional attribite general_citation, str
The general citation for all the WALS pages.
-class lingtypology.db_apis.Autotyp (\tables)*
-Parameter *tables: list of strings
+class lingtypology.datasets.Autotyp (*tables)
+Parameter *tables: list of strings
List of the Autoptyp tables that will be merged in the resulting table. E.g. ['gender']
-class lingtypology.db_apis.AfBo (\features)*
-Parameter *features: list of strings
+class lingtypology.datasets.AfBo (*features)
+Parameter *features: list of strings
List of Autotyp features that will be present in the resulting table. E.g. ['adjectivizer'].
-class lingtypology.db_apis.Sails (\features)*
-Parameter *features: list of strings
+class lingtypology.datasets.Sails (*features)
+Parameter *features: list of strings
List of SAILS pages that will be included in the resulting table.
Additional attribute features_descriptions: pandas.DataFrame
Table that contain description for all the SAILS pages.
-Additional method feature_descriptions (\features)*
+Additional method feature_descriptions (features)*
Returns table with description for each given feature.
-class lingtypology.db_apis.Phoible (subset='all',
+ class lingtypology.datasets.Phoible (subset='all',
aggregated=True) Parameters: In this paragraph I will consider some basic features that you can use. In this paragraph I will consider some basic features that you can use. The simplest script that draws a map with Romanian and Ukrainian languages will be: As you can see, the map is not centered properly. It can be fixed with passing coordinates to the You can add popups using PHOIBLE¶
diff --git a/docs/maps.html b/docs/maps.html
index 2ca2f05..d7a36ab 100644
--- a/docs/maps.html
+++ b/docs/maps.html
@@ -13149,7 +13149,7 @@
Maps ¶
0. Table of Contents¶
1. Maps¶
1.1. Simplest example¶
1.2. Save, Render or Save as an image¶
1.3. Features¶
1.4. Map Customization¶
1.5. Popups¶
1.6. Accessing Glottolog¶
1.7. Customizing Features and Controls¶
1.8. Stroke Features¶
1.9. Heatmaps¶
1.10. Title¶
1.11. Lines¶
1.12. Customizing markers¶
1.13. Start Location/Zoom shortcuts¶
1.14. Color Gradients¶
1.15. Minicharts¶
1.16. Overlapping Features¶
1.17. Using Existing folium.Map¶
1.18. Merging Maps¶
1.19. Tiles¶
1.20. Elevation¶
2. Real examples¶
2.1. Circassian Example¶
2.2. Another way¶
2.3. Consonants Example¶
1. Maps ¶
0. Table of Contents¶
1. Maps¶
1.1. Simplest example¶
1.2. Save, Render or Save as an image¶
1.3. Features¶
1.4. Map Customization¶
1.5. Popups¶
1.6. Accessing Glottolog¶
1.7. Customizing Features and Controls¶
1.8. Stroke Features¶
1.9. Heatmaps¶
1.10. Title¶
1.11. Lines¶
1.12. Customizing markers¶
1.13. Start Location/Zoom shortcuts¶
1.14. Color Gradients¶
1.15. Minicharts¶
1.16. Overlapping Features¶
1.17. Using Existing folium.Map¶
1.18. Merging Maps¶
1.19. Tiles¶
1.20. Elevation¶
2. Real examples¶
2.1. Circassian Example¶
2.2. Consonants Example¶
1. Maps ¶
1.1. Simplest example ¶
1.1. Simplest example
-
1.1. Simplest example
-
1.3. Features
-
1.3. Features
1.4. Customizing the map ¶
start_location
attribute. You can change start zoom as well start_zoom
.
-Also, you can change colors using the colors
attribute.colors
parameter.
1.4. Customizing the map
m.start_location = (40, 40)
m.start_zoom = 3
-m.colors = ("#00FFFF", "#FF00FF", "#FFFF00")
+m.add_features(features, colors=("#00FFFF", "#FF00FF", "#FFFF00"))
m.create_map()
1.4. Customizing the map
-
1.4. Customizing the map
1.5. Popups ¶
add_popups
method.
-You can disable links to Glottolog by setting languages_in_popups
attribute to False
.
+You can disable links to Glottolog by setting glottolog_links
parameter to False
.
Basically, you can set any html-code in the popups.1.5. Popups {data}
</a>
'''
-m.add_popups([html.format(data=popup) for popup in contents])
+m.add_popups([html.format(data=popup) for popup in contents], glottolog_links=False)
m.languages_in_popups = False
m.create_map()
1.5. Popups
-
1.6. Accessing Glottolog
-
1.7. Customizing features and c
@@ -13518,7 +13518,7 @@ 1.8. Stroke features
-
1.9. Heatmaps In [10]:
from lingtypology.db_apis import Wals
+
from lingtypology.datasets import Wals
wals_page = Wals('1a').get_df()
#First initialize LingMap without languages
@@ -13571,7 +13571,7 @@
1.9. Heatmaps 1.9. Heatmaps
-
1.10. Title
-
1.11. Lines
-
1.12. Customizing markers
-
1.13. Start Location/Zoom shortcut
@@ -13897,7 +13897,7 @@ 1.14. Color gradients
-
1.14. Color gradients In [19]:
m.add_features(native_speakers)
-m.colors = lingtypology.gradient(10, 'white', 'red')
+
m.add_features(native_speakers, colors=lingtypology.gradient(10, 'white', 'red'))
m.create_map()
1.14. Color gradients
-
1.15. Minicharts
-
1.15. Minicharts
-
1.15. Minicharts
-
1.16. Overlapping Features
-
1.16. Overlapping Features
-
1.17. Using Existing Folium Map
-
1.18. Merging Maps
-
1.19. Using Different Tiles
-
1.20. Using Elevation Data
-
2. Some real examples
@@ -14638,8 +14637,7 @@
2. Some real examples
2.2. Another way
coordinates = zip(list(circassian.latitude), list(circassian.longitude))
-dialects = circassian.dialect
-languages = circassian.language
-popups = circassian.village
-
-lingtypology.map_feature(
- languages,
- custom_coordinates = coordinates,
- features = dialects,
- stroke_features = languages,
- popups = popups,
- tooltips = languages,
- legend_title = 'Dialects',
- legend_position = 'bottomright',
- stroke_legend_title = 'Languages',
- stroke_legend_position = 'topright',
- start_zoom = 7,
- start_location = (44.21, 42.32),
- save_html = 'circassian.html',
-)
-
m = lingtypology.LingMap(data.language)
@@ -14725,12 +14683,12 @@
2.3. Consonants Example <