# Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import class VisualizationInterface(object): """ A visualization extension """ def __init__(self, **kwargs): pass @staticmethod def get_config_form(): """ Return a form to be used to configure visualization options """ raise NotImplementedError @staticmethod def get_config_template(form): """ The config template shows a form with view config options Parameters: - form: form returned by get_config_form(). This may be populated with values if the job was cloned Returns: - (template, context) tuple - template is a Jinja template to use for rendering config options - context is a dictionary of context variables to use for rendering the form """ raise NotImplementedError @staticmethod def get_default_visibility(): """ Return whether to show extension in GUI (can be overridden through DIGITS configuration options) """ return True def get_header_template(self): """ This returns the content to be rendered at the top of the result page. This may include a summary of the job as well as utility functions and scripts to use from "view" templates. By default this method returns (None, None), an indication that there is no header to display. This method may be overridden in sub-classes to show more elaborate content. Returns: - (template, context) tuple - template is a Jinja template to use for rendering the header, or None if there is no header to display - context is a dictionary of context variables to use for rendering the form """ return None, None def get_ng_templates(self): """ This returns the angularjs content defining the app and maybe a large scope controller. By default this method returns None, an indication that there is no angular header. This method may be overridden in sub-classes to implement the app and controller. This header html protion will likely be of the form: