You are here

class ChartsPluginStyleChart in Charts 8.3

Same name and namespace in other branches
  1. 8.4 src/Plugin/views/style/ChartsPluginStyleChart.php \Drupal\charts\Plugin\views\style\ChartsPluginStyleChart
  2. 8 src/Plugin/views/style/ChartsPluginStyleChart.php \Drupal\charts\Plugin\views\style\ChartsPluginStyleChart
  3. 5.0.x src/Plugin/views/style/ChartsPluginStyleChart.php \Drupal\charts\Plugin\views\style\ChartsPluginStyleChart

Style plugin to render view as a chart.

Plugin annotation


@ViewsStyle(
  id = "chart",
  title = @Translation("Chart"),
  help = @Translation("Render a chart of your data."),
  theme = "views_view_charts",
  display_types = { "normal" }
)

Hierarchy

Expanded class hierarchy of ChartsPluginStyleChart

File

src/Plugin/views/style/ChartsPluginStyleChart.php, line 30

Namespace

Drupal\charts\Plugin\views\style
View source
class ChartsPluginStyleChart extends StylePluginBase implements ContainerFactoryPluginInterface {
  protected $usesFields = TRUE;
  protected $usesRowPlugin = TRUE;
  protected $attachmentService;

  /**
   * The chart manager service.
   *
   * @var \Drupal\charts\Plugin\chart\ChartManager
   */
  protected $chartManager;
  protected $moduleHandler;
  protected $chartsDefaultSettings;
  protected $chartsBaseSettingsForm;

