Skip to content

Commit

Permalink
Finish for first build
Browse files Browse the repository at this point in the history
  • Loading branch information
rockleona committed Sep 11, 2023
1 parent 8c7f426 commit 509485d
Show file tree
Hide file tree
Showing 88 changed files with 3,182 additions and 2 deletions.
43 changes: 41 additions & 2 deletions source/_posts/visualize-first-try.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,48 @@
---
title: 視覺化探險日記(1) - 以 Python-Doc-ZH-TW 為例
title: 視覺化探險日記(1) - 以 python-docs-zh-tw 為例
date: 2023-09-11 22:35:00
tags:
- dev
- diary
---

{% asset_img pageviews_visitors.png [pageviews_visitors] %}
自從加入了 [python-docs-zh-tw](https://github.com/python/python-docs-zh-tw) 翻譯計畫,好像越做越有心得(?)
畢竟以前沒有這種可以加入社群貢獻的機會,所以這次我沒有放掉這個機會了。

本次任務是因為取得了每個頁面的瀏覽次數等資料 [1]
我想配合上 Organizer 一直有在使用的 [potodo](https://pypi.org/project/potodo/) 工具去計算出每個 po 檔案的翻譯完成度為何 [2]
進行了本次的資料視覺化挑戰。

{% asset_img code_views.png [code_pageviews] %}
> [1] : [python-docs-zh-tw](https://github.com/python/python-docs-zh-tw) 個別頁面的瀏覽資料
{% asset_img code_potodo.png [code_potodo] %}
> [2] : [python-docs-zh-tw](https://github.com/python/python-docs-zh-tw) 各項檔案的翻譯完成度資料
本來想說都靠著前人有經驗產生過的資料,也來自己產生看看,
產生過程都沒問題,**這兩個檔案的正規化 (Normalized) 才是挑戰**

這個機會又讓我跟 [Pandas.DataFrame](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html) 再次熟悉了一下。

最後的結果如下:
1. 頁面瀏覽次數及訪客數的曲線圖
+ Color => Folder
+ X-axis => Visitors
+ Y-axis => Pageviews
+ Filter : 500 < Pageviews < 2500
+ (500 以下過於密集、2500 以上只有Tutorial/index, Library/datetime )
{% asset_img pageviews_visitors.png [pageviews_visitors] %}

2. 頁面瀏覽次數及訪客數的曲線圖
+ Color => Filename
+ X-axis => Pageviews
+ Y-axis => Translated Percent
+ Filter : 500 < Pageviews , Remove Tutorial, Installing
+ Note : 移掉後面兩個是不知道為什麼跟 potodo 的資料對不上
+ Note : 圖片中 Translated Percent 為 0 的也是 potodo 無資料
{% asset_img pageviews_translated.png [pageviews_translated] %}

以前擅長的都是結合 GeoData 的地圖視覺化,這次挑戰純數字資料的視覺化是個挑戰啊。

P.S. 好的資料集真的很重要,向所有的 Data Scientist 看齊!
P.P.S. 不小心喚起了記憶,大學時期分數最慘的科目就是*統計*
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/_posts/visualize-first-try/code_views.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85 changes: 85 additions & 0 deletions themes/frame/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@

# html lang
language: zh-tw

# header
site_brand_name: RockLeon.DevBlog

logo_image:
enable: false
image_path: /logo.png # path to your logo image

menu:
Home: /
Posts: /archives/
Profile: https://cv.rockleon.dev
LinkTree: https://cv.rockleon.dev/linktree

# stylesheets loaded in the <head>
stylesheets:
- /css/style.css

# scripts loaded in the end of the body
scripts:
- /js/frame.js

# favicon
favicon: /favicon.ico

date_format: MMM D, YYYY

# profile
profile:
title: 嗨,陌生人
body: 這邊是我的開發小窩
image: /profile_cover.jpg

links:
Home: /
Posts: /archives/
Profile: https://cv.rockleon.dev
LinkTree: https://cv.rockleon.dev/linktree

# footer
footer:
copyright_info:
enable: false
author:

powered_by: # Powered by Hexo & Frame
enable: true

other_info:
enable: false
content:

# color mode: default / classic / dark
color_mode: default

# mathjax setting
# note: need to install the hexo plugin for math: https://github.com/hexojs/hexo-math
mathjax_enable: false

# comments: support disqus and valine
valine: # valine setup guide: https://valine.js.org/quickstart.html
enable: false
appId: # Your valine app Id
appKey: # Your valine app Key
lang: 'en'
placeholder: 'Say something'
avatar: 'mp'
meta: ['nick', 'mail']

disqus: # disqus setup guide: https://help.disqus.com/en/articles/1717056-publisher-quick-start-guide
enable: false
disqus_url: # your diqsuq url or shortname
language: 'en'

# local search
local_search:
enable: false
place_holder: Search Anything
trigger: auto # auto: trigger search whenever input changes
top_n_per_article: 1 # show top n results per article, show all results by setting to -1
unescape: false # unescape html strings to the readable one
preload: false # reload the search data when the page loads, this will accelerate the search process
1 change: 1 addition & 0 deletions themes/frame/layout/archive.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<%- partial('partials/post_list') %>
4 changes: 4 additions & 0 deletions themes/frame/layout/category.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div id="category">
<%- partial('partials/post_gallery') %>
</div>

1 change: 1 addition & 0 deletions themes/frame/layout/index.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<%- partial('pages/profile') %>
30 changes: 30 additions & 0 deletions themes/frame/layout/layout.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="<%=config.language%>">
<head>
<%- partial('partials/head') %>
</head>
<body>
<div class="mask-border">
</div>

<div class="wrapper">

<%- partial('partials/header') %>

<div class="main">
<div class="flex-container">
<%- body %>
</div>
</div>

<%- partial('partials/footer') %>

</div>

<% if (theme.local_search.enable) {%>
<%- partial('partials/search') %>
<% } %>


</body>
</html>
14 changes: 14 additions & 0 deletions themes/frame/layout/pages/page_head.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<div class="post-head">
<div class="post-info">
<div class="post-title">

<% if (page.title) {%>
<%= page.title %>
<% } else {%>
*Untitled
<% } %>

</div>
</div>
<div class="h-line-primary"></div>
</div>
21 changes: 21 additions & 0 deletions themes/frame/layout/pages/profile.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<div class="profile">
<div class="profile-image">
<% if (theme.profile.image) {%>
<img src="<%= url_for(theme.profile.image)%>" alt="featured_image">
<% } %>
</div>
<div class="post-content profile-content">
<div class="profile-title">
<%=theme.profile.title%>
</div>
<div class="profile-body">
<%=theme.profile.body%>
</div>
<% Object.keys(theme.profile.links).forEach(key => { %>
<div class="profile-link">
<a href="<%= url_for(theme.profile.links[key])%>"><%=key%></a>
</div>
<% }); %>
</div>

</div>
16 changes: 16 additions & 0 deletions themes/frame/layout/partials/footer.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<div class="footer">
<div class="flex-container">
<div class="footer-text">
<% if (theme.footer.other_info.enable) {%>
<%= theme.footer.other_info.content %>
<br>
<% }%>
<% if (theme.footer.copyright_info.enable) {%>
<%= theme.footer.copyright_info.author %> |
<% }%>
<% if (theme.footer.powered_by.enable) {%>
Powered by <a href="https://hexo.io/">Hexo</a> & <a href="https://github.com/zoeingwingkei/frame/">Frame</a>
<% }%>
</div>
</div>
</div>
75 changes: 75 additions & 0 deletions themes/frame/layout/partials/head.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<% if(config.author){ %>
<meta name="author" content="<%- config.author %>">
<% } %>
<% if(config.subtitle){ %>
<meta name="subtitle" content="<%- config.subtitle %>">
<% } %>
<% if(config.description){ %>
<meta name="description" content="<%- config.description %>">
<% } %>
<% if(config.keywords){ %>
<meta name="keywords" content="<%- config.keywords %>">
<% } %>

<%
var title = page.title;
if (is_archive()){
title = __('Archive');
if (is_month()){
title += ': ' + page.year + '/' + page.month;
} else if (is_year()){
title += ': ' + page.year;
}
} else if (is_category()){
title = __('Category') + ': ' + page.category;
} else if (is_tag()){
title = __('Tag') + ': ' + page.tag;
}
%>

<title><% if (title){ %><%= title %> | <% } %><%= config.title %></title>

<%# favicon %>
<% if (theme.favicon){ %>
<link rel="icon" href="<%- url_for(theme.favicon) %>">
<% } %>

<%# font %>
<style>
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&family=Roboto+Mono&display=swap');
</style>

<%# css list %>
<% if (theme.stylesheets !== undefined && theme.stylesheets.length > 0) { %>
<!-- stylesheets list from _config.yml -->
<% theme.stylesheets.forEach(url => { %>
<link rel="stylesheet" href="<%- url_for(url) %>">
<% }); %>
<% } %>

<%# javascript list %>
<% if (theme.scripts !== undefined && theme.scripts.length > 0) { %>
<!-- scripts list from _config.yml -->
<% theme.scripts.forEach(url => { %>
<script src="<%- url_for(url) %>"></script>
<% }); %>
<% } %>

<%# mathjax support %>
<% if(theme.mathjax_enable){ %>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<% } %>

<%# valine comment support %>
<% if(theme.valine.enable){ %>
<script src='https://unpkg.com/valine@1.4.16/dist/Valine.min.js'></script>
<% } %>


38 changes: 38 additions & 0 deletions themes/frame/layout/partials/header.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<div class="header">
<div class="flex-container">
<div class="header-inner">
<div class="site-brand-container">
<a href="<%= url_for()%>">
<% if (theme.logo_image.enable) {%>
<img class="logo-img" src="<%= url_for(theme.logo_image.image_path)%>" alt="logo_image">
<%} else {%>
<%= theme.site_brand_name %>
<% } %>
</a>
</div>
<div id="menu-btn" class="menu-btn" onclick="toggleMenu()">
Menu
</div>
<nav class="site-nav">
<ul class="menu-list">
<% Object.keys(theme.menu).forEach(key => { %>
<% if (url_for(theme.menu[key]) + "index.html" == url_for(page.path)) {%>
<li class="menu-item menu-item-active">
<a href="<%=url_for(theme.menu[key])%>"><%=key%></a>
</li>
<%} else {%>
<li class="menu-item">
<a href="<%=url_for(theme.menu[key])%>"><%=key%></a>
</li>
<% }%>
<% }); %>
<% if (theme.local_search.enable) {%>
<li class="menu-item search-btn">
<a href="#">Search</a>
</li>
<% } %>
</ul>
</nav>
</div>
</div>
</div>
14 changes: 14 additions & 0 deletions themes/frame/layout/partials/paginator.ejs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<% if (page.total > 1){ %>
<div class=paginator>
<div class="h-line-primary"></div>
<nav class="pagination">
<%- paginator({
// prev_text: "&laquo; Prev",
// next_text: "Next &raquo;"
prev_next: false,
end_size: 1,
mid_size: 1,
}) %>
</nav>
</div>
<% } %>
Loading

0 comments on commit 509485d

Please sign in to comment.