My d3 codes are alomost like this example, in this example, the brush functionality works pretty well.
However, when I just copy and paste the <script>...</script>
part of the above example into my index.js
file like this:
<!DOCTYPE html>
<html ng-app="myapp">
<head>
<title>Hello world!</title>
<base href='/'>
<link rel="stylesheet" href="libs/bootstrap/dist/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="libs/d3/d3.min.js"></script>
<!--some more script here-->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="pragma" content="no-cache"/>
</head>
<body ng-controller="MainController as mainCtrl">
<nav class="navbar navbar-default">
<!--navbar here-->
</nav>
<div ng-view> </div>
</body>
</html>
<script>
// exactly the same code in the above d3 brush example
</script>
The d3 brush function works as follows, i.e, the lines get outside of the axis area. My css file is the same as that in the above example. I guess it has something to do with angularjs or bootstrap?
Please advise, thanks a lot.