Back to Metrics

README

source/plugins/stargazers/README.md

3.346.6 KB
Original Source
<!--header--> <table> <tr><td colspan="2"><a href="/README.md#-plugins">← Back to plugins index</a></td></tr> <tr><th colspan="2"><h3>✨ Stargazers</h3></th></tr> <tr><td colspan="2" align="center"><p>This plugin displays stargazers evolution across affiliated repositories.</p> </td></tr> <tr><th>⚠️ Disclaimer</th><td><p>This plugin is not affiliated, associated, authorized, endorsed by, or in any way officially connected with <a href="https://github.com">GitHub</a>. All product and company names are trademarks™ or registered® trademarks of their respective holders.</p> </td></tr> <tr> <th rowspan="3">Supported features <sub><a href="metadata.yml">→ Full specification</a></sub></th> <td><a href="/source/templates/classic/README.md"><code>📗 Classic template</code></a> <a href="/source/templates/repository/README.md"><code>📘 Repository template</code></a></td> </tr> <tr> <td><code>👤 Users</code> <code>👥 Organizations</code> <code>📓 Repositories</code></td> </tr> <tr> <td><code>🔑 (scopeless)</code> <code>🗝️ plugin_stargazers_worldmap_token</code> <code>read:org (optional)</code> <code>read:user (optional)</code> <code>read:packages (optional)</code> <code>repo (optional)</code></td> </tr> <tr> <td colspan="2" align="center"> <details open><summary>Classic charts</summary></img></details> <details><summary>Graph charts</summary></img></details> <details open><summary>Worldmap</summary></img></details>
</td>
</tr> </table> <!--/header-->

🗝️ Obtaining a Google Maps API token

Some features like plugin_stagazers_worldmap require a Google Geocoding API token. Follow instructions from their documentation for more informations.

💳 A billing account is required to get a token. However a recurring monthly credit is offered which means you should not be charged if you don't exceed the free quota.

It is advised to set the quota limit at 1200 requests per day

Use at your own risk, metrics and its authors cannot be held responsible for anything charged.

➡️ Available options

<!--options--> <table> <tr> <td align="center" nowrap="nowrap">Option</i></td><td align="center" nowrap="nowrap">Description</td> </tr> <tr> <td nowrap="nowrap"><h4><code>plugin_stargazers</code></h4></td> <td rowspan="2"><p>Enable stargazers plugin</p> </td> </tr> <tr> <td nowrap="nowrap"><b>type:</b> <code>boolean</code>

<b>default:</b> no

</td> </tr> <tr> <td nowrap="nowrap"><h4><code>plugin_stargazers_days</code></h4></td> <td rowspan="2"><p>Time range</p> <p>If set to <code>0</code> the account registration date will be used.</p> </td> </tr> <tr> <td nowrap="nowrap"><b>type:</b> <code>number</code> <i>(0 ≤ 𝑥)</i>

<b>zero behaviour:</b> see description</br> <b>default:</b> 14

</td> </tr> <tr> <td nowrap="nowrap"><h4><code>plugin_stargazers_charts</code></h4></td> <td rowspan="2"><p>Charts</p> <p>It includes total number of stargazers evolution, along with the number of new stars per day over the last two weeks.</p> </td> </tr> <tr> <td nowrap="nowrap"><b>type:</b> <code>boolean</code>

<b>default:</b> yes

</td> </tr> <tr> <td nowrap="nowrap"><h4><code>plugin_stargazers_charts_type</code></h4></td> <td rowspan="2"><p>Charts display type</p> <ul> <li><code>classic</code>: <code>&lt;div&gt;</code> based charts, simple and lightweight</li> <li><code>graph</code>: <code>&lt;svg&gt;</code> based charts, smooth</li> </ul> <blockquote> <p>⚠️ <code>chartist</code> option has been deprecated and is now equivalent to <code>graph</code></p> </blockquote> </td> </tr> <tr> <td nowrap="nowrap">🌐 Web instances must configure <code>settings.json</code>: <ul> <li><i>metrics.npm.optional.d3</i></li> </ul> <b>type:</b> <code>string</code>

<b>default:</b> classic

<b>allowed values:</b><ul><li>classic</li><li>graph</li><li>chartist</li></ul></td>

</tr> <tr> <td nowrap="nowrap"><h4><code>plugin_stargazers_worldmap</code></h4></td> <td rowspan="2"><p>Stargazers worldmap</p> </td> </tr> <tr> <td nowrap="nowrap">🌐 Web instances must configure <code>settings.json</code>: <ul> <li><i>metrics.api.google.maps</i></li> <li><i>metrics.npm.optional.d3</i></li> </ul> <b>type:</b> <code>boolean</code>

<b>default:</b> no

</td> </tr> <tr> <td nowrap="nowrap"><h4><code>plugin_stargazers_worldmap_token</code></h4></td> <td rowspan="2"><p>Stargazers worldmap token</p> </td> </tr> <tr> <td nowrap="nowrap">🔐 Token

<b>type:</b> <code>token</code>

</td> </tr> <tr> <td nowrap="nowrap"><h4><code>plugin_stargazers_worldmap_sample</code></h4></td> <td rowspan="2"><p>Stargazers worldmap sample</p> <p>Use this setting to randomly sample and limit your stargazers. Helps to avoid consuming too much Google Geocoding API requests while still being representative.</p> </td> </tr> <tr> <td nowrap="nowrap"><b>type:</b> <code>number</code> <i>(0 ≤ 𝑥)</i>

<b>zero behaviour:</b> disable</br> <b>default:</b> 0

</td> </tr> </table> <!--/options-->

ℹ️ Examples workflows

<!--examples-->
yaml
name: Using classic charts
uses: lowlighter/metrics@latest
with:
  filename: metrics.plugin.stargazers.svg
  token: ${{ secrets.METRICS_TOKEN }}
  base: ""
  plugin_stargazers: yes

yaml
name: Using graph charts
uses: lowlighter/metrics@latest
with:
  filename: metrics.plugin.stargazers.graph.svg
  token: ${{ secrets.METRICS_TOKEN }}
  base: ""
  plugin_stargazers: yes
  plugin_stargazers_charts_type: graph

yaml
name: With worldmap
uses: lowlighter/metrics@latest
with:
  filename: metrics.plugin.stargazers.worldmap.svg
  token: ${{ secrets.METRICS_TOKEN }}
  base: ""
  plugin_stargazers: yes
  plugin_stargazers_charts: no
  plugin_stargazers_worldmap: yes
  plugin_stargazers_worldmap_token: ${{ secrets.GOOGLE_MAP_TOKEN }}
  plugin_stargazers_worldmap_sample: 200

<!--/examples-->