.highcharts
The highcharts_maps.highcharts
module is designed to be a catch-all module for
ease of importing. It does not actually define any functionality itself, but instead
imports classes from across the Highcharts Maps for Python library to expose them
under a single import statement. This enables you to choose between whatever import-style
you prefer to apply:
Tip
Best Practice!
This method of importing Highcharts Maps for Python objects yields the fastest performance for the
import
statement. However, it is more verbose and requires you to navigate the extensive Highcharts Maps for Python API.# Import classes using precise module indications. For example: from highcharts_maps.chart import Chart from highcharts_maps.global_options.shared_options import SharedMapsOptions from highcharts_maps.options import HighchartsMapsOptions from highcharts_maps.options.plot_options.map import MapOptions from highcharts_maps.options.series.map import MapSeriesCaution
This method of importing Highcharts Maps for Python classes has relatively slow performance because it imports hundreds of different classes from across the entire library. This is also a known anti-pattern, as it obscures the namespace within the library. Both may be acceptable to you in your use-case, but do use at your own risk.
# Import objects from the catch-all ".highcharts" module. from highcharts_maps import highcharts # You can now access specific classes without individual import statements. highcharts.Chart highcharts.SharedMapsOptions highcharts.HighchartsMapsOptions highcharts.MapOptions highcharts.MapSeries
Caution
You should be aware that importing the highcharts_maps.highcharts
module takes
a relatively long time. This is because it needs to import hundreds of other classes
from across the entire library. Assuming you are just doing it once, this may be
acceptable to you. However you should be aware that is much less performant than
importing precise classes when and as-needed.