Skip to content

Commit

Permalink
feat:js css资源本地化
Browse files Browse the repository at this point in the history
#branch=main
  • Loading branch information
Knight-ZXW committed Oct 11, 2022
1 parent f18697c commit e513222
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 8 deletions.
3 changes: 1 addition & 2 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">StackSampler</string>
<string name="app_name">BlockCanaryX</string>
</resources>
6 changes: 6 additions & 0 deletions flamegraph-ui/src/main/assets/bootstrap.css

Large diffs are not rendered by default.

92 changes: 92 additions & 0 deletions flamegraph-ui/src/main/assets/d3-flamegraph.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
.d3-flame-graph rect {
stroke: #EEEEEE;
fill-opacity: .8;
}

.d3-flame-graph rect:hover {
stroke: #474747;
stroke-width: 0.5;
cursor: pointer;
}

.d3-flame-graph-label {
pointer-events: none;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
font-size: 12px;
font-family: Verdana;
margin-left: 4px;
margin-right: 4px;
line-height: 1.5;
padding: 0 0 0;
font-weight: 400;
color: black;
text-align: left;
}

.d3-flame-graph .fade {
opacity: 0.6 !important;
}

.d3-flame-graph .title {
font-size: 20px;
font-family: Verdana;
}

.d3-flame-graph-tip {
line-height: 1;
font-family: Verdana;
font-size: 12px;
padding: 12px;
background: rgba(0, 0, 0, 0.8);
color: #fff;
border-radius: 2px;
pointer-events: none;
}

/* Creates a small triangle extender for the tooltip */
.d3-flame-graph-tip:after {
box-sizing: border-box;
display: inline;
font-size: 10px;
width: 100%;
line-height: 1;
color: rgba(0, 0, 0, 0.8);
position: absolute;
pointer-events: none;
}

/* Northward tooltips */
.d3-flame-graph-tip.n:after {
content: "\25BC";
margin: -1px 0 0 0;
top: 100%;
left: 0;
text-align: center;
}

/* Eastward tooltips */
.d3-flame-graph-tip.e:after {
content: "\25C0";
margin: -4px 0 0 0;
top: 50%;
left: -8px;
}

/* Southward tooltips */
.d3-flame-graph-tip.s:after {
content: "\25B2";
margin: 0 0 1px 0;
top: -8px;
left: 0;
text-align: center;
}

/* Westward tooltips */
.d3-flame-graph-tip.w:after {
content: "\25B6";
margin: -4px 0 0 -1px;
top: 50%;
left: 100%;
}
1 change: 1 addition & 0 deletions flamegraph-ui/src/main/assets/d3-flamegraph.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions flamegraph-ui/src/main/assets/d3-tip.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions flamegraph-ui/src/main/assets/d3.js

Large diffs are not rendered by default.

16 changes: 11 additions & 5 deletions flamegraph-ui/src/main/assets/flame-graph.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/spiermar/[email protected]/dist/d3-flamegraph.css">
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">-->
<link rel="stylesheet" href="bootstrap.css">
<!-- <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/spiermar/[email protected]/dist/d3-flamegraph.css">-->
<link rel="stylesheet" type="text/css" href="d3-flamegraph.css">

<style>

Expand Down Expand Up @@ -73,13 +75,17 @@ <h3 class="text-muted">Flame Graph</h3>
</div>

<!-- D3.js -->
<script src="https://d3js.org/d3.v4.min.js" charset="utf-8"></script>
<!--<script src="https://d3js.org/d3.v4.min.js" charset="utf-8"></script>-->
<script type="text/javascript" src="d3.js"></script>


<!-- d3-tip -->
<script type="text/javascript" src=https://cdnjs.cloudflare.com/ajax/libs/d3-tip/0.9.1/d3-tip.min.js></script>
<!--<script type="text/javascript" src=https://cdnjs.cloudflare.com/ajax/libs/d3-tip/0.9.1/d3-tip.min.js></script>-->
<script type="text/javascript" src=d3-tip.js></script>

<!-- d3-flamegraph -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/spiermar/[email protected]/dist/d3-flamegraph.min.js"></script>
<!--<script type="text/javascript" src="https://cdn.jsdelivr.net/gh/spiermar/[email protected]/dist/d3-flamegraph.min.js"></script>-->
<script type="text/javascript" src=d3-flamegraph.js></script>

<script type="text/javascript">
var flameGraph = d3.flamegraph()
Expand Down

0 comments on commit e513222

Please sign in to comment.