@@ -76,10 +76,11 @@ const createProgressTextNode = ({ width, color, name, progress, index }) => {
7676 *@param {object } props Function properties.
7777 *@param {Lang } props.lang Programming language object.
7878 *@param {number } props.totalSize Total size of all languages.
79+ *@param {boolean } props.hideProgress Whether to hide percentage.
7980 *@param {number } props.index Index of the programming language.
8081 *@returns {string } Compact layout programming language SVG node.
8182 */
82- const createCompactLangNode = ( { lang, totalSize, index} ) => {
83+ const createCompactLangNode = ( { lang, totalSize, hideProgress , index} ) => {
8384const percentage = ( ( lang . size / totalSize ) * 100 ) . toFixed ( 2 ) ;
8485const staggerDelay = ( index + 3 ) * 150 ;
8586const color = lang . color || "#858585" ;
@@ -88,7 +89,7 @@ const createCompactLangNode = ({ lang, totalSize, index }) => {
8889 <g class="stagger" style="animation-delay:${ staggerDelay } ms">
8990 <circle cx="5" cy="6" r="5" fill="${ color } " />
9091 <text data-testid="lang-name" x="15" y="10" class='lang-name'>
91- ${ lang . name } ${ percentage } %
92+ ${ lang . name } ${ hideProgress ? "" : percentage + "%" }
9293 </text>
9394 </g>
9495 ` ;
@@ -100,9 +101,10 @@ const createCompactLangNode = ({ lang, totalSize, index }) => {
100101 *@param {object[] } props Function properties.
101102 *@param {Lang[] } props.langs Array of programming languages.
102103 *@param {number } props.totalSize Total size of all languages.
104+ *@param {boolean } props.hideProgress Whether to hide percentage.
103105 *@returns {string } Programming languages SVG node.
104106 */
105- const createLanguageTextNode = ( { langs, totalSize} ) => {
107+ const createLanguageTextNode = ( { langs, totalSize, hideProgress } ) => {
106108const longestLang = getLongestLang ( langs ) ;
107109const chunked = chunkArray ( langs , langs . length / 2 ) ;
108110const layouts = chunked . map ( ( array ) => {
@@ -111,6 +113,7 @@ const createLanguageTextNode = ({ langs, totalSize }) => {
111113createCompactLangNode ( {
112114 lang,
113115 totalSize,
116+ hideProgress,
114117 index,
115118} ) ,
116119) ;
@@ -160,9 +163,10 @@ const renderNormalLayout = (langs, width, totalLanguageSize) => {
160163 *@param {Lang[] } langs Array of programming languages.
161164 *@param {number } width Card width.
162165 *@param {number } totalLanguageSize Total size of all languages.
166+ *@param {boolean } hideProgress Whether to hide progress bar.
163167 *@returns {string } Compact layout card SVG object.
164168 */
165- const renderCompactLayout = ( langs , width , totalLanguageSize ) => {
169+ const renderCompactLayout = ( langs , width , totalLanguageSize , hideProgress ) => {
166170const paddingRight = 50 ;
167171const offsetWidth = width - paddingRight ;
168172// progressOffset holds the previous language's width and used to offset the next language
@@ -193,15 +197,21 @@ const renderCompactLayout = (langs, width, totalLanguageSize) => {
193197. join ( "" ) ;
194198
195199return `
196- <mask id="rect-mask">
200+ ${
201+ ! hideProgress
202+ ?`
203+ <mask id="rect-mask">
197204 <rect x="0" y="0" width="${ offsetWidth } " height="8" fill="white" rx="5"/>
198205 </mask>
199206${ compactProgressBar }
200-
201- <g transform="translate(0, 25)">
207+ `
208+ :""
209+ }
210+ <g transform="translate(0,${ hideProgress ?"0" :"25" } )">
202211${ createLanguageTextNode ( {
203212 langs,
204213totalSize :totalLanguageSize ,
214+ hideProgress :hideProgress ,
205215} ) }
206216 </g>
207217 ` ;
@@ -276,6 +286,7 @@ const renderTopLanguages = (topLangs, options = {}) => {
276286 text_color,
277287 bg_color,
278288 hide,
289+ hide_progress,
279290 theme,
280291 layout,
281292 custom_title,
@@ -305,11 +316,17 @@ const renderTopLanguages = (topLangs, options = {}) => {
305316let height = calculateNormalLayoutHeight ( langs . length ) ;
306317
307318let finalLayout = "" ;
308- if ( layout === "compact" ) {
319+ if ( layout === "compact" || hide_progress == true ) {
309320width = width + 50 ; // padding
310- height = calculateCompactLayoutHeight ( langs . length ) ;
311-
312- finalLayout = renderCompactLayout ( langs , width , totalLanguageSize ) ;
321+ height =
322+ calculateCompactLayoutHeight ( langs . length ) + ( hide_progress ?- 25 :0 ) ;
323+
324+ finalLayout = renderCompactLayout (
325+ langs ,
326+ width ,
327+ totalLanguageSize ,
328+ hide_progress ,
329+ ) ;
313330} else {
314331finalLayout = renderNormalLayout ( langs , width , totalLanguageSize ) ;
315332}