1import json
 2import os
 3
 4
 5class VegaModel(object):
 6    """
 7    It loads the base vega spec. This class should be extended
 8    by other scripts to complete the base vega spec with plot
 9    specific information.
10    """
11    def __init__(self):
12        self.vega_spec = self.load_spec()
13
14    def load_spec(self):
15        # Load file from module path
16        with open(
17                os.path.join(os.path.dirname(__file__), 'spec.json'),
18                'r') as file:
19            return json.load(file)