[ 'name' => 'Ja-Nein-Abstimmung', 'labels' => [ 'Ja', 'Nein', 'Enth.' ], 'values' => [ '1' => 'Ja', '0' => 'Nein', '-100' => 'Enthaltung', ], 'colors' => [ '1' => 'green', '0' => 'red', '-100' => 'grey', ], 'caption' => [ '1' => 'Ja', '0' => 'Nein', ], 'styles' => [ '1' => 'background-color:green; color:white;', '0' => 'background-color:red; color:white;', ], 'approval' => function( $votes ){ return $votes['1']['count'] / ( $votes['1']['count'] + $votes['0']['count'] ); }, ], 'consensus-3' => [ 'name' => 'Konsensierung (0-3)', 'labels' => [ '0', '1', '2', '3', '/' ], 'values' => [ '0' => 'kein Widerstand (0)', '1' => 'leichter Widerstand (1)', '2' => 'mittlerer Widerstand (2)', '3' => 'großer Widerstand (3)', '-100' => 'Enthaltung', ], 'colors' => [ '0' => '#0a9d00', '1' => '#a2da00', '2' => '#eca000', '3' => '#cd0500', '-100' => 'grey', ], 'caption' => [ '0' => '0', '1' => '', '2' => '', '3' => '3', ], 'styles' => [ '0' => 'color: green; background-color:#06fa64', '1' => 'color: #47c557; background-color:#47c557', '2' => 'color: #ba6b42; background-color:#ba6b42', '3' => 'color: white; background-color:#fd342c', ], 'approval' => function( $votes ){ $voteCount = 0; $resistance = 0; foreach ( $votes as $key => $data ){ if ( $key < 0 ){ continue; } $voteCount += $data['count']; $resistance += $key * $data['count']; } return 1 - ( $resistance / ( 3 * $voteCount ) ); }, ], 'consensus-5' => [ 'name' => 'Konsensierung (0-5)', 'labels' => [ '0', '1', '2', '3', '4', '5', '/' ], 'values' => [ '0' => 'kein Widerstand (0)', '1' => 'leichter Widerstand (1)', '2' => 'mittlerer Widerstand (2)', '3' => 'mittlerer Widerstand (3)', '4' => 'großer Widerstand (4)', '5' => 'maximaler Widerstand (5)', '-100' => 'Enthaltung', ], 'colors' => [ '0' => '#0a9d00', '1' => '#75c800', '2' => '#d0ec00', '3' => '#f8db00', '4' => '#e16a00', '5' => '#cd0500', '-100' => 'grey', ], 'caption' => [ '0' => '0', '1' => '', '2' => '', '3' => '', '4' => '', '5' => '5', ], 'styles' => [ '0' => 'color: green; background-color:#06fa64', '1' => 'color: #29de5d; background-color:#29de5d', '2' => 'color: #5eb453; background-color:#5eb453', '3' => 'color: #a17e46; background-color:#a17e46', '4' => 'color: #c7603f; background-color:#c7603f', '5' => 'color: white; background-color:#fd342c', ], 'approval' => function( $votes ){ $voteCount = 0; $resistance = 0; foreach ( $votes as $key => $data ){ if ( $key < 0 ){ continue; } $voteCount += $data['count']; $resistance += $key * $data['count']; } return 1 - ( $resistance / ( 5 * $voteCount ) ); }, ], 'consensus-10' => [ 'name' => 'Konsensierung (0-10)', 'labels' => [ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '/' ], 'values' => [ '0' => 'kein Widerstand (0)', '1' => 'leichter Widerstand (1)', '2' => 'leichter Widerstand (2)', '3' => 'leichter Widerstand (3)', '4' => 'mittlerer Widerstand (4)', '5' => 'mittlerer Widerstand (5)', '6' => 'mittlerer Widerstand (6)', '7' => 'großer Widerstand (7)', '8' => 'großer Widerstand (8)', '9' => 'großer Widerstand (9)', '10' => 'maximaler Widerstand (10)', '-100' => 'Enthaltung', ], 'colors' => [ '0' => '#0a9d00', '1' => '#41b300', '2' => '#75c800', '3' => '#a2da00', '4' => '#d0ec00', '5' => '#fbfd00', '6' => '#f8db00', '7' => '#eca000', '8' => '#e16a00', '9' => '#d73500', '10' => '#cd0500', '-100' => 'grey', ], 'caption' => [ '0' => '0', '1' => '', '2' => '', '3' => '', '4' => '', '5' => '5', '6' => '', '7' => '', '8' => '', '9' => '', '10' => '10', ], 'styles' => [ '0' => 'color: green; background-color:#06fa64', '1' => 'color: #1aea60; background-color:#1aea60', '2' => 'color: #29de5d; background-color:#29de5d', '3' => 'color: #47c557; background-color:#47c557', '4' => 'color: #5eb453; background-color:#5eb453', '5' => 'color: white; background-color:#81974c', '6' => 'color: #a17e46; background-color:#a17e46', '7' => 'color: #ba6b42; background-color:#ba6b42', '8' => 'color: #c7603f; background-color:#c7603f', '9' => 'color: #e14b3a; background-color:#e14b3a', '10' => 'color: white; background-color:#fd342c', ], 'approval' => function( $votes ){ $voteCount = 0; $resistance = 0; foreach ( $votes as $key => $data ){ if ( $key < 0 ){ continue; } $voteCount += $data['count']; $resistance += $key * $data['count']; } return 1 - ( $resistance / ( 10 * $voteCount ) ); }, ], 'single-choice' => [ 'name' => 'Single-Choice', 'labels' => [ 'gewählt' ], 'values' => [ '1' => 'gewählt', ], 'colors' => [ '1' => 'green', ], 'styles' => [ '1' => 'background-color:#1f1f86; color:white; text-align:right; padding-right:0.5em;', ], 'approval' => function( $votes, $participantCount ){ return $votes['1']['count'] / $participantCount; }, ], 'multiple-choice-2' => [ 'name' => 'Multiple-Choice (2)', 'labels' => [ 'gewählt' ], 'values' => [ '1' => 'gewählt', ], 'colors' => [ '1' => 'green', ], 'styles' => [ '1' => 'background-color:#1f1f86; color:white; text-align:right; padding-right:0.5em;', ], 'approval' => function( $votes, $participantCount ){ return $votes['1']['count'] / ( 2 * $participantCount ); }, ], 'multiple-choice-3' => [ 'name' => 'Multiple-Choice (3)', 'labels' => [ 'gewählt' ], 'values' => [ '1' => 'gewählt', ], 'colors' => [ '1' => 'green', ], 'styles' => [ '1' => 'background-color:#1f1f86; color:white; text-align:right; padding-right:0.5em;', ], 'approval' => function( $votes, $participantCount ){ return $votes['1']['count'] / ( 3 * $participantCount ); }, ], 'multiple-choice-4' => [ 'name' => 'Multiple-Choice (4)', 'labels' => [ 'gewählt' ], 'values' => [ '1' => 'gewählt', ], 'colors' => [ '1' => 'green', ], 'styles' => [ '1' => 'background-color:#1f1f86; color:white; text-align:right; padding-right:0.5em;', ], 'approval' => function( $votes, $participantCount ){ return $votes['1']['count'] / ( 4 * $participantCount ); }, ], 'multiple-choice-all' => [ 'name' => 'Multiple-Choice (alle)', 'labels' => [ 'gewählt' ], 'values' => [ '1' => 'gewählt', ], 'colors' => [ '1' => 'green', ], 'styles' => [ '1' => 'background-color:#1f1f86; color:white; text-align:right; padding-right:0.5em;', ], 'approval' => function( $votes, $participantCount, $optionCount ){ return $votes['1']['count'] / ( $optionCount * $participantCount ); }, ], ];