Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
MUR Drupal
d3_sankey
Commits
dc329a53
Commit
dc329a53
authored
Aug 18, 2016
by
M Parker
Browse files
Add functions to output options arrays for constants.
parent
3af18dc8
Changes
1
Hide whitespace changes
Inline
Side-by-side
d3_sankey.module
View file @
dc329a53
...
...
@@ -183,6 +183,46 @@ function d3_sankey_libraries_info_alter(&$libraries) {
/* Helper functions. */
/**
* Helper function to return an array of Sankey chart type options.
*
* The output from this function is intended to be used as the '#options'
* property for Form API 'checkboxes', 'radios', 'select', and 'tableselect'
* controls.
*
* @return array
* An associative array, where the key is a string representing the type of
* Sankey chart, and the value is a string containing a translated label for
* that type of Sankey chart.
*/
function
d3_sankey_options_sankeytype
()
{
return
array
(
D3_SANKEY_SANKEYTYPE_DEFAULT
=>
t
(
'Default'
),
D3_SANKEY_SANKEYTYPE_SELECTION
=>
t
(
'Current item selection'
),
D3_SANKEY_SANKEYTYPE_PATH
=>
t
(
'Current item and path selection'
),
);
}
/**
* Helper function to return an array of Sankey label alignment options.
*
* The output from this function is intended to be used as the '#options'
* property for Form API 'checkboxes', 'radios', 'select', and 'tableselect'
* controls.
*
* @return array
* An associative array, where the key is a string representing the alignment
* for node labels in a Sankey chart, and the value is a string containing a
* translated label for that type of label alignment.
*/
function
d3_sankey_options_alignlabel
()
{
return
array
(
D3_SANKEY_ALIGNLABEL_AUTO
=>
t
(
'Automatically align labels'
),
D3_SANKEY_ALIGNLABEL_START
=>
t
(
'Align labels to start of paths'
),
D3_SANKEY_ALIGNLABEL_END
=>
t
(
'Align labels to end of paths'
),
);
}
/**
* Helper function to return the path to the libraries contained in this module.
*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment