def page(self, selector=None, name=None, report=None, auto_route=False, target_folder="apps"): """ Description: ------------ Create a specific Application as a component in the Angular framework. Unlike a basic component, the application will be routed to be accessed directly. Description: ------------ :param report: Object. A report object :param selector: String. The url route for this report in the Angular app :param name: String. The component classname in the Angular framework """ if name is None: script = os.path.split( sys._getframe().f_back.f_code.co_filename)[1][:-3] name = "".join([s.capitalize() for s in script.split("_")]) if selector is None: selector = script.replace("_", "-") report = report or Page.Report() self._page = App(self._app_path, self._app_name, selector, name, page=page, target_folder=target_folder) self.__route = auto_route return self._page
def page(self, selector: str = None, name: str = None, page: primitives.PageModel = None, auto_route: bool = False, target_folder: str = "views"): """ Description: ------------ Create a specific Application as a component in the Angular framework. Unlike a basic component, the application will be routed to be accessed directly. Description: ------------ :param primitives.PageModel page: A report object :param str selector: The url route for this report in the Angular app :param str name: The component classname in the Angular framework :param bool auto_route: :param str target_folder: """ if name is None: script = os.path.split(sys._getframe().f_back.f_code.co_filename)[1][:-3] if selector is None: selector = script.replace("_", "-") page = page or Page.Report() page.framework("NODE") self._page = App(self._app_path, self._app_name, selector, name, page=page) self.auto_route = auto_route self.target_folder = target_folder return self._page
def __init__(self, value, min=0, max=10, step=0.1, description='Test:', disabled=False, continuous_update=False, orientation='horizontal', readout=True, readout_format='d'): """ Description: ------------ https://ipywidgets.readthedocs.io/en/latest/examples/Widget%20List.html """ self.page = Page.Report() self.component = self.page.ui.slider(number=value, minimum=min, maximum=max) self.component.style.css.width = "200px" self.component.input.options.step = step if orientation == "orientation": self.component.style.css.height = "28px" self.component.options.css = {"height": "5px", "background": "#bdbdbd"} self.component.options.handler_css = { "top": "-7px", "border-radius": '60px', "border": "1px solid grey", "background": "white"} else: self.component.style.css.height = self.component.style.css.width self.component.style.css.width = self.component.style.css.height self.component.options.css = {"width": "5px", "background": "#bdbdbd"} self.component.options.handler_css = { "left": "-7px", "border-radius": '60px', "border": "1px solid grey", "background": "white"} self.component.options.orientation = orientation
from epyk.core.js.configs import JsConfig from epyk.core import Page report = Page.Report() chart_type = 'hbar' configs = JsConfig.get(chart_type, chartFam='Billboard', preferred=False) config_chart = configs['Billboard'][chart_type](report, [], {}) config_chart.set_attrs(name="test", value='function(){alert}') print(config_chart.toJs()) # Billboard # # lineChart = JsLine(None, [], {}) # lineChart.addAttr('pattern', ['yellow'], 'color') # print(lineChart) # # # # # C3 # lineChart = JsLine(None, [], {}) # lineChart.addAttr('pattern', ['yellow'], 'color') # print(lineChart)