def build(self): description = Description(desc="heat_map_2d") data = Data(name="data", url="/data/data.csv") domain1 = Scales.Scale.Domain("data", "c0") domain2 = Scales.Scale.Domain("data", "c1") scale1 = Scales.Scale("x", "linear", domain1) scale2 = Scales.Scale("y", "linear", domain2) scales = Scales([scale1, scale2]) encode = Marks.Encode(map_scale=Marks.Encode.Value(self._map_scale)) marks = Marks(encode) root = Root(Width(self._width), Height(self._height), description, data, scales, marks) root_json = json.dumps(root.to_dict(), indent=2) return root_json
def build(self): description = Description(desc="icon_2d") data = Data(name="data", url="/data/data.csv") domain = Scales.Scale.Domain("data", "c0") scale = Scales.Scale("icon", "linear", domain) scales = Scales([scale]) encode = Marks.Encode( bounding_box=Marks.Encode.Value(self._bounding_box), icon_path=Marks.Encode.Value(self._icon_path), coordinate_system=Marks.Encode.Value(self._coordinate_system)) marks = Marks(encode) root = Root(Width(self._width), Height(self._height), description, data, scales, marks) root_json = json.dumps(root.to_dict(), indent=2) return root_json
def build(self): description = Description(desc="building_weighted_2d") data = Data(name="data", url="/data/data.csv") domain = Scales.Scale.Domain("data", "c0") scale = Scales.Scale("building", "linear", domain) scales = Scales([scale]) encode = Marks.Encode(bounding_box=Marks.Encode.Value(self._bounding_box), color_style=Marks.Encode.Value(self._color_style), ruler=Marks.Encode.Value(self._ruler), opacity=Marks.Encode.Value(self._opacity)) marks = Marks(encode) root = Root(Width(self._width), Height(self._height), description, data, scales, marks) root_json = json.dumps(root.to_dict(), indent=2) return root_json
def build(self): description = Description(desc="heat_map_2d") data = Data(name="data", url="/data/data.csv") domain1 = Scales.Scale.Domain("data", "c0") domain2 = Scales.Scale.Domain("data", "c1") scale1 = Scales.Scale("x", "linear", domain1) scale2 = Scales.Scale("y", "linear", domain2) scales = Scales([scale1, scale2]) encode = Marks.Encode(bounding_box=Marks.Encode.Value(self._bounding_box), map_zoom_level=Marks.Encode.Value(self._map_zoom_level), coordinate_system=Marks.Encode.Value(self._coordinate_system), aggregation_type=Marks.Encode.Value(self._aggregation_type)) marks = Marks(encode) root = Root(Width(self._width), Height(self._height), description, data, scales, marks) root_json = json.dumps(root.to_dict(), indent=2) return root_json
def build(self): description = Description(desc="circle_2d") data = Data(name="data", url="/data/data.csv") domain1 = Scales.Scale.Domain(data="data", field="c0") domain2 = Scales.Scale.Domain(data="data", field="c1") scale1 = Scales.Scale("x", "linear", domain1) scale2 = Scales.Scale("y", "linear", domain2) scales = Scales([scale1, scale2]) encode = Marks.Encode(shape=Marks.Encode.Value("circle"), stroke=Marks.Encode.Value(self._mark_color), strokeWidth=Marks.Encode.Value(self._mark_size), opacity=Marks.Encode.Value(self._opacity)) marks = Marks(encode) root = Root(Width(self._width), Height(self._height), description, data, scales, marks) root_json = json.dumps(root.to_dict(), indent=2) return root_json
def build(self): description = Description(desc="circle_2d") data = Data(name="data", url="/data/data.csv") domain1 = Scales.Scale.Domain(data="data", field="c0") domain2 = Scales.Scale.Domain(data="data", field="c1") scale1 = Scales.Scale("x", "linear", domain1) scale2 = Scales.Scale("y", "linear", domain2) scales = Scales([scale1, scale2]) encode = Marks.Encode(bounding_box=Marks.Encode.Value(self._bounding_box), shape=Marks.Encode.Value("circle"), color_gradient=Marks.Encode.Value(self._color_gradient), color_bound=Marks.Encode.Value(self._color_bound), size_bound=Marks.Encode.Value(self._size_bound), opacity=Marks.Encode.Value(self._opacity), coordinate_system=Marks.Encode.Value(self._coordinate_system), aggregation_type=Marks.Encode.Value(self._aggregation_type)) marks = Marks(encode) root = Root(Width(self._width), Height(self._height), description, data, scales, marks) root_json = json.dumps(root.to_dict(), indent=2) return root_json