diff --git a/commands/stat/actions/XPowerDistrib3Action.php b/commands/stat/actions/XPowerDistrib3Action.php index 673a4f79a..8b54a9067 100644 --- a/commands/stat/actions/XPowerDistrib3Action.php +++ b/commands/stat/actions/XPowerDistrib3Action.php @@ -1,7 +1,7 @@ */ @@ -197,6 +197,11 @@ private function updateDistrib(Connection $db): bool private function updateDistribAbstract(Connection $db): bool { + $percentile = fn (float $p): string => sprintf( + 'PERCENTILE_CONT(%.2f) WITHIN GROUP (ORDER BY {{t}}.[[x_power]] ASC)', + $p, + ); + $select = (new Query()) ->select([ 'season_id' => '{{t}}.[[season_id]]', @@ -204,7 +209,12 @@ private function updateDistribAbstract(Connection $db): bool 'users' => 'COUNT(*)', 'average' => 'AVG({{t}}.[[x_power]])', 'stddev' => 'STDDEV_SAMP({{t}}.[[x_power]])', - 'median' => 'PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY {{t}}.[[x_power]] ASC)', + 'median' => $percentile(0.5), + 'pct5' => $percentile(0.05), + 'pct25' => $percentile(0.25), + 'pct75' => $percentile(0.75), + 'pct80' => $percentile(0.80), + 'pct95' => $percentile(0.95), ]) ->from(['t' => self::TMP_USER_XPOWER_TABLE_NAME]) ->groupBy(['season_id', 'rule_id']); diff --git a/components/widgets/Budoux.php b/components/widgets/Budoux.php index 5fabe37d3..605c06326 100644 --- a/components/widgets/Budoux.php +++ b/components/widgets/Budoux.php @@ -10,6 +10,7 @@ namespace app\components\widgets; +use Yii; use app\assets\budoux\BudouxWebComponentsJaAsset; use app\assets\budoux\BudouxWebComponentsZhHansAsset; use app\assets\budoux\BudouxWebComponentsZhHantAsset; diff --git a/messages/de/app.php b/messages/de/app.php index 6e0d3beca..6e7904e25 100644 --- a/messages/de/app.php +++ b/messages/de/app.php @@ -240,6 +240,7 @@ 'Filter' => '', 'Filter Query' => '', 'Final Count' => '', + 'For the actual distribution, see the charts for each mode.' => '', 'for {title}' => '', 'Freshness' => '', 'Friend Code' => '', @@ -626,6 +627,7 @@ 'These battles were recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => '', 'The width of the histogram bins is automatically adjusted by Scott\'s rule-based algorithm.' => '', 'This battle was recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => '', + 'This chart assumes simple normal distribution of the Power to make it easier to compare each mode.' => '', 'This data is based on {siteName} users and differs significantly from overall game statistics.' => '', 'This data is basically not informative.' => '', 'This data was totaled after normalization to 5 minute intervals for each battle.' => '', diff --git a/messages/en-GB/app.php b/messages/en-GB/app.php index d1920770e..a2371c359 100644 --- a/messages/en-GB/app.php +++ b/messages/en-GB/app.php @@ -241,6 +241,7 @@ 'Filter' => '', 'Filter Query' => '', 'Final Count' => '', + 'For the actual distribution, see the charts for each mode.' => '', 'for {title}' => '', 'Freshness' => '', 'Friend Code' => '', @@ -627,6 +628,7 @@ 'These battles were recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => '', 'The width of the histogram bins is automatically adjusted by Scott\'s rule-based algorithm.' => '', 'This battle was recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => '', + 'This chart assumes simple normal distribution of the Power to make it easier to compare each mode.' => '', 'This data is based on {siteName} users and differs significantly from overall game statistics.' => '', 'This data is basically not informative.' => '', 'This data was totaled after normalization to 5 minute intervals for each battle.' => 'This data was totalled after normalisation to 5 minute intervals for each battle.', diff --git a/messages/es-MX/app.php b/messages/es-MX/app.php index d58b6b08c..23e4353f4 100644 --- a/messages/es-MX/app.php +++ b/messages/es-MX/app.php @@ -242,6 +242,7 @@ 'Filter' => '', 'Filter Query' => '', 'Final Count' => '', + 'For the actual distribution, see the charts for each mode.' => '', 'for {title}' => '', 'Freshness' => '', 'Friend Code' => '', @@ -628,6 +629,7 @@ 'These battles were recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => 'Estas batallas fueron registradas con una versión de IkaLog. Actualice a la versión más reciente.', 'The width of the histogram bins is automatically adjusted by Scott\'s rule-based algorithm.' => '', 'This battle was recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => 'Esta batalla fue grabada con una versión de IkaLog. Actualice a la versión más reciente.', + 'This chart assumes simple normal distribution of the Power to make it easier to compare each mode.' => '', 'This data is based on {siteName} users and differs significantly from overall game statistics.' => '', 'This data is basically not informative.' => '', 'This data was totaled after normalization to 5 minute intervals for each battle.' => '', diff --git a/messages/es/app.php b/messages/es/app.php index 90e6c416c..8b523eaf5 100644 --- a/messages/es/app.php +++ b/messages/es/app.php @@ -242,6 +242,7 @@ 'Filter' => '', 'Filter Query' => '', 'Final Count' => '', + 'For the actual distribution, see the charts for each mode.' => '', 'for {title}' => '', 'Freshness' => '', 'Friend Code' => 'Clave de amigo', @@ -628,6 +629,7 @@ 'These battles were recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => 'Estas batallas fueron registradas con una versión de IkaLog. Actualice a la versión más reciente.', 'The width of the histogram bins is automatically adjusted by Scott\'s rule-based algorithm.' => '', 'This battle was recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => 'Esta batalla fue grabada con una versión de IkaLog. Actualice a la versión más reciente.', + 'This chart assumes simple normal distribution of the Power to make it easier to compare each mode.' => '', 'This data is based on {siteName} users and differs significantly from overall game statistics.' => '', 'This data is basically not informative.' => '', 'This data was totaled after normalization to 5 minute intervals for each battle.' => '', diff --git a/messages/fr-CA/app.php b/messages/fr-CA/app.php index f125c5f67..d21f6e9e1 100644 --- a/messages/fr-CA/app.php +++ b/messages/fr-CA/app.php @@ -240,6 +240,7 @@ 'Filter' => '', 'Filter Query' => '', 'Final Count' => '', + 'For the actual distribution, see the charts for each mode.' => '', 'for {title}' => '', 'Freshness' => '', 'Friend Code' => '', @@ -626,6 +627,7 @@ 'These battles were recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => '', 'The width of the histogram bins is automatically adjusted by Scott\'s rule-based algorithm.' => '', 'This battle was recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => '', + 'This chart assumes simple normal distribution of the Power to make it easier to compare each mode.' => '', 'This data is based on {siteName} users and differs significantly from overall game statistics.' => '', 'This data is basically not informative.' => '', 'This data was totaled after normalization to 5 minute intervals for each battle.' => '', diff --git a/messages/fr/app.php b/messages/fr/app.php index 1292e4d42..1b1952829 100644 --- a/messages/fr/app.php +++ b/messages/fr/app.php @@ -243,6 +243,7 @@ 'Filter' => 'Filtre', 'Filter Query' => 'Requête de Filtre', 'Final Count' => 'Progression Finale', + 'For the actual distribution, see the charts for each mode.' => '', 'for {title}' => 'pour {title}', 'Freshness' => 'Titre d\'arme', 'Friend Code' => 'Code ami', @@ -629,6 +630,7 @@ 'These battles were recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => 'Ces matchs ont été enregistrés avec une version obsolète d\'IkaLog. Veuillez mettre l\'application à jour.', 'The width of the histogram bins is automatically adjusted by Scott\'s rule-based algorithm.' => '', 'This battle was recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => 'Ce match a été enregistré avec une version obsolète d\'IkaLog. Veuillez mettre l\'application à jour.', + 'This chart assumes simple normal distribution of the Power to make it easier to compare each mode.' => '', 'This data is based on {siteName} users and differs significantly from overall game statistics.' => 'Ces données viennent de la base d\'utilisateurs de {siteName} et ne correspondent pas aux statistiques globales du jeu.', 'This data is basically not informative.' => '', 'This data was totaled after normalization to 5 minute intervals for each battle.' => 'Ces données ont été totalisées après une normalisation de chaque match à 5 minutes d\'intervalle chacun.', diff --git a/messages/it/app.php b/messages/it/app.php index 49e604e6d..151a302fe 100644 --- a/messages/it/app.php +++ b/messages/it/app.php @@ -240,6 +240,7 @@ 'Filter' => '', 'Filter Query' => '', 'Final Count' => '', + 'For the actual distribution, see the charts for each mode.' => '', 'for {title}' => '', 'Freshness' => '', 'Friend Code' => '', @@ -626,6 +627,7 @@ 'These battles were recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => '', 'The width of the histogram bins is automatically adjusted by Scott\'s rule-based algorithm.' => '', 'This battle was recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => '', + 'This chart assumes simple normal distribution of the Power to make it easier to compare each mode.' => '', 'This data is based on {siteName} users and differs significantly from overall game statistics.' => '', 'This data is basically not informative.' => '', 'This data was totaled after normalization to 5 minute intervals for each battle.' => '', diff --git a/messages/ja/app.php b/messages/ja/app.php index 83fc30eff..7e1006779 100644 --- a/messages/ja/app.php +++ b/messages/ja/app.php @@ -237,6 +237,7 @@ 'Filter Query' => 'フィルタクエリ', 'Filter' => 'フィルタ', 'Final Count' => '最終カウント', + 'For the actual distribution, see the charts for each mode.' => '実際の分布は各ルールのグラフを参照してください。', 'Freshness' => 'チョーシ', 'Friend Code (Switch)' => 'フレンドコード (Switch)', 'Friend Code' => 'フレンドコード', @@ -616,6 +617,7 @@ 'These battles were recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => '古いIkaLogで記録されました。情報が正しく解析されないため、最新のIkaLogへアップデートしてください。', 'This Month (UTC)' => '今月(ガチマ集計期間)', 'This battle was recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => 'このバトルは古いIkaLogで記録されました。情報が正しく解析されないため、最新のIkaLogへアップデートしてください。', + 'This chart assumes simple normal distribution of the Power to make it easier to compare each mode.' => 'このグラフは、各ルールを比較しやすくするために、パワーの単純な正規分布を仮定しています。', 'This data is based on {siteName} users and differs significantly from overall game statistics.' => 'このデータは{siteName}の利用者を集計したもので、ゲーム全体の統計とは大きく異なります。', 'This data is basically not informative.' => 'このデータは基本的には参考になりません。', 'This data was totaled after normalization to 5 minute intervals for each battle.' => 'データは5分間に正規化して集計しています。', diff --git a/messages/ko/app.php b/messages/ko/app.php index 6dea5036a..21bef16a9 100644 --- a/messages/ko/app.php +++ b/messages/ko/app.php @@ -242,6 +242,7 @@ 'Filter' => '필터', 'Filter Query' => '필터 쿼리', 'Final Count' => '최종 카운트', + 'For the actual distribution, see the charts for each mode.' => '', 'for {title}' => '', 'Freshness' => '컨디션', 'Friend Code' => '친구 코드', @@ -628,6 +629,7 @@ 'These battles were recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => '해당 배틀들은 구버전 IkaLog로 기록됐습니다. 최신 버전으로 업데이트 바랍니다.', 'The width of the histogram bins is automatically adjusted by Scott\'s rule-based algorithm.' => '', 'This battle was recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => '해당 배틀은 구버전 IkaLog로 기록됐습니다. 최신 버전으로 업데이트 바랍니다.', + 'This chart assumes simple normal distribution of the Power to make it easier to compare each mode.' => '', 'This data is based on {siteName} users and differs significantly from overall game statistics.' => '이 데이터는 {siteName} 유저들 기반이고 게임 전체 통계와는 큰 차이가 있습니다.', 'This data is basically not informative.' => '기본적으로 이 데이터는 유용하지 않습니다.', 'This data was totaled after normalization to 5 minute intervals for each battle.' => '', diff --git a/messages/nl/app.php b/messages/nl/app.php index cc140d9c9..dd8a28149 100644 --- a/messages/nl/app.php +++ b/messages/nl/app.php @@ -240,6 +240,7 @@ 'Filter' => '', 'Filter Query' => '', 'Final Count' => '', + 'For the actual distribution, see the charts for each mode.' => '', 'for {title}' => '', 'Freshness' => '', 'Friend Code' => '', @@ -626,6 +627,7 @@ 'These battles were recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => '', 'The width of the histogram bins is automatically adjusted by Scott\'s rule-based algorithm.' => '', 'This battle was recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => '', + 'This chart assumes simple normal distribution of the Power to make it easier to compare each mode.' => '', 'This data is based on {siteName} users and differs significantly from overall game statistics.' => '', 'This data is basically not informative.' => '', 'This data was totaled after normalization to 5 minute intervals for each battle.' => '', diff --git a/messages/ru/app.php b/messages/ru/app.php index 22ba50f86..0dca12fb7 100644 --- a/messages/ru/app.php +++ b/messages/ru/app.php @@ -240,6 +240,7 @@ 'Filter' => '', 'Filter Query' => '', 'Final Count' => '', + 'For the actual distribution, see the charts for each mode.' => '', 'for {title}' => '', 'Freshness' => '', 'Friend Code' => '', @@ -626,6 +627,7 @@ 'These battles were recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => '', 'The width of the histogram bins is automatically adjusted by Scott\'s rule-based algorithm.' => '', 'This battle was recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => '', + 'This chart assumes simple normal distribution of the Power to make it easier to compare each mode.' => '', 'This data is based on {siteName} users and differs significantly from overall game statistics.' => '', 'This data is basically not informative.' => '', 'This data was totaled after normalization to 5 minute intervals for each battle.' => '', diff --git a/messages/zh-CN/app.php b/messages/zh-CN/app.php index bfd4955d5..37260f7d3 100644 --- a/messages/zh-CN/app.php +++ b/messages/zh-CN/app.php @@ -243,6 +243,7 @@ 'Filter' => '筛选器', 'Filter Query' => '筛选标准', 'Final Count' => '最终计数', + 'For the actual distribution, see the charts for each mode.' => '', 'for {title}' => '该称号 {title}', 'Freshness' => '新鲜度', 'Friend Code' => '好友码', @@ -629,6 +630,7 @@ 'These battles were recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => '这些对战是由旧版的IkaLog记录。 请更新到最新版本。', 'The width of the histogram bins is automatically adjusted by Scott\'s rule-based algorithm.' => '', 'This battle was recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => '该对战是由旧版的IkaLog记录。请更新到最新版本。', + 'This chart assumes simple normal distribution of the Power to make it easier to compare each mode.' => '', 'This data is based on {siteName} users and differs significantly from overall game statistics.' => '', 'This data is basically not informative.' => '', 'This data was totaled after normalization to 5 minute intervals for each battle.' => '该数据是根据每场对战五分钟的间隔做归一化处理后汇总的。', diff --git a/messages/zh-TW/app.php b/messages/zh-TW/app.php index 7be218ef0..8926209fa 100644 --- a/messages/zh-TW/app.php +++ b/messages/zh-TW/app.php @@ -242,6 +242,7 @@ 'Filter' => '篩選器', 'Filter Query' => '篩選標準', 'Final Count' => '最終計數', + 'For the actual distribution, see the charts for each mode.' => '', 'for {title}' => '該稱號 {title}', 'Freshness' => '新鮮度', 'Friend Code' => '好友代碼', @@ -628,6 +629,7 @@ 'These battles were recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => '這些對戰是由舊版的IkaLog記錄。 請更新到最新版本。', 'The width of the histogram bins is automatically adjusted by Scott\'s rule-based algorithm.' => '', 'This battle was recorded with an outdated version of IkaLog. Please upgrade to the latest version.' => '該對戰是由舊版的IkaLog記錄。請更新到最新版本。', + 'This chart assumes simple normal distribution of the Power to make it easier to compare each mode.' => '', 'This data is based on {siteName} users and differs significantly from overall game statistics.' => '此資料僅基於 {siteName} 用戶,與整體遊戲的統計數據會有相當大的差異', 'This data is basically not informative.' => '這個資料基本上沒有訊息', 'This data was totaled after normalization to 5 minute intervals for each battle.' => '該資料的彙整是根據每場對戰五分鐘的間隔來做正規化處理。', diff --git a/migrations/m231115_085522_stat_x_power_distrib_abstract3_percentile.php b/migrations/m231115_085522_stat_x_power_distrib_abstract3_percentile.php new file mode 100644 index 000000000..26174d90d --- /dev/null +++ b/migrations/m231115_085522_stat_x_power_distrib_abstract3_percentile.php @@ -0,0 +1,56 @@ + + */ + +declare(strict_types=1); + +use app\components\db\Migration; + +final class m231115_085522_stat_x_power_distrib_abstract3_percentile extends Migration +{ + /** + * @inheritdoc + */ + public function safeUp() + { + $this->addColumns('{{%stat_x_power_distrib_abstract3}}', [ + 'pct5' => $this->decimal(6, 1)->null(), + 'pct25' => $this->decimal(6, 1)->null(), + 'pct75' => $this->decimal(6, 1)->null(), + 'pct80' => $this->decimal(6, 1)->null(), + 'pct95' => $this->decimal(6, 1)->null(), + ]); + + return true; + } + + /** + * @inheritdoc + */ + public function safeDown() + { + $this->dropColumns('{{%stat_x_power_distrib_abstract3}}', [ + 'pct5', + 'pct25', + 'pct75', + 'pct80', + 'pct95', + ]); + + return true; + } + + /** + * @inheritdoc + */ + protected function vacuumTables(): array + { + return [ + '{{%stat_x_power_distrib_abstract3}}', + ]; + } +} diff --git a/models/StatXPowerDistribAbstract3.php b/models/StatXPowerDistribAbstract3.php index e7031b4ee..a9a7f2c44 100644 --- a/models/StatXPowerDistribAbstract3.php +++ b/models/StatXPowerDistribAbstract3.php @@ -22,6 +22,11 @@ * @property double $average * @property double $stddev * @property string $median + * @property string $pct5 + * @property string $pct25 + * @property string $pct75 + * @property string $pct80 + * @property string $pct95 * * @property Rule3 $rule * @property Season3 $season @@ -39,7 +44,7 @@ public function rules() [['season_id', 'rule_id', 'users', 'average'], 'required'], [['season_id', 'rule_id', 'users'], 'default', 'value' => null], [['season_id', 'rule_id', 'users'], 'integer'], - [['average', 'stddev', 'median'], 'number'], + [['average', 'stddev', 'median', 'pct5', 'pct25', 'pct75', 'pct80', 'pct95'], 'number'], [['season_id', 'rule_id'], 'unique', 'targetAttribute' => ['season_id', 'rule_id']], [['rule_id'], 'exist', 'skipOnError' => true, 'targetClass' => Rule3::class, 'targetAttribute' => ['rule_id' => 'id']], [['season_id'], 'exist', 'skipOnError' => true, 'targetClass' => Season3::class, 'targetAttribute' => ['season_id' => 'id']], @@ -55,6 +60,11 @@ public function attributeLabels() 'average' => 'Average', 'stddev' => 'Stddev', 'median' => 'Median', + 'pct5' => 'Pct5', + 'pct25' => 'Pct25', + 'pct75' => 'Pct75', + 'pct80' => 'Pct80', + 'pct95' => 'Pct95', ]; } diff --git a/package-lock.json b/package-lock.json index bfbc595ac..9066c0846 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@hacceuee/s3-pixel-icons": "^1.10.2", "@popperjs/core": "^2.11.8", "autoprefixer": "^10.4.16", - "axios": "^1.6.1", + "axios": "^1.6.2", "babel-loader": "^9.1.3", "bootstrap": "^3.4.1", "bootstrap-notify": "^3.1.3", @@ -26,7 +26,7 @@ "bowser": "^2.11.0", "budoux": "^0.6.0", "cal-heatmap": "^4.2.3", - "caniuse-lite": "^1.0.30001561", + "caniuse-lite": "^1.0.30001562", "chart.js": "^3.9.1", "chartjs-adapter-luxon": "^1.3.1", "chartjs-chart-error-bars": "^3.10.0", @@ -2953,9 +2953,9 @@ "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==" }, "node_modules/axios": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.1.tgz", - "integrity": "sha512-vfBmhDpKafglh0EldBEbVuoe7DyAavGSLWhuSm5ZSEKQnHhBf0xAAwybbNH1IkrJNGnS/VG4I5yxig1pCEXE4g==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", + "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", "dependencies": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", @@ -3653,9 +3653,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001561", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001561.tgz", - "integrity": "sha512-NTt0DNoKe958Q0BE0j0c1V9jbUzhBxHIEJy7asmGrpE0yG63KTV7PLHPnK2E1O9RsQrQ081I3NLuXGS6zht3cw==", + "version": "1.0.30001562", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001562.tgz", + "integrity": "sha512-kfte3Hym//51EdX4239i+Rmp20EsLIYGdPkERegTgU19hQWCRhsRFGKHTliUlsry53tv17K7n077Kqa0WJU4ng==", "funding": [ { "type": "opencollective", @@ -5067,9 +5067,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.582", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.582.tgz", - "integrity": "sha512-89o0MGoocwYbzqUUjc+VNpeOFSOK9nIdC5wY4N+PVUarUK0MtjyTjks75AZS2bW4Kl8MdewdFsWaH0jLy+JNoA==" + "version": "1.4.583", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.583.tgz", + "integrity": "sha512-93y1gcONABZ7uqYe/JWDVQP/Pj/sQSunF0HVAPdlg/pfBnOyBMLlQUxWvkqcljJg1+W6cjvPuYD+r1Th9Tn8mA==" }, "node_modules/emoji-regex": { "version": "8.0.0", @@ -7890,11 +7890,17 @@ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, "node_modules/json-stable-stringify": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.2.tgz", - "integrity": "sha512-eunSSaEnxV12z+Z73y/j5N37/In40GK4GmsSy+tEHJMxknvqnA7/djeYtAgW0GsWHUfg+847WJjKaEylk2y09g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.1.0.tgz", + "integrity": "sha512-zfA+5SuwYN2VWqN1/5HZaDzQKLJHaBVMZIIM+wuYjdptkaQsqzDdqjqf+lZZJUuJq1aanHiY8LhH8LmH+qBYJA==", "dependencies": { - "jsonify": "^0.0.1" + "call-bind": "^1.0.5", + "isarray": "^2.0.5", + "jsonify": "^0.0.1", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -15597,9 +15603,9 @@ "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==" }, "axios": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.1.tgz", - "integrity": "sha512-vfBmhDpKafglh0EldBEbVuoe7DyAavGSLWhuSm5ZSEKQnHhBf0xAAwybbNH1IkrJNGnS/VG4I5yxig1pCEXE4g==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", + "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", "requires": { "follow-redirects": "^1.15.0", "form-data": "^4.0.0", @@ -16130,9 +16136,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001561", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001561.tgz", - "integrity": "sha512-NTt0DNoKe958Q0BE0j0c1V9jbUzhBxHIEJy7asmGrpE0yG63KTV7PLHPnK2E1O9RsQrQ081I3NLuXGS6zht3cw==" + "version": "1.0.30001562", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001562.tgz", + "integrity": "sha512-kfte3Hym//51EdX4239i+Rmp20EsLIYGdPkERegTgU19hQWCRhsRFGKHTliUlsry53tv17K7n077Kqa0WJU4ng==" }, "canvas-renderer": { "version": "2.2.1", @@ -17166,9 +17172,9 @@ } }, "electron-to-chromium": { - "version": "1.4.582", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.582.tgz", - "integrity": "sha512-89o0MGoocwYbzqUUjc+VNpeOFSOK9nIdC5wY4N+PVUarUK0MtjyTjks75AZS2bW4Kl8MdewdFsWaH0jLy+JNoA==" + "version": "1.4.583", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.583.tgz", + "integrity": "sha512-93y1gcONABZ7uqYe/JWDVQP/Pj/sQSunF0HVAPdlg/pfBnOyBMLlQUxWvkqcljJg1+W6cjvPuYD+r1Th9Tn8mA==" }, "emoji-regex": { "version": "8.0.0", @@ -19170,11 +19176,14 @@ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, "json-stable-stringify": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.2.tgz", - "integrity": "sha512-eunSSaEnxV12z+Z73y/j5N37/In40GK4GmsSy+tEHJMxknvqnA7/djeYtAgW0GsWHUfg+847WJjKaEylk2y09g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.1.0.tgz", + "integrity": "sha512-zfA+5SuwYN2VWqN1/5HZaDzQKLJHaBVMZIIM+wuYjdptkaQsqzDdqjqf+lZZJUuJq1aanHiY8LhH8LmH+qBYJA==", "requires": { - "jsonify": "^0.0.1" + "call-bind": "^1.0.5", + "isarray": "^2.0.5", + "jsonify": "^0.0.1", + "object-keys": "^1.1.1" } }, "json-stable-stringify-without-jsonify": { diff --git a/package.json b/package.json index 2a9ae1a1b..f428bc261 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "@hacceuee/s3-pixel-icons": "^1.10.2", "@popperjs/core": "^2.11.8", "autoprefixer": "^10.4.16", - "axios": "^1.6.1", + "axios": "^1.6.2", "babel-loader": "^9.1.3", "bootstrap": "^3.4.1", "bootstrap-notify": "^3.1.3", @@ -24,7 +24,7 @@ "bowser": "^2.11.0", "budoux": "^0.6.0", "cal-heatmap": "^4.2.3", - "caniuse-lite": "^1.0.30001561", + "caniuse-lite": "^1.0.30001562", "chart.js": "^3.9.1", "chartjs-adapter-luxon": "^1.3.1", "chartjs-chart-error-bars": "^3.10.0", diff --git a/views/entire/v3/xpower-distrib3/integrated/abstracts.php b/views/entire/v3/xpower-distrib3/integrated/abstracts.php index a9d2b4258..fd977ee21 100644 --- a/views/entire/v3/xpower-distrib3/integrated/abstracts.php +++ b/views/entire/v3/xpower-distrib3/integrated/abstracts.php @@ -61,7 +61,7 @@ 'value' => fn (Rule3 $model): ?float => TypeHelper::floatOrNull( $abstracts[$model->id]?->average, ), - 'contentOptions' => ['class' => 'text-right'], + 'contentOptions' => ['class' => 'text-right fw-bold'], ], [ 'label' => Yii::t('app', 'Std Dev'), @@ -73,12 +73,48 @@ 'contentOptions' => ['class' => 'text-right'], ], [ - 'label' => Yii::t('app', 'Median'), + 'label' => Yii::t('app', 'Top {percentile}%', ['percentile' => 5]), + 'headerOptions' => ['class' => 'text-center'], + 'format' => ['decimal', 1], + 'value' => fn (Rule3 $model): ?float => TypeHelper::floatOrNull( + $abstracts[$model->id]?->pct95, + ), + 'contentOptions' => ['class' => 'text-right fw-bold'], + ], + [ + 'label' => Yii::t('app', 'Top {percentile}%', ['percentile' => 20]), + 'headerOptions' => ['class' => 'text-center'], + 'format' => ['decimal', 1], + 'value' => fn (Rule3 $model): ?float => TypeHelper::floatOrNull( + $abstracts[$model->id]?->pct80, + ), + 'contentOptions' => ['class' => 'text-right fw-bold'], + ], + [ + 'label' => Yii::t('app', 'Top {percentile}%', ['percentile' => 25]), + 'headerOptions' => ['class' => 'text-center'], + 'format' => ['decimal', 1], + 'value' => fn (Rule3 $model): ?float => TypeHelper::floatOrNull( + $abstracts[$model->id]?->pct75, + ), + 'contentOptions' => ['class' => 'text-right'], + ], + [ + 'label' => Yii::t('app', 'Top {percentile}%', ['percentile' => 50]), 'headerOptions' => ['class' => 'text-center'], 'format' => ['decimal', 1], 'value' => fn (Rule3 $model): ?float => TypeHelper::floatOrNull( $abstracts[$model->id]?->median, ), + 'contentOptions' => ['class' => 'text-right fw-bold'], + ], + [ + 'label' => Yii::t('app', 'Top {percentile}%', ['percentile' => 75]), + 'headerOptions' => ['class' => 'text-center'], + 'format' => ['decimal', 1], + 'value' => fn (Rule3 $model): ?float => TypeHelper::floatOrNull( + $abstracts[$model->id]?->pct25, + ), 'contentOptions' => ['class' => 'text-right'], ], ], diff --git a/views/entire/v3/xpower-distrib3/integrated/histogram.php b/views/entire/v3/xpower-distrib3/integrated/histogram.php index a6524622c..04e671dcf 100644 --- a/views/entire/v3/xpower-distrib3/integrated/histogram.php +++ b/views/entire/v3/xpower-distrib3/integrated/histogram.php @@ -4,6 +4,7 @@ use app\assets\JqueryEasyChartjsAsset; use app\components\helpers\XPowerNormalDistribution; +use app\components\widgets\Budoux; use app\models\Rule3; use app\models\StatXPowerDistribAbstract3; use yii\helpers\Html; @@ -25,9 +26,19 @@ ?>