  /**
   * Constructs a ChartsPluginStyleChart object.
   *
   * @param array $configuration
   *   A configuration array containing information about the plugin instance.
   * @param string $plugin_id
   *   The plugin_id for the plugin instance.
   * @param mixed $plugin_definition
   *   The plugin implementation definition.
   * @param \Drupal\charts\Services\ChartAttachmentServiceInterface $attachment_service
   *   The attachment service.
   * @param \Drupal\charts\Plugin\chart\ChartManager $chart_manager
   *   The chart manager service.
   * @param \Drupal\charts\Services\ChartsSettingsService $chartsSettings
   */
  public function __construct(array $configuration, $plugin_id, $plugin_definition, ChartAttachmentServiceInterface $attachment_service, ChartManager $chart_manager, ChartsSettingsService $chartsSettings) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->attachmentService = $attachment_service;
    $this->chartManager = $chart_manager;
    $this->chartsDefaultSettings = $chartsSettings
      ->getChartsSettings();
    $this->chartsBaseSettingsForm = new ChartsBaseSettingsForm();
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
    return new static($configuration, $plugin_id, $plugin_definition, $container
      ->get('charts.charts_attachment'), $container
      ->get('plugin.manager.charts'), $container
      ->get('charts.settings'));
  }

  /**
   * {@inheritdoc}
   */
  protected function defineOptions() {
    $options = parent::defineOptions();
    $options['allow_advanced_rendering'] = [
      'default' => FALSE,
    ];

    // Get the default chart values.
    if ($defaults = $this->chartsDefaultSettings) {
      foreach ($defaults as $default_key => $default_value) {
        $options[$default_key]['default'] = $default_value;
      }
    }

    // @todo: ensure that chart extensions inherit defaults from parent
    // Remove the default setting for chart type so it can be inherited if this
    // is a chart extension type.
    if ($this->view->style_plugin === 'chart_extension') {
      $options['type']['default'] = NULL;
    }
    $options['path'] = [
      'default' => 'charts',
    ];
    return $options;
  }

  /**
   * {@inheritdoc}
   */
  public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    parent::buildOptionsForm($form, $form_state);
    $handlers = $this->displayHandler
      ->getHandlers('field');
    if (empty($handlers)) {
      $form['error_markup'] = [
        '#markup' => '<div class="error messages">' . t('You need at least one field before you can configure your table settings') . '</div>',
      ];
    }

    // Limit grouping options (we only support one grouping field).
    if (isset($form['grouping'][0])) {
      $form['grouping'][0]['field']['#title'] = t('Grouping field');
      $form['grouping'][0]['field']['#description'] = t('If grouping by a particular field, that field will be used to determine stacking of the chart. Generally this will be the same field as what you select for the "Label field" below. If you do not have more than one "Provides data" field below, there will be nothing to stack. If you want to have another series displayed, use a "Chart attachment" display, and set it to attach to this display.');
      $form['grouping'][0]['field']['#attributes']['class'][] = 'charts-grouping-field';

      // Grouping by rendered version has no effect in charts. Hide the options.
      $form['grouping'][0]['rendered']['#access'] = FALSE;
      $form['grouping'][0]['rendered_strip']['#access'] = FALSE;
    }
    if (isset($form['grouping'][1])) {
      $form['grouping'][1]['#access'] = FALSE;
    }

    // Add a views-specific chart option to allow advanced rendering.
    $form['allow_advanced_rendering'] = [
      '#type' => 'checkbox',
      '#title' => $this
        ->t('Allow advanced rendering'),
      '#description' => $this
        ->t('Allow views field rewriting etc. for label and data fields. This can break charts if you rewrite the field to a value the charting library cannot handle - e.g. passing a string value into a numeric data column.'),
      '#default_value' => $this->options['allow_advanced_rendering'],
    ];

    // Merge in the global chart settings form.
    $field_options = $this->displayHandler
      ->getFieldLabels();
    $form_state
      ->set('default_options', $this->options);
    $form = $this->chartsBaseSettingsForm
      ->getChartsBaseSettingsForm($form, $this->options, $field_options, [
      'style_options',
    ], 'view');
  }

  /**
   * {@inheritdoc}
   */
  public function validate() {
    $errors = parent::validate();
    $dataFields = $this->options['data_fields'];
    $dataFieldsValueState = [];

    // Avoid calling validation before arriving on the view edit page.
    if (\Drupal::routeMatch()
      ->getRouteName() != 'views_ui.add') {
      if (isset($dataFields)) {
        foreach ($dataFields as $value) {
          if (empty($value)) {
            array_push($dataFieldsValueState, 0);
          }
          else {
            array_push($dataFieldsValueState, 1);
          }
        }
      }

      // If total sum of dataFieldsValueState is less than 1, then no dataFields
      // were selected otherwise 1 or more selected total sum will be greater
      // than 1.
      if (array_sum($dataFieldsValueState) < 1) {
        $errors[] = $this
          ->t('At least one data field must be selected in the chart configuration before this chart may be shown');
      }
    }
    return $errors;
  }

  /**
   * {@inheritdoc}
   */
  public function render() {
    $field_handlers = $this->view
      ->getHandlers('field');

    // Calculate the labels field alias.
    $label_field = FALSE;
    $label_field_key = NULL;
    if ($this->options['label_field'] && array_key_exists($this->options['label_field'], $field_handlers)) {
      $label_field = $field_handlers[$this->options['label_field']];
      $label_field_key = $this->options['label_field'];
    }

    // Assemble the fields to be used to provide data access.
    $data_field_options = array_filter($this->options['data_fields']);
    $data_fields = [];
    foreach ($data_field_options as $field_key) {
      if (isset($field_handlers[$field_key])) {
        $data_fields[$field_key] = $field_handlers[$field_key];
      }
    }

    // Do not allow the label field to be used as a data field.
    if (isset($data_fields[$label_field_key])) {
      unset($data_fields[$label_field_key]);
    }

    // Allow argument tokens in the title
    if (!empty($this->view->build_info['substitutions'])) {
      $tokens = $this->view->build_info['substitutions'];
      $title = $this->options['title_position'] ? $this->options['title'] : FALSE;
      $title = $this
        ->viewsTokenReplace($title, $tokens);
      $this->options['title'] = $title;
    }
    else {
      $title = $this->options['title_position'] ? $this->options['title'] : FALSE;
    }
    $chart_id = $this->view
      ->id() . '__' . $this->view->current_display;
    $chart = [
      '#type' => 'chart',
      '#chart_type' => $this->options['type'],
      '#chart_library' => $this->options['library'],
      '#chart_id' => $chart_id,
      '#id' => 'chart_' . $chart_id,
      //  '#title' => $this->options['title_position'] ? $this->options['title'] : FALSE,
      '#title' => $title,
      '#title_position' => $this->options['title_position'],
      '#tooltips' => $this->options['tooltips'],
      '#data_labels' => $this->options['data_labels'],
      '#colors' => isset($this->options['colors']) ? $this->options['colors'] : NULL,
      '#background' => $this->options['background'] ? $this->options['background'] : 'transparent',
      '#legend' => $this->options['legend_position'] ? TRUE : FALSE,
      '#legend_position' => $this->options['legend_position'] ? $this->options['legend_position'] : NULL,
      '#width' => $this->options['width'],
      '#height' => $this->options['height'],
      '#width_units' => $this->options['width_units'],
      '#height_units' => $this->options['height_units'],
      '#view' => $this->view,
      // Pass info about the actual view results to allow further processing.
      '#theme' => 'views_view_charts',
    ];
    $chartTypes = new ChartsTypeInfo();
    $chart_type_info = $chartTypes
      ->getChartType($this->options['type']);
    if ($chart_type_info['axis'] === ChartsInterface::CHARTS_SINGLE_AXIS) {
      $data_field_key = key($data_fields);
      $data_field = $data_fields[$data_field_key];
      $data = [];
      $this
        ->renderFields($this->view->result);
      $renders = $this->rendered_fields;
      foreach ($renders as $row_number => $row) {
        $data_row = [];
        if ($label_field_key) {

          // Labels need to be decoded, as the charting library will re-encode.
          $data_row[] = htmlspecialchars_decode($this
            ->getField($row_number, $label_field_key), ENT_QUOTES);
        }
        $value = $this
          ->getField($row_number, $data_field_key);

        // Convert empty strings to NULL.
        if ($value === '') {
          $value = NULL;
        }
        else {

          // Strip thousands placeholders if present, then cast to float.
          $value = (double) str_replace([
            ',',
            ' ',
          ], '', $value);
        }
        $data_row[] = $value;
        $data[] = $data_row;
      }
      if ($label_field) {
        $chart['#legend_title'] = $label_field['label'];
      }
      $chart[$this->view->current_display . '_series'] = [
        '#type' => 'chart_data',
        '#data' => $data,
        '#title' => $data_field['label'],
      ];
    }
    else {
      $chart['xaxis'] = [
        '#type' => 'chart_xaxis',
        '#title' => $this->options['xaxis_title'] ? $this->options['xaxis_title'] : FALSE,
        '#labels_rotation' => $this->options['xaxis_labels_rotation'],
      ];
      $chart['yaxis'] = [
        '#type' => 'chart_yaxis',
        '#title' => $this->options['yaxis_title'] ? $this->options['yaxis_title'] : FALSE,
        '#labels_rotation' => $this->options['yaxis_labels_rotation'],
        '#max' => $this->options['yaxis_max'],
        '#min' => $this->options['yaxis_min'],
      ];
      $sets = $this
        ->renderGrouping($this->view->result, $this->options['grouping'], TRUE);
      $series_index = -1;
      foreach ($sets as $series_label => $data_set) {
        $series_index++;
        foreach ($data_fields as $field_key => $field_handler) {
          $chart[$this->view->current_display . '__' . $field_key . '_' . $series_index] = [
            '#type' => 'chart_data',
            '#data' => [],
            // If using a grouping field, inherit from the chart level colors.
            '#color' => $series_label === '' && isset($this->options['field_colors'][$field_key]) ? $this->options['field_colors'][$field_key] : NULL,
            '#title' => $series_label ? $series_label : $field_handler['label'],
            '#prefix' => $this->options['yaxis_prefix'] ? $this->options['yaxis_prefix'] : NULL,
            '#suffix' => $this->options['yaxis_suffix'] ? $this->options['yaxis_suffix'] : NULL,
            '#decimal_count' => $this->options['yaxis_decimal_count'] ? $this->options['yaxis_decimal_count'] : NULL,
          ];
        }

        // Grouped results come back indexed by their original result number
        // from before the grouping, so we need to keep our own row number when
        // looping through the rows.
        $row_number = 0;
        foreach ($data_set['rows'] as $result_number => $row) {
          if ($label_field_key && !isset($chart['xaxis']['#labels'][$row_number])) {
            $chart['xaxis']['#labels'][$row_number] = $this
              ->getField($result_number, $label_field_key);
          }
          foreach ($data_fields as $field_key => $field_handler) {

            // Don't allow the grouping field to provide data.
            if (isset($this->options['grouping'][0]['field']) && $field_key === $this->options['grouping'][0]['field']) {
              continue;
            }
            $value = $this
              ->getField($result_number, $field_key);

            // Convert empty strings to NULL.
            if ($value === '') {
              $value = NULL;
            }
            else {

              // Strip thousands placeholders if present, then cast to float.
              $value = (double) str_replace([
                ',',
                ' ',
              ], '', $value);
            }
            $chart[$this->view->current_display . '__' . $field_key . '_' . $series_index]['#data'][] = $value;
          }
          $row_number++;
        }
      }
    }

    // Check if this display has any children charts that should be applied
    // on top of it.
    $children_displays = $this
      ->getChildrenChartDisplays();

    // Contains the different subviews of the attachments.
    $attachments = [];
    foreach ($children_displays as $child_display) {

      // If the user doesn't have access to the child display, skip.
      if (!$this->view
        ->access($child_display)) {
        continue;
      }

      // Generate the subchart by executing the child display. We load a fresh
      // view here to avoid collisions in shifting the current display while in
      // a display.
      $subview = $this->view
        ->createDuplicate();
      $subview
        ->setDisplay($child_display);

      // Copy the settings for our axes over to the child view.
      foreach ($this->options as $option_name => $option_value) {
        if ($this->view->displayHandlers
          ->get($child_display)->options['inherit_yaxis'] === '1') {
          $subview->display_handler->options['style_options'][$option_name] = $option_value;
        }
      }

      // Set the arguments on the subview if it is configured to inherit arguments.
      if (!empty($this->view->displayHandlers
        ->get($child_display)->display['display_options']['inherit_arguments']) && $this->view->displayHandlers
        ->get($child_display)->display['display_options']['inherit_arguments'] == '1') {
        $subview
          ->setArguments($this->view->args);
      }

      // Execute the subview and get the result.
      $subview
        ->preExecute();
      $subview
        ->execute();

      // If there's no results, don't attach the subview.
      if (empty($subview->result)) {
        continue;
      }
      $subchart = $subview->style_plugin
        ->render();

      // Add attachment views to attachments array.
      array_push($attachments, $subview);

      // Create a secondary axis if needed.
      if ($this->view->displayHandlers
        ->get($child_display)->options['inherit_yaxis'] !== '1' && isset($subchart['yaxis'])) {
        $chart['secondary_yaxis'] = $subchart['yaxis'];
        $chart['secondary_yaxis']['#opposite'] = TRUE;
      }

      // Merge in the child chart data.
      foreach (Element::children($subchart) as $key) {
        if ($subchart[$key]['#type'] === 'chart_data') {
          $chart[$key] = $subchart[$key];

          // If the subchart is a different type than the parent chart, set
          // the #chart_type property on the individual chart data elements.
          if ($subchart['#chart_type'] !== $chart['#chart_type']) {
            $chart[$key]['#chart_type'] = $subchart['#chart_type'];
          }
          if ($this->view->displayHandlers
            ->get($child_display)->options['inherit_yaxis'] !== '1') {
            $chart[$key]['#target_axis'] = 'secondary_yaxis';
          }
        }
      }
    }
    $this->attachmentService
      ->setAttachmentViews($attachments);

    // Print the chart.
    return $chart;
  }

  /**
   * Utility function to check if this chart has a parent display.
   *
   * @return bool
   *   Parent Display.
   */
  public function getParentChartDisplay() {
    $parent_display = FALSE;
    return $parent_display;
  }

  /**
   * Utility function to check if this chart has children displays.
   *
   * @return array
   *   Children Chart Display.
   */
  public function getChildrenChartDisplays() {
    $children_displays = $this->displayHandler
      ->getAttachedDisplays();
    foreach ($children_displays as $key => $child) {
      $display_handler = $this->view->displayHandlers
        ->get($child);

      // Unset disabled & non chart attachments.
      if (!$display_handler
        ->isEnabled() || strstr($child, 'chart_extension') == !TRUE) {
        unset($children_displays[$key]);
      }
    }
    $children_displays = array_values($children_displays);
    return $children_displays;
  }

  /**
   * {@inheritdoc}
   */
  public function calculateDependencies() {
    $dependencies = [];
    if (!empty($this->options['library'])) {
      $plugin_definition = $this->chartManager
        ->getDefinition($this->options['library']);
      $dependencies['module'] = [
        $plugin_definition['provider'],
      ];
    }
    return $dependencies;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ChartsPluginStyleChart::$attachmentService protected property
ChartsPluginStyleChart::$chartManager protected property The chart manager service.
ChartsPluginStyleChart::$chartsBaseSettingsForm protected property
ChartsPluginStyleChart::$chartsDefaultSettings protected property
ChartsPluginStyleChart::$moduleHandler protected property
ChartsPluginStyleChart::$usesFields protected property Does the style plugin for itself support to add fields to its output. Overrides StylePluginBase::$usesFields
ChartsPluginStyleChart::$usesRowPlugin protected property Whether or not this style uses a row plugin. Overrides StylePluginBase::$usesRowPlugin
ChartsPluginStyleChart::buildOptionsForm public function Provide a form to edit options for this plugin. Overrides StylePluginBase::buildOptionsForm
ChartsPluginStyleChart::calculateDependencies public function Calculates dependencies for the configured plugin. Overrides PluginBase::calculateDependencies
ChartsPluginStyleChart::create public static function Creates an instance of the plugin. Overrides PluginBase::create
ChartsPluginStyleChart::defineOptions protected function Information about options for all kinds of purposes will be held here. Overrides StylePluginBase::defineOptions
ChartsPluginStyleChart::getChildrenChartDisplays public function Utility function to check if this chart has children displays.
ChartsPluginStyleChart::getParentChartDisplay public function Utility function to check if this chart has a parent display.
ChartsPluginStyleChart::render public function Render the display in this style. Overrides StylePluginBase::render
ChartsPluginStyleChart::validate public function Validate that the plugin is correct and can be saved. Overrides StylePluginBase::validate
ChartsPluginStyleChart::__construct public function Constructs a ChartsPluginStyleChart object. Overrides PluginBase::__construct
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
MessengerTrait::$messenger protected property The messenger. 29
MessengerTrait::messenger public function Gets the messenger. 29
MessengerTrait::setMessenger public function Sets the messenger.
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$definition public property Plugins's definition
PluginBase::$displayHandler public property The display object this plugin is for.
PluginBase::$options public property Options for this plugin will be held here.
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::$renderer protected property Stores the render API renderer. 3
PluginBase::$view public property The top object of a view. 1
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::doFilterByDefinedOptions protected function Do the work to filter out stored options depending on the defined options.
PluginBase::filterByDefinedOptions public function Filter out stored options depending on the defined options. Overrides ViewsPluginInterface::filterByDefinedOptions
PluginBase::getAvailableGlobalTokens public function Returns an array of available token replacements. Overrides ViewsPluginInterface::getAvailableGlobalTokens
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::getProvider public function Returns the plugin provider. Overrides ViewsPluginInterface::getProvider
PluginBase::getRenderer protected function Returns the render API renderer. 1
PluginBase::globalTokenForm public function Adds elements for available core tokens to a form. Overrides ViewsPluginInterface::globalTokenForm
PluginBase::globalTokenReplace public function Returns a string with any core tokens replaced. Overrides ViewsPluginInterface::globalTokenReplace
PluginBase::INCLUDE_ENTITY constant Include entity row languages when listing languages.
PluginBase::INCLUDE_NEGOTIATED constant Include negotiated languages when listing languages.
PluginBase::isConfigurable public function Determines if the plugin is configurable.
PluginBase::listLanguages protected function Makes an array of languages, optionally including special languages.
PluginBase::pluginTitle public function Return the human readable name of the display. Overrides ViewsPluginInterface::pluginTitle
PluginBase::preRenderAddFieldsetMarkup public static function Moves form elements into fieldsets for presentation purposes. Overrides ViewsPluginInterface::preRenderAddFieldsetMarkup
PluginBase::preRenderFlattenData public static function Flattens the structure of form elements. Overrides ViewsPluginInterface::preRenderFlattenData
PluginBase::queryLanguageSubstitutions public static function Returns substitutions for Views queries for languages.
PluginBase::setOptionDefaults protected function Fills up the options of the plugin with defaults.
PluginBase::submitOptionsForm public function Handle any special handling on the validate form. Overrides ViewsPluginInterface::submitOptionsForm 16
PluginBase::summaryTitle public function Returns the summary of the settings in the display. Overrides ViewsPluginInterface::summaryTitle 6
PluginBase::themeFunctions public function Provide a full list of possible theme templates used by this style. Overrides ViewsPluginInterface::themeFunctions 1
PluginBase::unpackOptions public function Unpack options over our existing defaults, drilling down into arrays so that defaults don't get totally blown away. Overrides ViewsPluginInterface::unpackOptions
PluginBase::usesOptions public function Returns the usesOptions property. Overrides ViewsPluginInterface::usesOptions 8
PluginBase::viewsTokenReplace protected function Replaces Views' tokens in a given string. The resulting string will be sanitized with Xss::filterAdmin. 1
PluginBase::VIEWS_QUERY_LANGUAGE_SITE_DEFAULT constant Query string to indicate the site default language.
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.
StylePluginBase::$defaultFieldLabels protected property Should field labels be enabled by default. 1
StylePluginBase::$groupingTheme protected property The theme function used to render the grouping set.
StylePluginBase::$rendered_fields protected property Stores the rendered field values, keyed by the row index and field name.
StylePluginBase::$rowTokens protected property Store all available tokens row rows.
StylePluginBase::$usesGrouping protected property Does the style plugin support grouping of rows. 3
StylePluginBase::$usesOptions protected property Denotes whether the plugin has an additional options form. Overrides PluginBase::$usesOptions
StylePluginBase::$usesRowClass protected property Does the style plugin support custom css class for the rows. 3
StylePluginBase::buildSort public function Called by the view builder to see if this style handler wants to interfere with the sorts. If so it should build; if it returns any non-TRUE value, normal sorting will NOT be added to the query. 1
StylePluginBase::buildSortPost public function Called by the view builder to let the style build a second set of sorts that will come after any other sorts in the view. 1
StylePluginBase::defaultFieldLabels public function Return TRUE if this style enables field labels by default. 1
StylePluginBase::destroy public function Clears a plugin. Overrides PluginBase::destroy
StylePluginBase::elementPreRenderRow public function #pre_render callback for view row field rendering.
StylePluginBase::evenEmpty public function Should the output of the style plugin be rendered even if it's a empty view. 2
StylePluginBase::getField public function Gets a rendered field.
StylePluginBase::getFieldValue public function Get the raw field value.
StylePluginBase::getRowClass public function Return the token replaced row class for the specified row.
StylePluginBase::init public function Overrides \Drupal\views\Plugin\views\PluginBase::init(). Overrides PluginBase::init
StylePluginBase::preRender public function Allow the style to do stuff before each row is rendered.
StylePluginBase::query public function Add anything to the query that we might need to. Overrides PluginBase::query 1
StylePluginBase::renderFields protected function Renders all of the fields for a given style and store them on the object.
StylePluginBase::renderGrouping public function Group records as needed for rendering.
StylePluginBase::renderGroupingSets public function Render the grouping sets.
StylePluginBase::renderRowGroup protected function Renders a group of rows of the grouped view.
StylePluginBase::tokenizeValue public function Take a value and apply token replacement logic to it.
StylePluginBase::trustedCallbacks public static function Lists the trusted callbacks provided by the implementing class. Overrides PluginBase::trustedCallbacks
StylePluginBase::usesFields public function Return TRUE if this style also uses fields. 3
StylePluginBase::usesGrouping public function Returns the usesGrouping property. 3
StylePluginBase::usesRowClass public function Returns the usesRowClass property. 3
StylePluginBase::usesRowPlugin public function Returns the usesRowPlugin property. 10
StylePluginBase::usesTokens public function Return TRUE if this style uses tokens.
StylePluginBase::validateOptionsForm public function Validate the options form. Overrides PluginBase::validateOptionsForm
StylePluginBase::wizardForm public function Provide a form in the views wizard if this style is selected.
StylePluginBase::wizardSubmit public function Alter the options of a display before they are added to the view. 1
TrustedCallbackInterface::THROW_EXCEPTION constant Untrusted callbacks throw exceptions.
TrustedCallbackInterface::TRIGGER_SILENCED_DEPRECATION constant Untrusted callbacks trigger silenced E_USER_DEPRECATION errors.
TrustedCallbackInterface::TRIGGER_WARNING constant Untrusted callbacks trigger E_USER_WARNING errors.